From 6cb8a70a06d23a7c72491e33ddab12914c06aefb Mon Sep 17 00:00:00 2001 From: Sean Tang <171081544+seant-aws@users.noreply.github.com> Date: Thu, 5 Nov 2026 18:55:51 +0000 Subject: [PATCH 1/5] ci: add the OpenJD release train workflow The caller of aws-deadline/.github's reusable release-train workflow, inert until the RELEASE_TRAIN_ENABLED variable is true. Dependabot no longer proposes openjd-* updates and the auto-approve job skips them: the release train owns those bumps. Signed-off-by: Sean Tang <171081544+seant-aws@users.noreply.github.com> --- .github/dependabot.yml | 3 ++ .github/workflows/auto_approve.yml | 2 + .github/workflows/release_train.yml | 60 +++++++++++++++++++++++++++++ 3 files changed, 65 insertions(+) create mode 100644 .github/workflows/release_train.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 22747bee..9ab3f810 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -13,6 +13,9 @@ updates: commit-message: prefix: "chore(deps):" ignore: + # The OpenJD release train bumps the openjd-* packages itself (release_train.yml), with its tests and + # release notes; a Dependabot PR for them would race it. + - dependency-name: "openjd-*" # black 26+ drops Python 3.9 compat and produces different formatting - dependency-name: "black" update-types: ["version-update:semver-major"] diff --git a/.github/workflows/auto_approve.yml b/.github/workflows/auto_approve.yml index b4838ce3..1d0c33e2 100644 --- a/.github/workflows/auto_approve.yml +++ b/.github/workflows/auto_approve.yml @@ -15,6 +15,8 @@ jobs: with: github-token: "${{ secrets.GITHUB_TOKEN }}" - name: Approve a PR + # Never an openjd-* update: the release train owns those bumps (dependabot.yml ignores them). + if: ${{ !contains(steps.metadata.outputs.dependency-names, 'openjd-') }} run: gh pr review --approve "$PR_URL" env: PR_URL: ${{ github.event.pull_request.html_url }} diff --git a/.github/workflows/release_train.yml b/.github/workflows/release_train.yml new file mode 100644 index 00000000..5b31d5a3 --- /dev/null +++ b/.github/workflows/release_train.yml @@ -0,0 +1,60 @@ +# The OpenJD release train for this repository. The train runs in AWS and holds no GitHub credential: this +# workflow asks it what to do (start a train for a new upstream release, push a bot/* branch, open its PR, +# notice a merge, dispatch Release: Bump) and does the GitHub writes with this job's GITHUB_TOKEN. All the logic +# and its checks live in the reusable workflow; this caller only sets the triggers and forwards the variables +# and secrets. +# +# Inert until an admin sets the variable RELEASE_TRAIN_ENABLED=true (the job is skipped otherwise). +# RELEASE_TRAIN_MODE names the train's mode, the secret RELEASE_TRAIN_ROLE the AWS role that may invoke the +# train's gateway. +# +# A PR the train opens has its CI held until a maintainer approves the run; review and squash-merge it as +# usual. The merge (a push to the default branch) runs this workflow, which tells the train. +# +# What runs it: a merge pushes, the repository's own "Release: Publish" completing, an upstream repository's +# run after its release (workflow_dispatch), and a person (workflow_dispatch). A run that started or advanced +# a train waits for the train's next step. The daily schedule is the backstop for an event that went missing. +name: Release train + +on: + schedule: + # Daily backstop, off the hour. + - cron: "17 6 * * *" + workflow_dispatch: + push: + # The default branch: a merged bot PR is reported right away instead of on the next schedule. + branches: [mainline] + # A release: the train sees it without waiting for the schedule. The run is only a signal: it runs this file + # from the default branch with the default branch's OIDC subject, and the reusable workflow reads nothing of + # the run that triggered it (no artifact, head ref or event payload). + workflow_run: # zizmor: ignore[dangerous-triggers] + workflows: ["Release: Publish"] + types: [completed] + +# One run at a time per repository; a run that finds nothing to do takes a few seconds. +concurrency: + group: release-train + cancel-in-progress: false + +permissions: {} + +jobs: + train: + if: ${{ vars.RELEASE_TRAIN_ENABLED == 'true' }} + # Our own reusable workflow, referenced by branch like every aws-deadline/.github workflow (the + # aws-deadline zizmor policy allows that ref pin for aws-deadline/*). + uses: aws-deadline/.github/.github/workflows/reusable_release_train.yml@mainline + permissions: + contents: write # push bot/* branches; create tags and releases (rehearsal only) + pull-requests: write # open and update the train's PRs and their labels + actions: write # dispatch this repository's own Release: Bump (live mode) + id-token: write # OIDC tokens for the AWS role and the gateway + with: + mode: ${{ vars.RELEASE_TRAIN_MODE }} + # The repositories this one may start after a release (also on the train's own allowlist). + dispatch_repos: "OpenJobDescription/openjd-sessions-for-python OpenJobDescription/openjd-cli aws-deadline/deadline-cloud-worker-agent" + secrets: + role_arn: ${{ secrets.RELEASE_TRAIN_ROLE }} + # The release workflows' token, used only by the dispatch step to run release_train.yml in + # dispatch_repos. Optional: without it those repositories' daily run picks a release up. + dispatch_token: ${{ secrets.CI_TOKEN }} From 5e5834323cb40beb21648d63acd3ebca21bdc8a1 Mon Sep 17 00:00:00 2001 From: Sean Tang <171081544+seant-aws@users.noreply.github.com> Date: Thu, 5 Nov 2026 20:44:57 +0000 Subject: [PATCH 2/5] ci: dispatch downstream release trains with one bot-owned token per organization Pass RELEASE_TRAIN_DISPATCH_TOKEN (OpenJobDescription repositories) and RELEASE_TRAIN_DISPATCH_TOKEN_AWS_DEADLINE (aws-deadline repositories) to the reusable workflow's per-organization dispatch secrets, in place of the release workflows' token. Both are optional; without one, that organization's downstream repositories pick a release up on their daily run. Signed-off-by: Sean Tang <171081544+seant-aws@users.noreply.github.com> --- .github/workflows/release_train.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release_train.yml b/.github/workflows/release_train.yml index 5b31d5a3..228df81a 100644 --- a/.github/workflows/release_train.yml +++ b/.github/workflows/release_train.yml @@ -55,6 +55,8 @@ jobs: dispatch_repos: "OpenJobDescription/openjd-sessions-for-python OpenJobDescription/openjd-cli aws-deadline/deadline-cloud-worker-agent" secrets: role_arn: ${{ secrets.RELEASE_TRAIN_ROLE }} - # The release workflows' token, used only by the dispatch step to run release_train.yml in - # dispatch_repos. Optional: without it those repositories' daily run picks a release up. - dispatch_token: ${{ secrets.CI_TOKEN }} + # Bot-owned, Actions-only dispatch tokens, one per organization, used only by the dispatch step to run + # release_train.yml in dispatch_repos. Optional: without an organization's token its repositories pick a + # release up on their daily run. + dispatch_token_openjd: ${{ secrets.RELEASE_TRAIN_DISPATCH_TOKEN }} + dispatch_token_aws_deadline: ${{ secrets.RELEASE_TRAIN_DISPATCH_TOKEN_AWS_DEADLINE }} From bcc74f188ed285f381584e86c7f6cc59b610acb2 Mon Sep 17 00:00:00 2001 From: Sean Tang <171081544+seant-aws@users.noreply.github.com> Date: Mon, 9 Nov 2026 23:35:56 +0000 Subject: [PATCH 3/5] feat: add a Monday check for a weekly release Runs the release train every Monday next to its daily backstop, for the train's planned weekly release check. It does nothing until the release train's weekly mode is enabled; the repository variable RELEASE_TRAIN_WEEKLY=false pauses it. Signed-off-by: Sean Tang <171081544+seant-aws@users.noreply.github.com> --- .github/workflows/release_train.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release_train.yml b/.github/workflows/release_train.yml index 228df81a..f4b29873 100644 --- a/.github/workflows/release_train.yml +++ b/.github/workflows/release_train.yml @@ -20,6 +20,8 @@ on: schedule: # Daily backstop, off the hour. - cron: "17 6 * * *" + # Monday check for a weekly release; the train decides. Pause with the repo variable RELEASE_TRAIN_WEEKLY=false. + - cron: "17 15 * * 1" workflow_dispatch: push: # The default branch: a merged bot PR is reported right away instead of on the next schedule. From 5c570ac2f919a4e5dafc1b0ee34b6231eaeaf4c9 Mon Sep 17 00:00:00 2001 From: Sean Tang <171081544+seant-aws@users.noreply.github.com> Date: Tue, 17 Nov 2026 18:14:14 +0000 Subject: [PATCH 4/5] docs(release-train): correct what the train does in the caller comments The Dependabot comment said the train writes release notes, and the contents: write comment said it creates tags and releases. The train opens PRs that people review and merge; release notes come from this repository's own generator, and Release: Publish tags and releases (the train makes a prerelease tag only in rehearsal mode). The workflow_run comment now says what the reusable workflow reads of the triggering run and that it goes on only for a successful Publish of the release branch. Signed-off-by: Sean Tang <171081544+seant-aws@users.noreply.github.com> --- .github/dependabot.yml | 4 ++-- .github/workflows/release_train.yml | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 9ab3f810..d01d604f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -13,8 +13,8 @@ updates: commit-message: prefix: "chore(deps):" ignore: - # The OpenJD release train bumps the openjd-* packages itself (release_train.yml), with its tests and - # release notes; a Dependabot PR for them would race it. + # The OpenJD release train bumps the openjd-* packages itself (release_train.yml) in PRs that people + # review and merge; a Dependabot PR for them would race it. - dependency-name: "openjd-*" # black 26+ drops Python 3.9 compat and produces different formatting - dependency-name: "black" diff --git a/.github/workflows/release_train.yml b/.github/workflows/release_train.yml index f4b29873..b659597f 100644 --- a/.github/workflows/release_train.yml +++ b/.github/workflows/release_train.yml @@ -27,8 +27,9 @@ on: # The default branch: a merged bot PR is reported right away instead of on the next schedule. branches: [mainline] # A release: the train sees it without waiting for the schedule. The run is only a signal: it runs this file - # from the default branch with the default branch's OIDC subject, and the reusable workflow reads nothing of - # the run that triggered it (no artifact, head ref or event payload). + # from the default branch with the default branch's OIDC subject. The reusable workflow reads only the + # triggering run's conclusion, head repository, head branch and URL, and goes on only for a successful + # Publish of this repository's own release branch. workflow_run: # zizmor: ignore[dangerous-triggers] workflows: ["Release: Publish"] types: [completed] @@ -47,7 +48,7 @@ jobs: # aws-deadline zizmor policy allows that ref pin for aws-deadline/*). uses: aws-deadline/.github/.github/workflows/reusable_release_train.yml@mainline permissions: - contents: write # push bot/* branches; create tags and releases (rehearsal only) + contents: write # push bot/* branches; a prerelease tag in rehearsal mode only pull-requests: write # open and update the train's PRs and their labels actions: write # dispatch this repository's own Release: Bump (live mode) id-token: write # OIDC tokens for the AWS role and the gateway From 8aa50b52c07b2fbee000be848a84a6e338776240 Mon Sep 17 00:00:00 2001 From: Sean Tang <171081544+seant-aws@users.noreply.github.com> Date: Tue, 17 Nov 2026 22:32:38 +0000 Subject: [PATCH 5/5] ci: say the release train runs only in live mode The reusable workflow no longer has a rehearsal mode or creates tags, so the permission comments and the mode note now say what the train does: push bot/* branches, dispatch Release: Bump, and run only with RELEASE_TRAIN_MODE=live. Signed-off-by: Sean Tang <171081544+seant-aws@users.noreply.github.com> --- .github/workflows/release_train.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release_train.yml b/.github/workflows/release_train.yml index b659597f..b8747471 100644 --- a/.github/workflows/release_train.yml +++ b/.github/workflows/release_train.yml @@ -5,8 +5,8 @@ # and secrets. # # Inert until an admin sets the variable RELEASE_TRAIN_ENABLED=true (the job is skipped otherwise). -# RELEASE_TRAIN_MODE names the train's mode, the secret RELEASE_TRAIN_ROLE the AWS role that may invoke the -# train's gateway. +# RELEASE_TRAIN_MODE must be live (any other value fails the run); the secret RELEASE_TRAIN_ROLE names the AWS +# role that may invoke the train's gateway. # # A PR the train opens has its CI held until a maintainer approves the run; review and squash-merge it as # usual. The merge (a push to the default branch) runs this workflow, which tells the train. @@ -48,9 +48,9 @@ jobs: # aws-deadline zizmor policy allows that ref pin for aws-deadline/*). uses: aws-deadline/.github/.github/workflows/reusable_release_train.yml@mainline permissions: - contents: write # push bot/* branches; a prerelease tag in rehearsal mode only + contents: write # push bot/* branches pull-requests: write # open and update the train's PRs and their labels - actions: write # dispatch this repository's own Release: Bump (live mode) + actions: write # dispatch this repository's own Release: Bump id-token: write # OIDC tokens for the AWS role and the gateway with: mode: ${{ vars.RELEASE_TRAIN_MODE }}