Repository navigation
Conversation
0f8b175 to
2ac2817
Compare
d093ec4 to
01fdd5f
Compare
2ac2817 to
a8fcd46
Compare
01fdd5f to
dfc3777
Compare
a8fcd46 to
816177c
Compare
dfc3777 to
4749ab9
Compare
816177c to
d632afb
Compare
4749ab9 to
518a86d
Compare
LeeroyHannigan
left a comment
There was a problem hiding this comment.
Thanks. I read the change against #1467's head d632afb. actionlint 1.7.12 finds nothing in the five workflows at this head or at #1467's head. On this head the release-pr check ran in its other-PR mode and passed (run 46828564831).
The rehearsal publishes nothing. In release-image.yml, release-dev-image.yml and npm-publish.yml, every job that pushes, signs, attests or publishes needs publish-candidate or publish. Those two run only when dry_run is false and commit is empty. The rehearsal always passes dry_run: true, and each gate refuses a commit without dry_run. release-pr.yml runs on pull_request and merge_group with a read token, and each event value reaches a run: block through env:.
Small points, none of them a condition:
- Lines 224-244 of
release-image.yml, the gate for thecommitinput, appear word for word inrelease-dev-image.yml(lines 146-166) and innpm-publish.yml(lines 169-189). A composite action would leave one copy. If the three copies stay, please say why in the description. release-pr.yml:185-189repeats the list of files thatpush-release-prinrelease.ymlmay change (lines 390-394). If one list changes without the other, the release PR fails its own check. If both read one file or run one script, the list exists once.release-rehearsal.yml:59puts each dispatched rehearsal in the grouprelease-rehearsal-refs/heads/main, so two dispatches for different commits cancel each other. Withinputs.commitin the group, the push case stays as it is.- Testing done says that this head has not run on GitHub. The
release-prcheck did run on it, in its other-PR mode. Its release-PR mode, its merge-queue mode and the rehearsal have not run yet.
I found no other open PR that adds a rehearsal or a release PR check. #458 changes npm-publish.yml too, and the two PRs conflict there in five hunks. My review of #1469 covers that overlap.
d632afb to
2d71049
Compare
518a86d to
ae11e38
Compare
|
LeeroyHannigan
left a comment
There was a problem hiding this comment.
Approve again. You fixed the four notes from my last review.
resolve-release-commitholds the commit gate once, and the three gates call it before their tag step. Its script gave the result your answer lists for each case. It also refused a short or uppercase SHA and a SHA that is not on origin..github/release-pr-files.txtis the one list. A patch that adds to it, a listed file with no content check, and a release-please commit that changes it are each refused.- Two dispatched rehearsals for different commits now use different concurrency groups.
- Testing done now lists the checks that ran.
The rehearsal still publishes nothing, and actionlint, check-actions-pinned and shellcheck are clean. One small point inline, not a condition.
CI passed at this head, 67 of 67.
|
|
||
| # 1. Strict shape first: anything else cannot be a release tag and | ||
| # must not reach git commands as a ref expression. | ||
| # resolve-release-commit has checked it; VERSION comes from it. |
There was a problem hiding this comment.
resolve-release-commit refuses a tag that is not vMAJOR.MINOR.PATCH before this step runs, so the check below can no longer fail. The same check stays in release-dev-image.yml (line 147) and npm-publish.yml (line 172), and the action holds a fourth copy. The action could output the version next to the SHA, and the three gates could read VERSION from it and drop their checks. If the copies stay, please say why in the description. Not a condition.
There was a problem hiding this comment.
resolve-release-commit now outputs version next to sha, and the three gates read VERSION from it and no longer check the tag's shape, so the action holds the only copy. The rehearsal's target job now calls it too, before any job checks the commit out: on a dispatch, crates built inputs.commit unchecked, so a commit GitHub serves by SHA, a fork PR's head included, could run in a job of a run on main. Fixed in d1b0654.
ae11e38 to
d1b0654
Compare
LeeroyHannigan
left a comment
There was a problem hiding this comment.
Approve again at d1b0654. resolve-release-commit now outputs the version, and the three gates read it, so the action holds the only tag check.
The rehearsal's target job now checks a dispatched commit with the same action before the crates job builds it. Before, a dispatch's commit reached crates unchecked. I ran the action's script against a scratch copy of the repository. It gave the SHA and the version for a release tag, for a commit on main and for the release PR's head. It refused another commit, a commit without dry_run, a malformed tag and a missing tag.
actionlint, check-actions-pinned and shellcheck are clean. CI passed at this head, 67 of 67.
Release tags are protected, so a failure after the tag that needs a code change costs a version. With the release PR the merge creates the tag, so the rehearsal has to run on the PR, and the merge queue must merge the tree that was rehearsed. This adds release-rehearsal.yml, which dry-runs the build workflows on each push to the release PR's branch, and release-pr.yml with the check `release-pr`, which the admin makes required on main. On any other PR it checks only that the manifest and Cargo.toml name one version. release-image, release-dev-image and npm-publish get a workflow_call trigger with their dispatch inputs and a commit input. With dry_run and a commit, the gate rehearses that commit before it is tagged: it skips the tag checks (and npm-publish its check of package.json on main) and keeps the version checks against the tag the commit will get. The gate refuses a commit without dry_run or one that is neither on main nor the release PR's head, and the publish jobs also require an empty commit. The three gates resolve the commit with one composite action, .github/actions/resolve-release-commit, which holds the tag and commit rules that each gate had a copy of, and outputs the commit and the version, so the gates no longer check the tag's shape themselves. Any public repository can call a reusable workflow, and the called run's certificate names the called file, so each gate's first step refuses to run outside ExtendDB/extenddb. The image and SBOM artifacts are named after the image, so the calls in one run never share an artifact name, and npm-publish downloads only its own binaries. release-rehearsal.yml runs on push to the release-please branch and on workflow_dispatch from main. It calls release-image per backend image, release-dev-image and npm-publish with dry_run on the pushed commit and the manifest's version. Its target job checks the commit with resolve-release-commit before any job checks it out, because the crates job builds it: without that, a dispatch could build any commit GitHub serves by SHA, a fork PR's head included, in a run on main. A newer push cancels the older run; a dispatched rehearsal is grouped by its commit, so dispatches for two commits do not cancel each other at the top level. The called workflows' dry-run groups name only the calling workflow, so two rehearsals still run each build one at a time. It never runs on pull_request, so a fork PR never starts it. The image calls grant id-token, packages and attestations write and the npm call id-token write, because a caller must grant what a called job asks for, even a skipped one. Its crates job runs release-crates.yml's plan and verify steps (devtools/publish-crates --dry-run, cargo package --workspace --locked on the release's toolchain, and devtools/check-crate-packages). A dry run of a called workflow takes a concurrency group named after the calling workflow, so a rehearsal and a dispatched dry run do not replace each other's pending run. release-pr.yml has contents and actions read. On the release PR it checks that the three manifests name one version, that cargo metadata --locked and devtools/check-released-through pass, and that the branch holds only release-please's commit, which may change only the manifest and the files release-please-config.json on main lists, and at most push-release-pr's commit, which may change only the files in .github/release-pr-files.txt, the list push-release-pr reads. Then it waits up to 90 minutes for the rehearsal run on the PR's head and passes only if that run succeeded. On a merge queue entry whose own change (head against its first parent) touches the manifest, it passes only when the entry's tree is the release PR head's tree. A PR queued ahead of the release PR makes the trees differ, the queue drops the release PR, and the release workflow run of the next push to main rebuilds it. This relies on the queue setting "Only merge non-failing pull requests", which is on. Until the release automation is on (RELEASE_APP_CLIENT_ID set), an entry that changes the manifest and is not the release PR passes, so releases by hand work as today. On every other PR and queue entry it checks that the manifest and Cargo.toml name one version, so a version change by hand cannot leave the manifest behind. The commit check reads authors and files, which a push by hand could imitate. packaging/README.md's setup adds a branch ruleset that lets only the App push to the release PR's branch. Before this takes effect, the admin makes `release-pr` required. A PR that was open before this merged gets the check on its next push. Signed-off-by: Scott Robinson <robinnsc@amazon.com>
2d71049 to
c9d56f6
Compare
d1b0654 to
6d3f8a7
Compare
|
Changes in 6d3f8a7, restacked on #1467's c9d56f6:
|
LeeroyHannigan
left a comment
There was a problem hiding this comment.
Approve again at 6d3f8a7. The check of release-please's commit now reads its file list from release-please-config.json on the commit's parent, in place of its own case list. That is the list prepare-release-pr reads in #1467. On the config at #1467's head, the list holds the same six files as the old list. When the parent has no config, the step stops with "lists no extra-files", so a missing config fails closed. actionlint and shellcheck are clean.
CI on 6d3f8a7: 67 checks passed. One run of the PR title check was cancelled when a second run started, and the second run passed.
Release automation (#1395), PR 5 of 6. #1464 (PR title check), #1465 (signing in a called workflow) and #1466 (freeze-migrations) have merged. Stack: #1467 release-please ← #1468 rehearsal ← #1469 release-publish. Merge in that order.
What
Adds two workflows for the release PR and makes the three build workflows reusable.
release-rehearsal.ymldry-runsrelease-image(each backend image),release-dev-imageandnpm-publishon each push to the release PR's branch, with the commit and the version in the release-please manifest. Itscratesjob runsrelease-crates.yml's plan and verify steps (the publish plan,cargo package --workspace --lockedon the release's toolchain, the crates.io package rules). A newer push cancels the older run. It also runs onworkflow_dispatchfrommain. Itstargetjob checks the commit withresolve-release-commitbefore any job checks it out, because thecratesjob builds it: GitHub serves every PR's head by SHA, a fork's included, so without the check a dispatch could build any commit in a run onmain. It never runs on pull requests, so a fork PR never starts it.release-pr.ymlholds one check,release-pr, withcontentsandactionsread only:.release-please-manifest.jsonandCargo.tomlname one version, so a version change by hand cannot leave the manifest behind;cargo metadata --lockedanddevtools/check-released-throughpass, and that the branch holds only release-please's commit, which may change only the manifest and the files thatrelease-please-config.jsononmainlists, and at mostpush-release-pr's commit, which may change only the files in.github/release-pr-files.txt, the listpush-release-prreads; then it waits up to 90 minutes for the rehearsal run on the PR's head and passes only if that run succeeded;release-image,release-dev-imageandnpm-publishget aworkflow_calltrigger with their dispatch inputs and acommitinput. Withdry_runand a commit onmainor the release PR's head, the gate rehearses that commit before it is tagged: it skips the tag checks and keeps the version checks. Each gate's first step refuses to run outsideExtendDB/extenddb. The three gates resolve the commit with one composite action,.github/actions/resolve-release-commit, which also outputs the version, so the gates no longer check the tag's shape themselves. Image and SBOM artifacts are named after the image, and npm-publish downloads only its own binaries, so calls in one run never share an artifact. A dry run's concurrency group is named after the calling workflow, so a rehearsal and a dispatched dry run do not replace each other's pending run. A dispatched rehearsal is grouped by its commit, so dispatches for two commits do not cancel each other at the top level; the called build workflows' dry-run groups name only the calling workflow, so two rehearsals still run each build one at a time.Why
Part of #1395. Release tags are protected, so a failure after the tag that needs a code change costs a version. Once merging the release PR creates the tag, the rehearsal has to run on the PR, and the merge queue must merge the tree that was rehearsed. The rehearsal now covers the crates.io package step too, so the merge, which publishes after #1469, needs no local step first.
Testing done
workflow_callfrom a push-triggered caller and passed every gate and build, with every publish job skipped: https://github.com/ExtendDB/extenddb/actions/runs/45515054457. That version did not yet have the repository check, the release PR head check, the per-image artifact names orrelease-pr.yml. On this stack, therelease-prcheck has run only in its other-PR mode (run 46828564831); its release-PR and merge-queue modes and the rehearsal have not run yet. The first push to the release PR's branch is their first real run.run:block extracted verbatim and tested: therelease-prdecision for each event on realmaincommits and simulated release branches, including an entry queued behind the release PR; the polling logic with a fakegh(cancelled runs, reruns, API errors, both time limits); the gate's commit input (a commit onmain, the release PR head, a fork PR head, a random SHA).resolve-release-commit's script against origin, as the gates and the rehearsal'stargetcall it: v1.1.0 resolves to its commit and version; a missing tag, a malformed tag, a commit without dry_run, a short SHA, a SHA not on origin, and a commit that is neither on main nor the release PR's head (a fork PR's head among them) are refused.Cargo.lock, pass. Refused: a second commit that changes a file not in.github/release-pr-files.txt; amainwithout that list; a release-please commit that changes a filerelease-please-config.jsondoes not list, or adds the file to the config in the same commit.devtools/check-actions-pinnedare clean.Setup (admin)
release-pra required check onmain(GitHub Actions app). A PR that was open before this merged gets the check on its next push. UntilRELEASE_APP_CLIENT_IDis set, a queue entry that changes the manifest passes, so releases by hand work as before.ALLGREENtoday); the queue rule depends on it.release-please--branches--main--components--extenddb(restrict creations, updates and deletions; no force-push rule; the App as the only bypass actor), so only the App pushes to the release PR's branch.release-prchecks the commits' authors and files, which a push by hand could imitate.Checklist
cargo test --workspace): not run, no Rust changecargo fmt --check): no Rust changecargo clippy -- -W clippy::pedantic): no Rust changeStoragetrait, auth model, on-diskformat, or public CLI surface, an RFC has been accepted or is linked
below. Otherwise, an ADR captures the decision (link below).
ADR / RFC: n/a: CI and release tooling only; the design is discussed in #1395
Breaking changes
None. A dispatch of a build workflow behaves as before; the artifact names inside a run change.
By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache License 2.0 and I agree to the Developer Certificate of
Origin (DCO). See CONTRIBUTING.md for details.