Repository navigation
Conversation
d093ec4 to
01fdd5f
Compare
6ed50b4 to
0208bc1
Compare
0208bc1 to
050e05e
Compare
01fdd5f to
dfc3777
Compare
050e05e to
96ec1b8
Compare
dfc3777 to
4749ab9
Compare
96ec1b8 to
ba7ffeb
Compare
4749ab9 to
518a86d
Compare
ba7ffeb to
e657320
Compare
LeeroyHannigan
left a comment
There was a problem hiding this comment.
Thanks. I read the change against #1468's head 518a86d. actionlint 1.7.12 finds nothing new in the workflows that this PR changes, and shellcheck finds nothing in the run: steps of verify-image and sign-image. The release-pr check ran on this head in its other-PR mode and passed (run 46828568118).
I checked these parts of the publish path, and they work as the description says:
- The signed paths stay on
workflow_dispatch.release.yml:198startsrelease-publish.ymlwithgh workflow run ... --ref mainand does not call it. So the--certificate-github-workflow-trigger workflow_dispatchchecks of #1465 keep their meaning. - A re-run after a failure halfway does not change what is already published. The candidate push refuses a tag whose images differ,
promote-registrytreats an equal digest as done, andpublish_onceandpublish-cratesskip a version that exists. - No secret goes to a called workflow.
One change is needed before it merges. The step "A second person approved this run" is in nine workflows, and its env: and run: block is the same in all nine:
release-publish.yml:236,release-image.yml:174,release-dev-image.yml:131npm-publish.yml:151,promote-image.yml:136,release-crates.yml:159sign-image.yml:71,ghcr-mirror.yml:80,dockerhub-description.yml:86
Once the publishing environments drop their required reviewers, this step is the only check by a person. A fix to it then has to land nine times, and a copy that misses the fix leaves one publishing path with the older check. A composite action can contain the env: and run: block, and each approval job keeps its own environment: and if:. If the copies stay, please say why in the description.
#458 (opened 23 October) makes the same npm change. It moves latest with npm dist-tag add over the trusted publishing credential, reads each tag back, installs @extenddb/dev from the registry and runs it, and removes the NPM_TOKEN paragraph from packaging/README.md. The verify-npm and npm-latest jobs here do the same, and the description does not name #458. The two PRs conflict in nine hunks in npm-publish.yml and in two hunks in packaging/README.md. Please name #458 in the description. The second of the two to merge drops its copy, so that the release has one path for npm latest. #458 has two checks that this PR does not have: npm audit signatures, and a probe tag that proves the dist-tag permission before latest moves.
Smaller points:
release-image.yml:170and:175, and the same two lines inrelease-dev-image.yml,npm-publish.yml,promote-image.ymlandrelease-crates.yml, tell a direct dispatch from a called run bygithub.workflow == '<the workflow's name>'. A change to thename:key then turns off the check by a person for direct dispatches, with no error. Aworkflow_callinput such ascalled(default false), whichrelease-publish.ymlandrelease-rehearsal.ymlset to true, does not depend on the name. A dispatch cannot set that input.release-publish.yml:175counts a tag as a release when it matches^v[0-9]+\.[0-9]+\.[0-9]+$, butrelease.yml:285refuses a leading zero. A strayv1.02.0on main then counts in one file and not in the other. One shared rule, in a composite action or adevtools/script, would keep the two in step.verify-image/action.yml:49is the third copy of the pinned cosign install, afterpromote-registryandsign-image. The npm pin11.21.3is innpm-publish.ymland inrelease-publish.yml. Each could live in one place, the cosign install in a composite action.- Testing done says that nothing here has run on GitHub. The
release-prcheck did run on this head, in its other-PR mode.
This adds devtools/freeze-migrations, which does the migration freeze of a release PR, and points CONTRIBUTING.md and packaging/README.md at it. Nothing runs it yet; a maintainer can run it by hand. A release that ships a catalog migration raises RELEASED_THROUGH to the last migration id and pastes the checksum lines that each backend's the_released_bodies_match_their_checksums test prints into its RELEASED table (CONTRIBUTING.md, "Adding a catalog migration", step 7). That has been done by hand in each release PR. The script runs the four tests with the bound unchanged and takes the lines for the migrations above the bound. It then raises the bound, inserts the lines before each table's closing bracket, runs cargo fmt on the four crates and runs the four tests again. It changes nothing when the bound is already the last id. With --release-version X.Y.Z it refuses to freeze a breaking migration in a patch release from 1.0 on, which docs/versioning.md forbids, and says to release X.Y+1.0 instead, with a Release-As footer at the end of the message of a commit merged to main. A 0.x release may carry a breaking migration, as the document allows. The version is checked before anything else. Every check that can refuse the freeze runs before the first write, so such a refusal leaves the tree as it was. If cargo fmt or the tests fail after the freeze, the files stay written for inspection; git checkout -- crates/ undoes them. The unit tests replace cargo with a fake and need no Rust toolchain. With migration 12 unfrozen on the real crates, the script refuses --release-version 1.0.1 without writing, and with 1.1.0 it reproduces the committed tables and bound exactly. Step 7 of CONTRIBUTING.md now shows the commands the script runs and how to repeat that check. This is part of the release automation tracked in #1395: the job that completes the release PR will run it. devtools/check-released-through's refusal now names devtools/freeze-migrations. The registry reader moves into a function of check-released-through, and freeze-migrations loads it from there, so the release gate and the freeze read the bound and the last migration with one copy of the patterns and messages. A test case has a migration that one backend alone reports as breaking, as migration 12 is breaking only on MongoDB. The keyless signing selftests name #1469 where they mention release-publish.yml, which that PR adds, and the called selftest says why it builds its own image: a digest the caller also signed would let the caller's identity verify it. Signed-off-by: Scott Robinson <robinnsc@amazon.com>
This adds release.yml, which keeps a release PR open and up to date and, when that PR merges, creates the tag and a draft release (#1395). It publishes nothing. Merging this changes nothing by itself: every job is skipped until the repository variable RELEASE_APP_CLIENT_ID is set. Merge it after the PR title check (ci/pr-title-check). Today a release starts with a hand-written PR that bumps the version on every surface, regenerates Cargo.lock and the license notices, and freezes the catalog migrations. With this, every push to main makes release-please rebuild one PR, `chore(release): X.Y.Z`, with CHANGELOG.md and the new version in Cargo.toml (the workspace version and the 13 pins), packaging/npm/package.json (the version and the five pins) and three lines of sample output in the docs. The release type is `simple`, because the `rust` type's Cargo.toml updater throws on a virtual workspace manifest. Every release is a minor release (`always-bump-minor`), because docs/versioning.md ships a change that makes ExtendDB answer as DynamoDB does in a minor release (or a patch release when it closes a security issue), and most fixes are such changes. A `Release-As: X.Y.Z` footer asks for another version. Two jobs then finish the PR. The release-please job records the SHA of the release PR's branch, and both jobs work on that commit, not on the branch name, because anyone with write access can push to the branch. prepare-release-pr compares that commit with main byte for byte and refuses it unless it is one release-please commit that changes only the version lines and the changelog. Every inline Python check runs with `python3 -I`, so it imports nothing from the checked-out tree. It also refuses a version other than the next minor version after the highest release tag on main or a higher version that a Release-As footer names. devtools/release-tags holds the rule for a release version (no leading zeros) and finds the highest release tag on main, so release-publish.yml (#1469) can use the same rule. Then it runs `cargo update --workspace` (only workspace entries may change), the license notice generators for the four notice files and devtools/freeze-migrations. It holds no credential and hands its result on as a patch. push-release-pr applies the patch and refuses anything but content changes to the ten files that .github/release-pr-files.txt lists, a list it reads from the commit before the patch applies. The generators and the freeze run build scripts, so it checks the content again with the standard library: in Cargo.lock and the four license notices only the workspace version may change, in the migration files only the RELEASED_THROUGH line and Released entries appended to each table. It then pushes its commit with the App token, minted after the checks. A PR opened with GITHUB_TOKEN would start no workflow. Merging the release PR creates the tag on the merge commit and a draft release. With force-tag-creation, release-please reports a release on a tag that already exists, so a step fails the run unless the tag's commit is the merge commit. The version must be the next minor version or one that a commit message on main since the last release names in a Release-As footer, so a footer that a BEGIN_COMMIT_OVERRIDE block gains after the merge is refused. The check reads the whole log before grep: under pipefail, `grep -q` would end the pipe early and git log would exit on SIGPIPE, refusing a footer it found on any history over 64 KiB of messages. CONTRIBUTING.md says how release-please reads a PR description, in the item that the PR title check added, and that a change allowed only in a major release carries a Release-As: X+1.0.0 footer. The support policy in docs/versioning.md and ROADMAP.md changes to match: a fix ships in the next release from main, a minor release unless a Release-As footer asks for a patch. A fix for an earlier minor release, including the 3 months of security fixes for the previous minor release, needs a release branch, which #1550 tracks; until then it ships in the next release from main. packaging/README.md also says when a patch release from main is allowed, and describes the version rules, the upgrade manual step and the one- time setup: squash-only merges with "Pull request title and description" and the required checks as #1395 merges; then, once all of #1395 is merged, the App, its environment, a new tag ruleset whose only rule restricts the creation of v* tags to the App (protect-release-tags keeps no bypass actors), and last the variable. Until then releases are made by hand, as today. The by-hand steps now include .release-please- manifest.json, Cargo.lock and the sample output. .release-please-manifest.json starts at 1.1.0, the release cut by hand on 222d80a, so the first release PR proposes 1.2.0. Signed-off-by: Scott Robinson <robinnsc@amazon.com>
518a86d to
ae11e38
Compare
e657320 to
b22d87a
Compare
|
ae11e38 to
d1b0654
Compare
b22d87a to
650a8f3
Compare
|
Changes since my reply, in 650a8f3 (restacked on #1468's d1b0654):
|
LeeroyHannigan
left a comment
There was a problem hiding this comment.
Approve. The check by a person is now one composite action, .github/actions/second-person-approval, and all nine approval jobs run it. Each job checks the action out at the run's own commit. A run therefore uses the action from the same commit as its workflow file, as the inline step did. Each job keeps its own environment: and if:.
You fixed the other points too. The five called workflows test a called input in place of their names, devtools/release-tags holds the tag rule for both files, and install-cosign holds the one cosign pin. The description names #458, and Testing done cites the selftest run with install-cosign. The guard before npm-latest writes refused to move latest back to an older release, also on a rerun of an older release's job. It moved latest for a newer release, for 1.10.0 over 1.9.0 and after a partial earlier write.
650a8f3 restacks this PR on #1468's d1b0654. Since b22d87a, its own change adds python3 -I to the two scripts of the notes job, edits one comment, and changes the setup text in packaging/README.md.
On #458: as your plan says, the second of the two to merge drops its copy.
CI passed at this head, 71 of 71.
After the release PR of #1395 merges, a maintainer still dispatches five build workflows, copies three digests into three promote-image dispatches, moves npm `latest` on six packages by hand, dispatches release-crates and writes the release notes' tables. The new release-publish.yml runs those steps, and release.yml starts it when a release PR merges. Merging this publishes nothing until the release automation is configured and a release PR merges. The approval of the release PR is the decision to release. When release-please has created the tag and the draft release, release.yml's new publish job dispatches release-publish.yml from main with the tag, with GITHUB_TOKEN: a dispatch is the event that a GITHUB_TOKEN call still turns into a run. The run is a dispatch on main, as a maintainer's retry is, so the signing identity (the called file @refs/heads/main, trigger workflow_dispatch), the environments' branch rule and the trusted publisher entries stay as they are. A workflow_run start would not work: crates.io refuses trusted publishing from workflow_run runs. The release PR's header says that merging it publishes. release-publish.yml runs one release per tag at a time. Its target job checks the tag, and with require_rehearsal, the default, it checks that the tagged commit has the tree of the release PR's head and that the head's rehearsal passed. A release PR merged outside the queue after main moved is then not published. A release made by hand is dispatched with require_rehearsal false. The run calls release-image for each backend, release-dev-image and npm- publish with the tag. One verify job per artifact then checks it anonymously. The new composite action verify-image checks an image's labels, its keyless signature (signing workflow, main, ExtendDB/extenddb, workflow_dispatch) and `extenddb version`. verify-npm installs @extenddb/dev, checks that each platform package has the version, runs `npm audit signatures` and requires a verified signature and provenance attestation on the launcher and its linux-x64 package (from #458, whose native legs check the other four), and starts it in memory and file mode. Each promote-image call needs only its own image and verify job. `latest` moves only when the tag is the highest vX.Y.Z tag whose commit is on main. npm-latest moves the six packages' `latest`, platform packages first and the launcher last. It reads each package's `latest` first and fails, moving none, when one is above the version, as #458's promote job does and promote-image does for the images: "Re-run failed jobs" reuses target's decision, so a rerun of an older release after a newer one would otherwise move `latest` back. release-crates runs after the PostgreSQL promotion. notes writes the behavior changes, the digests read back from Docker Hub and the verify command into the draft release, between two markers. A maintainer then publishes the draft release. The publishing environments drop their required reviewers, so the run that release.yml dispatches needs no step by a person. A run that a person starts needs two people and one approval. Each publishing workflow that a person can dispatch (release-publish, release-image, release-dev-image, npm-publish, promote-image, release-crates, sign- image, ghcr-mirror, and a dispatch of dockerhub-description) now has an approval job that its other jobs wait for (in release-publish, after target). For a run that a person dispatched it runs in a new environment, release-approval, with required reviewers and prevent_self_review, and its step, one composite action (.github/actions/second-person-approval) for all nine, reads the run's approvals: it fails unless the approver is neither the actor nor the triggering actor, when the actor is a bot, and on a rerun. When release- publish calls the others (it sets their workflow_call input called, which a dispatch cannot set), and for dry runs, it runs in release-auto, which has no protection rules, and checks nothing; it always runs, because a skipped job would skip every job after it. So a release by hand also takes one approval. release-publish needs no approval only for a run whose actor and triggering actor are github-actions[bot] and that keeps require_rehearsal; target then admits only a merged, rehearsed release PR's tag. packaging/README.md, "Approvals", says this, with two limits (GITHUB_TOKEN can push to GHCR from any branch; a waiting manual run holds its concurrency group), and "Releasing by hand" lists the manual paths. Before the first run of release-publish.yml, automatic or a whole release by hand, each of the six npm packages and each crate needs a second trusted publisher entry for release-publish.yml, because npm and crates.io match the file of the workflow that started the run. On npm the entry must allow `npm publish` and `npm dist-tag`, and it expires if nothing publishes through it within two days, so it is added within two days before that run. A run without these entries promotes the images and then fails at npm and crates.io. release-approval must exist, with its reviewers, before this merges: a job that names a missing environment creates it with no protection, and every manual run would then fail at its approval step. The reviewers come off the publishing environments only after this merges. packaging/README.md lists the whole setup in order, and says how to stop a release (disable release- publish.yml). The AWS roles do not change: they trust the environments through the OIDC sub claim, which a called job keeps. The image builds keep their artifacts for 1 day. A failed job is rerun in the same run. npm-publish now skips a package version that npm already has with the same tarball (npm pack's integrity against the registry's) and fails on other contents, so a rerun can finish a partial npm publish. A verify job that finds a defect stops only its own artifact. The version is then released in part, and the next release fixes the defect. Other changes: release-image and release-dev-image return their digests as outputs. promote-image and release-crates get workflow_call triggers, and the first step of their first job refuses to run outside ExtendDB/extenddb. packaging/README.md's npm flow no longer names an npm token: npm-publish uses trusted publishing. npm-publish's publish job, like npm-latest, installs npm 11.21.3 exactly; each step names the other copy. Both jobs check out the tagged commit, which can predate a shared action, so the pin stays inline rather than adding a checkout of the action to the two jobs that hold the npm credential. In both jobs setup-node sets package-manager-cache: false, as npm's trusted publishing example does, and the publish job's tagged checkout no longer persists the token. - .github/actions/install-cosign holds the cosign version and checksum. sign-image, promote-registry, verify-image and the re-entry step of release-dev-image use it; the three actions lose their cosign-version and cosign-sha256 inputs, which no caller set. - release-publish's target job checks the tag and finds the highest release tag on main with devtools/release-tags, as release.yml does (no leading zeros). Signed-off-by: Scott Robinson <robinnsc@amazon.com>
This adds release.yml, which keeps a release PR open and up to date and, when that PR merges, creates the tag and a draft release (#1395). It publishes nothing. Merging this changes nothing by itself: every job is skipped until the repository variable RELEASE_APP_CLIENT_ID is set. Merge it after the PR title check (ci/pr-title-check). Today a release starts with a hand-written PR that bumps the version on every surface, regenerates Cargo.lock and the license notices, and freezes the catalog migrations. With this, every push to main makes release-please rebuild one PR, `chore(release): X.Y.Z`, with CHANGELOG.md and the new version in Cargo.toml (the workspace version and the 13 pins), packaging/npm/package.json (the version and the five pins) and three lines of sample output in the docs. The release type is `simple`, because the `rust` type's Cargo.toml updater throws on a virtual workspace manifest. Every release is a minor release (`always-bump-minor`), because docs/versioning.md ships a change that makes ExtendDB answer as DynamoDB does in a minor release (or a patch release when it closes a security issue), and most fixes are such changes. A `Release-As: X.Y.Z` footer asks for another version. Two jobs then finish the PR. The release-please job records the SHA of the release PR's branch, and both jobs work on that commit, not on the branch name, because anyone with write access can push to the branch. prepare-release-pr compares that commit with main byte for byte and refuses it unless it is one release-please commit that changes only the version lines and the changelog: the manifest and the files that release-please-config.json on main lists, so adding a versioned file needs only its config entry. Every inline Python check runs with `python3 -I`, so it imports nothing from the checked-out tree. It also refuses a version other than the next minor version after the highest release tag on main or a higher version that a Release-As footer names. devtools/release-tags holds the rule for a release version (no leading zeros) and finds the highest release tag on main, so release-publish.yml (#1469) can use the same rule. Then it runs `cargo update --workspace` (only workspace entries may change), the license notice generators for the four notice files and devtools/freeze-migrations. It holds no credential and hands its result on as a patch. push-release-pr applies the patch and refuses anything but content changes to the ten files that .github/release-pr-files.txt lists, a list it reads from the commit before the patch applies. The generators and the freeze run build scripts, so it checks the content again with the standard library: in Cargo.lock and the four license notices only the workspace version may change, in the migration files only the RELEASED_THROUGH line and Released entries appended to each table. It then pushes its commit with the App token, minted after the checks. A PR opened with GITHUB_TOKEN would start no workflow. Merging the release PR creates the tag on the merge commit and a draft release. With force-tag-creation, release-please reports a release on a tag that already exists, so a step fails the run unless the tag's commit is the merge commit. The version must be the next minor version or one that a commit message on main since the last release names in a Release-As footer, so a footer that a BEGIN_COMMIT_OVERRIDE block gains after the merge is refused. The check reads the whole log before grep: under pipefail, `grep -q` would end the pipe early and git log would exit on SIGPIPE, refusing a footer it found on any history over 64 KiB of messages. CONTRIBUTING.md says how release-please reads a PR description, in the item that the PR title check added, and that a change allowed only in a major release carries a Release-As: X+1.0.0 footer. The support policy in docs/versioning.md and ROADMAP.md changes to match: a fix ships in the next release from main, a minor release unless a Release-As footer asks for a patch. A fix for an earlier minor release, including the 3 months of security fixes for the previous minor release, needs a release branch, which #1550 tracks; until then it ships in the next release from main. packaging/README.md also says when a patch release from main is allowed, and describes the version rules, the upgrade manual step and the one- time setup: squash-only merges with "Pull request title and description" and the required checks as #1395 merges; then, once all of #1395 is merged, the App, its environment, a new tag ruleset whose only rule restricts the creation of v* tags to the App (protect-release-tags keeps no bypass actors), and last the variable. Until then releases are made by hand, as today. The by-hand steps now include .release-please- manifest.json, Cargo.lock and the sample output. .release-please-manifest.json starts at 1.1.0, the release cut by hand on 222d80a, so the first release PR proposes 1.2.0. Signed-off-by: Scott Robinson <robinnsc@amazon.com>
d1b0654 to
6d3f8a7
Compare
650a8f3 to
e3f1ae2
Compare
This adds devtools/freeze-migrations, which does the migration freeze of a release PR, and points CONTRIBUTING.md and packaging/README.md at it. Nothing runs it yet; a maintainer can run it by hand. A release that ships a catalog migration raises RELEASED_THROUGH to the last migration id and pastes the checksum lines that each backend's the_released_bodies_match_their_checksums test prints into its RELEASED table (CONTRIBUTING.md, "Adding a catalog migration", step 7). That has been done by hand in each release PR. The script runs the four tests with the bound unchanged and takes the lines for the migrations above the bound. It then raises the bound, inserts the lines before each table's closing bracket, runs cargo fmt on the four crates and runs the four tests again. It changes nothing when the bound is already the last id. With --release-version X.Y.Z it refuses to freeze a breaking migration in a patch release from 1.0 on, which docs/versioning.md forbids, and says to release X.Y+1.0 instead, with a Release-As footer at the end of the message of a commit merged to main. A 0.x release may carry a breaking migration, as the document allows. The version is checked before anything else. Every check that can refuse the freeze runs before the first write, so such a refusal leaves the tree as it was. If cargo fmt or the tests fail after the freeze, the files stay written for inspection; git checkout -- crates/ undoes them. The unit tests replace cargo with a fake and need no Rust toolchain. With migration 12 unfrozen on the real crates, the script refuses --release-version 1.0.1 without writing, and with 1.1.0 it reproduces the committed tables and bound exactly. Step 7 of CONTRIBUTING.md now shows the commands the script runs and how to repeat that check. This is part of the release automation tracked in ExtendDB#1395: the job that completes the release PR will run it. devtools/check-released-through's refusal now names devtools/freeze-migrations. The registry reader moves into a function of check-released-through, and freeze-migrations loads it from there, so the release gate and the freeze read the bound and the last migration with one copy of the patterns and messages. A test case has a migration that one backend alone reports as breaking, as migration 12 is breaking only on MongoDB. The keyless signing selftests name ExtendDB#1469 where they mention release-publish.yml, which that PR adds, and the called selftest says why it builds its own image: a digest the caller also signed would let the caller's identity verify it. Signed-off-by: Scott Robinson <robinnsc@amazon.com>
Release automation (#1395), PR 6 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
release-publish.yml, which publishes a release, and starts it when a release PR merges:release.yml's newpublishjob dispatches it frommainwith the tag. Merging this publishes nothing until the release automation is configured and a release PR merges.The run:
targetchecks the tag. Withrequire_rehearsal(the default) the tagged commit must have the tree of the release PR's head, and that head's rehearsal must have passed, so a release PR merged outside the queue aftermainmoved does not publish;release-imagefor each backend image,release-dev-imageandnpm-publishwith the tag;verify-imageaction checks an image's labels, its keyless signature (signing workflow,main,ExtendDB/extenddb,workflow_dispatch) andextenddb version;verify-npminstalls@extenddb/dev, checks that each platform package has the version, runsnpm audit signaturesand requires a verified signature and provenance attestation on the launcher and the linux-x64 package it installs (from ci(npm): promote latest from the workflow over trusted publishing #458, which checks the other four on their native runners), and starts it in memory and file mode;promote-imagefor each backend image with the digest its release run returned, once that image is verified (latestmoves only when the tag is the highestvX.Y.Ztag whose commit is onmain);lateston the six npm packages (npm-latest), platform packages first and the launcher last. It reads each package'slatestfirst and fails, moving none, when one is above the version, aspromote-imageand ci(npm): promote latest from the workflow over trusted publishing #458's promote job do: "Re-run failed jobs" reusestarget's decision, so a rerun of an older release after a newer one would otherwise movelatestback;release-cratesafter the PostgreSQL promotion;notes). A maintainer reads the draft and publishes it.Other changes:
release-imageandrelease-dev-imagereturn their digests as outputs.promote-imageandrelease-cratesgetworkflow_calltriggers; the first step of theirpromoteandgatejobs refuses to run outsideExtendDB/extenddb.npm-publishskips a package version that npm already has with the same tarball and fails on other contents, so a rerun can finish a partial npm publish. Its publish job andnpm-latestinstall npm 11.21.3 exactly, and each step names the other copy. The pin stays inline: both jobs check out the tagged commit, which can predate a shared action, and loading one would add a checkout to the two jobs that hold the npm credential. In both jobs setup-node setspackage-manager-cache: false, as npm's trusted publishing example does, and the publish job's tagged checkout setspersist-credentials: false..github/actions/install-cosignholds the cosign version and checksum.sign-image,promote-registry,verify-imageand the re-entry step ofrelease-dev-imageuse it, and the three actions lose theircosign-versionandcosign-sha256inputs, which no caller set.targetchecks the tag and finds the highest release tag onmainwithdevtools/release-tags, asrelease.ymldoes.release-publish,release-image,release-dev-image,npm-publish,promote-image,release-crates,sign-image,ghcr-mirror, and a dispatch ofdockerhub-description) gets anapprovaljob that its other jobs wait for ("Approvals" below). Its check is one composite action,.github/actions/second-person-approval.npm-publishuses trusted publishing.Why
Part of #1395. After the release PR merges, a maintainer still dispatches five build workflows, copies three digests into three
promote-imagedispatches, moves npmlatestby hand, dispatchesrelease-cratesand writes the release notes' tables.The approval of the release PR is the decision to release. The publish run is a dispatch on
main, withGITHUB_TOKEN(a dispatch is an event that aGITHUB_TOKENcall still turns into a run), so the signing identity, the environments' branch rule and the trusted publisher entries stay as they are. Aworkflow_runstart would not work: crates.io refuses trusted publishing fromworkflow_runruns.Approvals
dockerhub,ghcr,npm,crates-io) drop their required reviewers.approvaljob runs in a newrelease-approvalenvironment (required reviewers,prevent_self_review), and its step checks the run's approvals: it fails unless the approver is neither the run's actor nor its triggering actor, when the actor is a bot, and on "Re-run all jobs". Whenrelease-publishcalls the other workflows (it sets theirworkflow_callinputcalled, which a dispatch cannot set), and for dry runs, the job runs inrelease-auto(no protection rules) and checks nothing, so a release by hand takes one approval. The job always runs rather than being skipped, because a skipped job skips every job after it.release-publishneeds no approval only when its actor and triggering actor aregithub-actions[bot]andrequire_rehearsalis on;targetthen publishes only a merged, rehearsed release PR's tag.GITHUB_TOKENcan push to GHCR from any branch without the gate; a manual run waiting for approval holds its concurrency group; anyone with write access can start an approved release again untilrelease-publish.ymlis disabled.Testing done
verify-image's checks pass on the four 1.0.0 images with the pinned cosign v3.1.3, and fail for a wrong commit, a wrong signer, another repository, thepushtrigger and an injected signer name.verify-npm's step, extracted, innode:22against the registry: passes for 1.1.0 and for 1.0.0 (eachcandidateon 1.1.0).npm audit signaturesreports a verified signature and attestation on both installed packages, with npm 10 and 11.21.3; with a package that has no attestation, the count check fails whilenpm audit signaturesexits 0.npm-latest's step with a stub npm: a newer release, a same-version rerun, 1.10.0 over 1.9.0 and a package withoutlatestmove all six. An older release, or one package'slatestabove the version, fails and moves none. A failingdist-tag lsfails before any write.npm publishstubbed.target'smove_lateston the real tags and with a stray higher tag; its release PR lookup on the real v1.1.0 merge commit (chore(release): bump version to 1.1.0 #1514, which it correctly refuses as not release-please's branch);noteson the real upgrade manual; the job graph with a failure in turn in each stage.GITHUB_TOKENdispatch creates a run, that a called workflow sees the caller'sgithubcontext, that a rejected deployment fails the job, and crates.io's refusal ofworkflow_runtokens, checked in GitHub's docs and crates.io's source.target's tag step, extracted, against a scratch origin: the highest tag onmainmoveslatest; an older one does not and warns; a tag offmain, a tag with a leading zero, a malformed tag and a missing tag are refused; av1.05.0onmaindoes not count as the highest.install-cosignpasses shellcheck, and the keyless signing selftest passed with it on b22d87a, an earlier head of this PR, in both the direct and the called job (run 47081577580).devtools/check-actions-pinnedare clean. Therelease-prcheck ran in its other-PR mode on e657320 and on b22d87a, earlier heads of this PR (runs 46828568118 and 47081577453). The publishing path itself has not run on GitHub; the first merged release PR is its first real run.Overlap with #458
#458 makes the same npm change: it moves
latestwithnpm dist-tagover trusted publishing. This PR takes two of its checks:npm audit signatureswith its count check, here on the launcher and its linux-x64 package from one Linux install, and the read oflatestbefore the write. It does not take the probe tag. npm skips only the PUT when the tag already holds the version, which is the run #458's probe covers; here that run has nothing to write. A run that writes moves the launcher last, and the launcher pins its platform packages by exact version, so a missing dist-tag permission fails before@extenddb/dev'slatestmoves. The two PRs conflict innpm-publish.ymlandpackaging/README.md. The second to merge drops its copy, so the release has one path for npmlatest. If #458 merges first, this PR moveslatestthrough its promote mode, which then needs aworkflow_calltrigger withactionandcalled, the fix for the skipped promote job, and a provenance check that acceptsrelease-publish.yml.Setup (admin), in order
release-approval(branchmain, the maintainers who may approve as required reviewers, prevent self-review on, admin bypass off). A job that names a missing environment creates it unprotected, and every manual run would then fail at its approval step.dockerhub,ghcr,npmandcrates-io, keepingbranch: main. Removing them earlier would leave today's manual dispatches with one person.RELEASE_APP_CLIENT_ID.release-publish.yml, whether the first approved release PR or a whole release by hand (a run without these entries promotes the images and then fails at npm and crates.io): a second trusted publisher entry forrelease-publish.ymlon each of the six npm packages (allowingnpm publishandnpm dist-tag) and each of the 14 crates, with the same environment as the first.The AWS roles do not change: they trust the environments through the OIDC
subclaim, which a called job keeps. To stop a release, cancel its run and disablerelease-publish.yml; packaging/README.md, "Recovery".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
For maintainers who dispatch: once this merges, a manual dispatch of any of the nine publishing workflows waits for a
release-approvalapproval by a second person, on top of the environments' reviewers until setup step 2 removes them. Without therelease-approvalenvironment (setup step 1), every manual run fails at its approval step. The manual dispatch procedure otherwise keeps working for recovery. Nothing changes for users.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.