Skip to content

Commit

Permalink
Combine upstream check & upgrade workflows
Browse files Browse the repository at this point in the history
- Remove the chain of dependencies where we create issues then trigger the upgrade from the issue.
- Rework so we create any new issues, then immediately attempt the provider upgrade.

This removes the need to filter the triggering event to stop other issues triggering upgrades by accident which forces the uses of hard-coded internal bot users which prevents these workflows from being used by third parties.
  • Loading branch information
danielrbradley committed Oct 28, 2024
1 parent 7aabad1 commit 17ebab6
Show file tree
Hide file tree
Showing 11 changed files with 101 additions and 242 deletions.
1 change: 1 addition & 0 deletions provider-ci/internal/pkg/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ func getDeletedFiles(templateName string) []string {
switch templateName {
case "bridged-provider":
return []string{
".github/workflows/check-upstream-upgrade.yml",
"scripts/upstream.sh",
".goreleaser.yml",
".goreleaser.prerelease.yml",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
# WARNING: This file is autogenerated - changes will be overwritten if not made via https://github.com/pulumi/ci-mgmt

name: Upgrade provider
on:
issues:
types:
- opened
workflow_dispatch: {}
schedule:
# 3 AM UTC ~ 8 PM PDT / 7 PM PST daily. Time chosen to run during off hours.
- cron: 0 3 * * *

env:
GH_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
upgrade_provider:
if: ${{ (github.event.issue.user.login == 'pulumi-bot' && contains(github.event.issue.title, 'Upgrade terraform-provider-')) || github.event_name == 'workflow_dispatch' }}
name: upgrade-provider
runs-on: #{{ .Config.runner.default }}#
steps:
Expand All @@ -31,17 +40,19 @@ jobs:
- name: Install upgrade-provider
run: go install github.com/pulumi/upgrade-provider@main
shell: bash
- name: "Set up git identity: name"
- name: "Set up git identity"
run: |
git config --global user.name '[email protected]'
git config --global user.email '[email protected]'
shell: bash
- name: Run upgrade-provider
- name: Create issues for new upstream version
id: upstream_version
run: |
upgrade-provider "$REPO" --kind=check-upstream-version
env:
REPO: ${{ github.repository }}
shell: bash
- name: Attempt provider upgrade
if: steps.upstream_version.outputs.issue_created == 'true'
run: upgrade-provider "${{ github.repository }}" --kind="all" #{{ if .Config.javaGenVersion }}#--java-version="#{{ .Config.javaGenVersion }}#"#{{ end }}#
shell: bash
name: Upgrade provider
on:
issues:
types:
- opened
workflow_dispatch: {}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
# WARNING: This file is autogenerated - changes will be overwritten if not made via https://github.com/pulumi/ci-mgmt

name: Upgrade provider
on:
issues:
types:
- opened
workflow_dispatch: {}
schedule:
# 3 AM UTC ~ 8 PM PDT / 7 PM PST daily. Time chosen to run during off hours.
- cron: 0 3 * * *

env:
GH_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
upgrade_provider:
if: ${{ (github.event.issue.user.login == 'pulumi-bot' && contains(github.event.issue.title, 'Upgrade terraform-provider-')) || github.event_name == 'workflow_dispatch' }}
name: upgrade-provider
runs-on: ubuntu-latest
steps:
Expand All @@ -18,17 +27,19 @@ jobs:
- name: Install upgrade-provider
run: go install github.com/pulumi/upgrade-provider@main
shell: bash
- name: "Set up git identity: name"
- name: "Set up git identity"
run: |
git config --global user.name '[email protected]'
git config --global user.email '[email protected]'
shell: bash
- name: Run upgrade-provider
- name: Create issues for new upstream version
id: upstream_version
run: |
upgrade-provider "$REPO" --kind=check-upstream-version
env:
REPO: ${{ github.repository }}
shell: bash
- name: Attempt provider upgrade
if: steps.upstream_version.outputs.issue_created == 'true'
run: upgrade-provider "${{ github.repository }}" --kind="all"
shell: bash
name: Upgrade provider
on:
issues:
types:
- opened
workflow_dispatch: {}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
# WARNING: This file is autogenerated - changes will be overwritten if not made via https://github.com/pulumi/ci-mgmt

name: Upgrade provider
on:
issues:
types:
- opened
workflow_dispatch: {}
schedule:
# 3 AM UTC ~ 8 PM PDT / 7 PM PST daily. Time chosen to run during off hours.
- cron: 0 3 * * *

env:
GH_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
upgrade_provider:
if: ${{ (github.event.issue.user.login == 'pulumi-bot' && contains(github.event.issue.title, 'Upgrade terraform-provider-')) || github.event_name == 'workflow_dispatch' }}
name: upgrade-provider
runs-on: ubuntu-latest
steps:
Expand All @@ -27,17 +36,19 @@ jobs:
- name: Install upgrade-provider
run: go install github.com/pulumi/upgrade-provider@main
shell: bash
- name: "Set up git identity: name"
- name: "Set up git identity"
run: |
git config --global user.name '[email protected]'
git config --global user.email '[email protected]'
shell: bash
- name: Run upgrade-provider
- name: Create issues for new upstream version
id: upstream_version
run: |
upgrade-provider "$REPO" --kind=check-upstream-version
env:
REPO: ${{ github.repository }}
shell: bash
- name: Attempt provider upgrade
if: steps.upstream_version.outputs.issue_created == 'true'
run: upgrade-provider "${{ github.repository }}" --kind="all"
shell: bash
name: Upgrade provider
on:
issues:
types:
- opened
workflow_dispatch: {}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
# WARNING: This file is autogenerated - changes will be overwritten if not made via https://github.com/pulumi/ci-mgmt

name: Upgrade provider
on:
issues:
types:
- opened
workflow_dispatch: {}
schedule:
# 3 AM UTC ~ 8 PM PDT / 7 PM PST daily. Time chosen to run during off hours.
- cron: 0 3 * * *

env:
GH_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
upgrade_provider:
if: ${{ (github.event.issue.user.login == 'pulumi-bot' && contains(github.event.issue.title, 'Upgrade terraform-provider-')) || github.event_name == 'workflow_dispatch' }}
name: upgrade-provider
runs-on: ubuntu-latest
steps:
Expand All @@ -18,17 +27,19 @@ jobs:
- name: Install upgrade-provider
run: go install github.com/pulumi/upgrade-provider@main
shell: bash
- name: "Set up git identity: name"
- name: "Set up git identity"
run: |
git config --global user.name '[email protected]'
git config --global user.email '[email protected]'
shell: bash
- name: Run upgrade-provider
- name: Create issues for new upstream version
id: upstream_version
run: |
upgrade-provider "$REPO" --kind=check-upstream-version
env:
REPO: ${{ github.repository }}
shell: bash
- name: Attempt provider upgrade
if: steps.upstream_version.outputs.issue_created == 'true'
run: upgrade-provider "${{ github.repository }}" --kind="all"
shell: bash
name: Upgrade provider
on:
issues:
types:
- opened
workflow_dispatch: {}
Loading

0 comments on commit 17ebab6

Please sign in to comment.