Skip to content

ci(release): publish a release when the release PR merges - #1469

Open
robinnsc wants to merge 1 commit into
ci/release-callable-workflowsfrom
ci/release-publish
Open

robinnsc wants to merge 1 commit into
ci/release-callable-workflowsfrom
ci/release-publish

Conversation

@robinnsc

@robinnsc robinnsc commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

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 new publish job dispatches it from main with the tag. Merging this publishes nothing until the release automation is configured and a release PR merges.

The run:

  1. target checks the tag. With require_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 after main moved does not publish;
  2. calls release-image for each backend image, release-dev-image and npm-publish with the tag;
  3. verifies each artifact anonymously in its own job: the new verify-image action 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 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;
  4. calls promote-image for each backend image with the digest its release run returned, once that image is verified (latest moves only when the tag is the highest vX.Y.Z tag whose commit is on main);
  5. moves latest on the six npm packages (npm-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 promote-image and ci(npm): promote latest from the workflow over trusted publishing #458's promote job do: "Re-run failed jobs" reuses target's decision, so a rerun of an older release after a newer one would otherwise move latest back;
  6. calls release-crates after the PostgreSQL promotion;
  7. writes the behavior changes, the digests read back from Docker Hub and the verify command into the draft release (notes). A maintainer reads the draft and publishes it.

Other changes:

  • The release PR's header says that merging it publishes.
  • release-image and release-dev-image return their digests as outputs.
  • promote-image and release-crates get workflow_call triggers; the first step of their promote and gate jobs refuses to run outside ExtendDB/extenddb.
  • npm-publish skips 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 and npm-latest install 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 sets package-manager-cache: false, as npm's trusted publishing example does, and the publish job's tagged checkout sets persist-credentials: false.
  • .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, and the three actions lose their cosign-version and cosign-sha256 inputs, which no caller set.
  • target checks the tag and finds the highest release tag on main with devtools/release-tags, as release.yml does.
  • 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) gets an approval job that its other jobs wait for ("Approvals" below). Its check is one composite action, .github/actions/second-person-approval.
  • packaging/README.md: "Publishing with release-publish.yml" (the steps, approvals, recovery, setup) and "Releasing by hand" (the manual paths that stay). The npm flow no longer names an npm token, since npm-publish uses trusted publishing.

Why

Part of #1395. After the release PR merges, a maintainer still dispatches five build workflows, copies three digests into three promote-image dispatches, moves npm latest by hand, dispatches release-crates and writes the release notes' tables.

The approval of the release PR is the decision to release. The publish run is a dispatch on main, with GITHUB_TOKEN (a dispatch is an event that a GITHUB_TOKEN call still turns into a run), so the signing identity, 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.

Approvals

  • Automatic release: after the release PR is approved and merged, nothing waits for a person. The publishing environments (dockerhub, ghcr, npm, crates-io) drop their required reviewers.
  • A run a person starts: two people, one approval. The approval job runs in a new release-approval environment (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". When release-publish calls the other workflows (it sets their workflow_call input called, which a dispatch cannot set), and for dry runs, the job runs in release-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-publish needs no approval only when its actor and triggering actor are github-actions[bot] and require_rehearsal is on; target then publishes only a merged, rehearsed release PR's tag.
  • Limits, in the README: GITHUB_TOKEN can 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 until release-publish.yml is 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, the push trigger and an injected signer name.
  • verify-npm's step, extracted, in node:22 against the registry: passes for 1.1.0 and for 1.0.0 (each candidate on 1.1.0). npm audit signatures reports 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 while npm audit signatures exits 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 without latest move all six. An older release, or one package's latest above the version, fails and moves none. A failing dist-tag ls fails before any write.
  • npm-publish's skip logic with a fake npm (absent, same integrity, other integrity, transient read failures, a failure on the fourth package then a rerun), and against registry.npmjs.org with npm publish stubbed.
  • target's move_latest on 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); notes on the real upgrade manual; the job graph with a failure in turn in each stage.
  • The documented rule that a GITHUB_TOKEN dispatch creates a run, that a called workflow sees the caller's github context, that a rejected deployment fails the job, and crates.io's refusal of workflow_run tokens, checked in GitHub's docs and crates.io's source.
  • The approvals query on a real approved run (32124353804) returns its approver.
  • target's tag step, extracted, against a scratch origin: the highest tag on main moves latest; an older one does not and warns; a tag off main, a tag with a leading zero, a malformed tag and a missing tag are refused; a v1.05.0 on main does not count as the highest.
  • install-cosign passes 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).
  • actionlint and devtools/check-actions-pinned are clean. The release-pr check 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 latest with npm dist-tag over trusted publishing. This PR takes two of its checks: npm audit signatures with its count check, here on the launcher and its linux-x64 package from one Linux install, and the read of latest before 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's latest moves. The two PRs conflict in npm-publish.yml and packaging/README.md. The second to merge drops its copy, so the release has one path for npm latest. If #458 merges first, this PR moves latest through its promote mode, which then needs a workflow_call trigger with action and called, the fix for the skipped promote job, and a provenance check that accepts release-publish.yml.

