Skip to content

Commit

Permalink
Assignment of upgrade PRs configuration for third-party packages
Browse files Browse the repository at this point in the history
  • Loading branch information
ringods committed Oct 15, 2024
1 parent ebf8d74 commit 4b44085
Show file tree
Hide file tree
Showing 10 changed files with 106 additions and 2 deletions.
2 changes: 1 addition & 1 deletion provider-ci/internal/pkg/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func getTemplateDirs(templateName string) ([]string, error) {
return []string{"dev-container", "provider", "pulumi-provider", "bridged-provider"}, nil
case "external-bridged-provider":
// Render more specific templates last to allow them to override more general templates.
return []string{"dev-container", "provider", "bridged-provider"}, nil
return []string{"dev-container", "provider", "external-provider", "bridged-provider"}, nil
default:
return nil, fmt.Errorf("unknown template: %s", templateName)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ upstream-provider-name: terraform-provider-#{{ .Config.provider }}#
#{{- if (index .Config "upstreamProviderOrg") }}#
upstream-provider-org: #{{ .Config.upstreamProviderOrg }}#
#{{- end }}#
#{{- if (eq .Config.organization "pulumi") }}#
pulumi-infer-version: true
#{{- end }}#
remove-plugins: true
#{{- if (index .Config "javaGenVersion") }}#
javaVersion: "#{{ .Config.javaGenVersion }}#"
#{{- end }}#
pr-assign: #{{ index .Config "pr-assign" }}#
4 changes: 4 additions & 0 deletions provider-ci/internal/pkg/templates/defaults.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ major-version: 2
# Only set for 5 providers: https://github.com/search?q=org%3Apulumi+path%3A.ci-mgmt.yaml+%22upstream-provider-repo%22&type=code
#upstream-provider-repo: terraform-provider-xyz

# pr-assign is used in the bridge upgrade config. The value must be a valid Github user name.
# Defaults to `pulumi-bot` but can be overridden for third-party packages
pr-assign: pulumi-bot

# lint includes an extra lint job in workflows if enabled (default). Can be set explicit to false.
# This is false in around 8 provider repos: https://github.com/search?q=org%3Apulumi+path%3A.ci-mgmt.yaml+%22lint%3A+false%22&type=code
lint: true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# WARNING: This file is autogenerated - changes will be overwritten if not made via https://github.com/pulumi/ci-mgmt
name: Upgrade provider

on:
workflow_dispatch: {}
schedule:
# At 05:00 on Monday
- cron: 0 5 * * 1

env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

permissions:
contents: write
issues: write
pull-requests: write

jobs:
upgrade_provider:
name: upgrade-provider
runs-on: #{{ .Config.runner.default }}#
steps:
#{{- if .Config.freeDiskSpaceBeforeBuild }}#
# Run as first step so we don't delete things that have just been installed
- name: Free Disk Space (Ubuntu)
uses: #{{ .Config.actionVersions.freeDiskSpace }}#
with:
tool-cache: false
swap-storage: false
dotnet: false
#{{- end }}#
- name: Checkout Repo
uses: #{{ .Config.actionVersions.checkout }}#
#{{- if .Config.checkoutSubmodules }}#
with:
submodules: #{{ .Config.checkoutSubmodules }}#
#{{- end }}#
- name: Setup tools
uses: ./.github/actions/setup-tools
with:
tools: pulumictl, pulumicli, #{{ range $index, $element := .Config.languages }}##{{if $index}}#, #{{end}}##{{ $element }}##{{end}}#
- name: Install upgrade-provider
run: go install github.com/pulumi/upgrade-provider@main
shell: bash
- name: "Set up git identity: name"
run: |
git config --global user.name 'Github Actions'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
shell: bash
- name: Run upgrade-provider
run: upgrade-provider "${{ github.repository }}" --kind="all" #{{ if .Config.javaGenVersion }}#--java-version="#{{ .Config.javaGenVersion }}#"#{{ end }}#
shell: bash
1 change: 1 addition & 0 deletions provider-ci/test-providers/acme/.ci-mgmt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ license:
ignore:
# Package is licensed under Apache 2.0 but license is not picked up correctly by the license detector
- github.com/OpenDNS/vegadns2client
pr-assign: ringods
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# WARNING: This file is autogenerated - changes will be overwritten if not made via https://github.com/pulumi/ci-mgmt
name: Upgrade provider

on:
workflow_dispatch: {}
schedule:
# At 05:00 on Monday
- cron: 0 5 * * 1

env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

permissions:
contents: write
issues: write
pull-requests: write

jobs:
upgrade_provider:
name: upgrade-provider
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Setup tools
uses: ./.github/actions/setup-tools
with:
tools: pulumictl, pulumicli, dotnet, go, nodejs, python
- name: Install upgrade-provider
run: go install github.com/pulumi/upgrade-provider@main
shell: bash
- name: "Set up git identity: name"
run: |
git config --global user.name 'Github Actions'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
shell: bash
- name: Run upgrade-provider
run: upgrade-provider "${{ github.repository }}" --kind="all"
shell: bash
2 changes: 1 addition & 1 deletion provider-ci/test-providers/acme/.upgrade-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
---
upstream-provider-name: terraform-provider-acme
upstream-provider-org: vancluever
pulumi-infer-version: true
remove-plugins: true
pr-assign: ringods
1 change: 1 addition & 0 deletions provider-ci/test-providers/aws/.upgrade-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
upstream-provider-name: terraform-provider-aws
pulumi-infer-version: true
remove-plugins: true
pr-assign: pulumi-bot
1 change: 1 addition & 0 deletions provider-ci/test-providers/cloudflare/.upgrade-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
upstream-provider-name: terraform-provider-cloudflare
pulumi-infer-version: true
remove-plugins: true
pr-assign: pulumi-bot
1 change: 1 addition & 0 deletions provider-ci/test-providers/docker/.upgrade-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ upstream-provider-name: terraform-provider-docker
upstream-provider-org: kreuzwerker
pulumi-infer-version: true
remove-plugins: true
pr-assign: pulumi-bot

0 comments on commit 4b44085

Please sign in to comment.