Skip to content

Commit

Permalink
Support for adding required labels used by pulumi/ci-mgmt using a sin…
Browse files Browse the repository at this point in the history
…gle option

Signed-off-by: Ringo De Smet <[email protected]>
  • Loading branch information
ringods authored and tmeckel committed Nov 8, 2024
1 parent 749c91b commit 0606987
Show file tree
Hide file tree
Showing 14 changed files with 46 additions and 67 deletions.
17 changes: 1 addition & 16 deletions 02-repositories/acme.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,4 @@ name: pulumi-acme
description: Pulumi provider for ACME
type: provider
template: pulumi-tf-provider-boilerplate
labels:
- name: needs-release/major
color: c4dff5
description: Indicates that this PR requires a major release after merging
- name: needs-release/minor
color: c4dff5
description: Indicates that this PR requires a minor release after merging
- name: needs-release/patch
color: c4dff5
description: Indicates that this PR requires a minor release after merging
- name: kind/bug
color: bfd4f2
description: Some behavior is incorrect or out of spec
- name: kind/enhancement
color: bfd4f2
description: Improvements or new features
workflows: ci-mgmt
2 changes: 1 addition & 1 deletion 02-repositories/cockroach.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ description: Pulumi provider for Cockroach DB
type: provider
template: pulumi-tf-provider-boilerplate
import: true
hasDownloads: true
workflows: ci-mgmt
3 changes: 2 additions & 1 deletion 02-repositories/configcat.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: pulumi-configcat
description: Pulumi provider for ConfigCat
type: provider
template: pulumi-tf-provider-boilerplate
template: pulumi-tf-provider-boilerplate
workflows: ci-mgmt
1 change: 1 addition & 0 deletions 02-repositories/doppler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ name: pulumi-doppler
description: Pulumi provider for Doppler
type: provider
template: pulumi-tf-provider-boilerplate
workflows: ci-mgmt
1 change: 1 addition & 0 deletions 02-repositories/gandi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ name: pulumi-gandi
description: Pulumi provider for Gandi domains / cloud
type: provider
template: pulumi-tf-provider-boilerplate
workflows: ci-mgmt
1 change: 1 addition & 0 deletions 02-repositories/grafana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ type: provider
template: pulumi-tf-provider-boilerplate
import: true
hasDownloads: true
workflows: ci-mgmt
17 changes: 1 addition & 16 deletions 02-repositories/matchbox.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,4 @@ name: pulumi-matchbox
description: Pulumi provider for the Matchbox iPXE server
type: provider
template: pulumi-tf-provider-boilerplate
labels:
- name: needs-release/major
color: c4dff5
description: Indicates that this PR requires a major release after merging
- name: needs-release/minor
color: c4dff5
description: Indicates that this PR requires a minor release after merging
- name: needs-release/patch
color: c4dff5
description: Indicates that this PR requires a minor release after merging
- name: kind/bug
color: bfd4f2
description: Some behavior is incorrect or out of spec
- name: kind/enhancement
color: bfd4f2
description: Improvements or new features
workflows: ci-mgmt
17 changes: 1 addition & 16 deletions 02-repositories/scaleway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,4 @@ name: pulumi-scaleway
description: Pulumi provider for Scaleway
type: provider
template: pulumi-tf-provider-boilerplate
labels:
- name: needs-release/major
color: c4dff5
description: Indicates that this PR requires a major release after merging
- name: needs-release/minor
color: c4dff5
description: Indicates that this PR requires a minor release after merging
- name: needs-release/patch
color: c4dff5
description: Indicates that this PR requires a minor release after merging
- name: kind/bug
color: bfd4f2
description: Some behavior is incorrect or out of spec
- name: kind/enhancement
color: bfd4f2
description: Improvements or new features
workflows: ci-mgmt
1 change: 1 addition & 0 deletions 02-repositories/sentry.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
name: pulumi-sentry
description: Pulumi provider for Sentry.io
type: provider
workflows: ci-mgmt
1 change: 1 addition & 0 deletions 02-repositories/talos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ name: pulumi-talos
description: Pulumi provider for Talos
type: provider
template: pulumi-provider-boilerplate
workflows: ci-mgmt
17 changes: 1 addition & 16 deletions 02-repositories/unifi.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
name: pulumi-unifi
description: Pulumi provider for Unifi network gear
type: provider
labels:
- name: needs-release/major
color: c4dff5
description: Indicates that this PR requires a major release after merging
- name: needs-release/minor
color: c4dff5
description: Indicates that this PR requires a minor release after merging
- name: needs-release/patch
color: c4dff5
description: Indicates that this PR requires a minor release after merging
- name: kind/bug
color: bfd4f2
description: Some behavior is incorrect or out of spec
- name: kind/enhancement
color: bfd4f2
description: Improvements or new features
workflows: ci-mgmt
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"typescript": "^4.7.3"
},
"volta": {
"node": "18.20.4"
"node": "20.16.0",
"npm": "10.9.0"
},
"dependencies": {
"@pulumi/github": "^6.0.0",
Expand Down
1 change: 1 addition & 0 deletions src/configTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const Repository = RT.Record({
template: RT.String.optional(),
removable: RT.Boolean.optional(),
archived: RT.Boolean.optional(),
workflows: RT.Literal('ci-mgmt').optional(),
})

export type Team = Static<typeof Team>
Expand Down
31 changes: 31 additions & 0 deletions src/github/repositories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ abstract class BaseRepository extends pulumi.ComponentResource {
color: label.color,
}, {
parent: this,
deleteBeforeReplace: true,
});
})
})
Expand Down Expand Up @@ -187,6 +188,36 @@ export function configureRepositories(repositoryArgs: Repository[], allTeams: Ma
}
}

if (repositoryInfo.workflows == 'ci-mgmt') {
// The following labels are required for the workflows generated by pulumi/ci-mgmt
// No testing of duplicates is done here, as the CI will fail if the labels are not unique
labelArgs.push({
name: 'needs-release/major',
color: 'c4dff5',
description: 'Indicates that this PR requires a major release after merging',
});
labelArgs.push({
name: 'needs-release/minor',
color: 'c4dff5',
description: 'Indicates that this PR requires a minor release after merging',
});
labelArgs.push({
name: 'needs-release/patch',
color: 'c4dff5',
description: 'Indicates that this PR requires a patch release after merging',
});
labelArgs.push({
name: 'kind/bug',
color: 'bfd4f2',
description: 'Some behavior is incorrect or out of spec',
});
labelArgs.push({
name: 'kind/enhancement',
color: 'bfd4f2',
description: 'Improvements or new features',
});
}

switch (repositoryInfo.type) {
case 'administrative': {
repositories.set(repositoryInfo.name, new AdministrativeRepository(repositoryInfo.name, {
Expand Down

0 comments on commit 0606987

Please sign in to comment.