Setup (admin), in order

  1. Before this merges: create release-approval (branch main, 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.
  2. After this merges: remove the required reviewers from dockerhub, ghcr, npm and crates-io, keeping branch: main. Removing them earlier would leave today's manual dispatches with one person.
  3. Switch the release PR on (ci(release): keep a release PR open with release-please #1467's setup): the App and its environment, the two rulesets, then RELEASE_APP_CLIENT_ID.
  4. Within two days before the first run of 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 for release-publish.yml on each of the six npm packages (allowing npm publish and npm 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 sub claim, which a called job keeps. To stop a release, cancel its run and disable release-publish.yml; packaging/README.md, "Recovery".

Checklist

  • I have read CONTRIBUTING.md
  • All tests pass (cargo test --workspace): not run, no Rust change
  • Code is formatted (cargo fmt --check): no Rust change
  • Clippy is clean (cargo clippy -- -W clippy::pedantic): no Rust change
  • I have added or updated tests for new functionality
  • I have updated documentation if behavior changed
  • Breaking changes are noted below (if any)
  • If this changes the wire protocol, Storage trait, auth model, on-disk
    format, 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-approval approval by a second person, on top of the environments' reviewers until setup step 2 removes them. Without the release-approval environment (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.

@robinnsc robinnsc self-assigned this Nov 25, 2026
@robinnsc
robinnsc force-pushed the ci/release-callable-workflows branch from d093ec4 to 01fdd5f Compare November 29, 2026 01:33
@robinnsc robinnsc changed the title ci(release): publish a release from one dispatch ci(release): publish a release when the release PR merges Nov 29, 2026
@robinnsc
robinnsc force-pushed the ci/release-callable-workflows branch from 01fdd5f to dfc3777 Compare November 30, 2026 21:56
@robinnsc
robinnsc marked this pull request as ready for review November 30, 2026 21:56
@robinnsc
robinnsc force-pushed the ci/release-callable-workflows branch from dfc3777 to 4749ab9 Compare December 1, 2026 18:55
@robinnsc
robinnsc force-pushed the ci/release-callable-workflows branch from 4749ab9 to 518a86d Compare December 2, 2026 06:56

@LeeroyHannigan LeeroyHannigan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:198 starts release-publish.yml with gh workflow run ... --ref main and does not call it. So the --certificate-github-workflow-trigger workflow_dispatch checks 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-registry treats an equal digest as done, and publish_once and publish-crates skip 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:131
  • npm-publish.yml:151, promote-image.yml:136, release-crates.yml:159
  • sign-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:170 and :175, and the same two lines in release-dev-image.yml, npm-publish.yml, promote-image.yml and release-crates.yml, tell a direct dispatch from a called run by github.workflow == '<the workflow's name>'. A change to the name: key then turns off the check by a person for direct dispatches, with no error. A workflow_call input such as called (default false), which release-publish.yml and release-rehearsal.yml set to true, does not depend on the name. A dispatch cannot set that input.
  • release-publish.yml:175 counts a tag as a release when it matches ^v[0-9]+\.[0-9]+\.[0-9]+$, but release.yml:285 refuses a leading zero. A stray v1.02.0 on main then counts in one file and not in the other. One shared rule, in a composite action or a devtools/ script, would keep the two in step.
  • verify-image/action.yml:49 is the third copy of the pinned cosign install, after promote-registry and sign-image. The npm pin 11.21.3 is in npm-publish.yml and in release-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-pr check did run on this head, in its other-PR mode.

robinnsc added a commit that referenced this pull request Dec 3, 2026
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>
robinnsc added a commit that referenced this pull request Dec 3, 2026
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>
@robinnsc
robinnsc force-pushed the ci/release-callable-workflows branch from 518a86d to ae11e38 Compare December 3, 2026 09:59
@robinnsc

robinnsc commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author
  1. The check is now one composite action, .github/actions/second-person-approval. Each approval job keeps its own environment: and if:, checks out that action (sparse) and runs it. Its job asks for contents: read and actions: read, which every caller grants.
  2. The description now names ci(npm): promote latest from the workflow over trusted publishing #458 and credits the two checks taken from it. verify-npm runs npm audit signatures with ci(npm): promote latest from the workflow over trusted publishing #458's count check on the launcher and the linux-x64 package it installs, so both must carry a verified registry signature and provenance attestation before latest moves; ci(npm): promote latest from the workflow over trusted publishing #458's native legs check the other four, which this PR does not. Just before npm-latest writes, it reads each package's latest and fails, moving none, when one is above the version, as ci(npm): promote latest from the workflow over trusted publishing #458's promote job and promote-image do. Here it also covers reruns: "Re-run failed jobs" reuses target's decision, so a rerun of an older release's npm-latest after a newer release would otherwise move latest back. The probe tag is not ported. npm skips only the PUT when the tag already holds the version, which is the run your probe covers; here that run has nothing to write. A run that writes moves the five platform packages first and @extenddb/dev last, and the launcher pins its platform packages by exact version, so a missing "Allow npm dist-tag" fails the job before @extenddb/dev's latest moves, and when all six writes succeed the read-back checks each one. As you suggest, the second to merge drops its copy. If this stack merges first, ci(npm): promote latest from the workflow over trusted publishing #458 drops its promote path, and its native verify legs could extend verify-npm to the other four platforms. If ci(npm): promote latest from the workflow over trusted publishing #458 merges first, this PR moves latest through its promote mode, which then needs a workflow_call trigger with action and called, demohan's fix for the skipped promote job, and a provenance check that accepts release-publish.yml: npm takes the provenance path from GITHUB_WORKFLOW_REF, which in a called run names the caller.
  3. The five called workflows now take a workflow_call input called (default false), which release-publish.yml sets, and release-rehearsal.yml sets for the three it calls; the approval jobs test !inputs.called instead of the workflow's name. A dispatch cannot set it.
  4. The rule is now one script, devtools/release-tags (ci(release): keep a release PR open with release-please #1467), with unit tests. check-version and check-tag accept MAJOR.MINOR.PATCH with no leading zeros, and highest prints the highest such tag whose commit is on a ref. release.yml's version step and release-publish.yml's target both use it, so a stray v1.02.0 counts in neither.
  5. The cosign install now lives in one place, .github/actions/install-cosign, which holds the version and checksum. sign-image, promote-registry, verify-image and the re-entry step of release-dev-image use it, and the three actions lose their cosign-version and cosign-sha256 inputs, which no caller set. The npm pin stays inline in both jobs, and each step now names the other copy, as ci(npm): promote latest from the workflow over trusted publishing #458 does with "bump both together". Both npm jobs check out the tagged commit, which can predate a shared action, so loading one with ./ would add a checkout of main to the two jobs that hold the npm credential. GitHub's $/ self-repository syntax would load it with no checkout, but check-actions-pinned and actionlint 1.7.12 reject $/ today; moving the repository's local actions to $/ fits a separate PR.
  6. Testing done now says that the release-pr check ran on e657320, the previous head, in its other-PR mode.

@robinnsc
robinnsc force-pushed the ci/release-callable-workflows branch from ae11e38 to d1b0654 Compare December 3, 2026 11:18
@robinnsc

robinnsc commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

Changes since my reply, in 650a8f3 (restacked on #1468's d1b0654):

  1. packaging/README.md, Automate the release process (tracking) #1395 and the description: the release-publish.yml trusted publishers (setup step 4 here, step 5 in the README) are due within two days before the first run of release-publish.yml, automatic or a whole release by hand. "Releasing by hand" now says that such a run needs them: without them npm and crates.io refuse to publish after the images are promoted.
  2. Testing done cites the selftest run with install-cosign (47081577580) and the release-pr run on b22d87a (47081577453).
  3. Breaking changes says that a manual dispatch now waits for a release-approval approval.
  4. notes runs its two inline Python scripts with -I, and two comments no longer say a dispatch is the only event a GITHUB_TOKEN call turns into a run.

@LeeroyHannigan LeeroyHannigan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
robinnsc added a commit that referenced this pull request Dec 3, 2026
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>
@robinnsc
robinnsc force-pushed the ci/release-callable-workflows branch from d1b0654 to 6d3f8a7 Compare December 3, 2026 22:12
parsnips pushed a commit to parsnips/extenddb that referenced this pull request Dec 4, 2026
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>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants