Skip to content

refactor(release): run the release flow with release-plz, not a hand-written bot - #183

Merged
aRustyDev merged 1 commit into
mainfrom
refactor/release-plz
Nov 15, 2026
Merged

aRustyDev merged 1 commit into
mainfrom
refactor/release-plz

Conversation

@aRustyDev

Copy link
Copy Markdown
Owner

What

This replaces #178's hand-written release bot with release-plz, following your rule: use a public solution wherever one does the job. The bot pinned here is release-plz 0.4.3, run through release-plz/action v0.5.148 (pinned by SHA).

On every push to main, release-plz does the following:

  • Opens or force-updates a release-candidate PR from rc/<timestamp>, titled chore(release): vX.Y.Z. The PR sets the version in Cargo.toml and Cargo.lock and adds a section to the root CHANGELOG.md. The commit is made through the API, so GitHub signs it.
  • When an rc/* PR merges, it tags vX.Y.Z and publishes the GitHub release. Every other push does nothing.
Removed (hand-written in #178) Added
cliff.toml, release-pr.yml, release-pr.sh, test-release-pr.sh release-plz.toml, release-plz.yml
check-release-plz.py and its test: the one hand-written piece, explained below

The workspace version is now 0.1.0, so the first release is v0.1.0. release-plz releases an untagged package at the version it already holds.

Each setting, checked on a copy of main with release-plz 0.4.3

Case Result
First run (no tag yet) A v0.1.0 changelog section, no version change
Right after a v0.1.0 tag Nothing proposed
A fix in thrust-api v0.1.1: one Cargo.toml line changes, cargo metadata --locked passes, the changelog lists only that fix
A feature, or a breaking chore!: v0.2.0
Only test: or docs: commits that touch crates Nothing (release_commits)
A fix only under web/ Nothing (see the manual path below)

Two settings that the docs don't settle were checked in the source or by trial:

  • release_always = false. In v0.4.3's source, this matches the configured pr_branch_prefix (rc/). The docs still say release-plz-.
  • git_tag_name = "v{{ version }}" is set for the whole workspace. When it was set only on thrust-core, the other 17 crates looked for tags of their own, found none, and re-released all of history.

Deviations you chose

  • Branch name. Branches are rc/<timestamp>, not rc/vX.Y.Z, because release-plz only takes a prefix. The version appears in the PR title.
  • Changes outside the crates. A change under web/, scripts/ or e2e/ alone never opens an rc PR. You can release one by hand (steps in cicd.md): an rc/manual-* branch, edit the one [workspace.package] version line, run cargo update --workspace, add a changelog section, and merge. I checked that cargo update --workspace moves all 18 crates and keeps --locked passing. release-plz set-version is the wrong tool for this: it wrote the version into thrust-core's own Cargo.toml, breaking the shared version.

The one hand-written piece

release-plz has no workspace-level version_group and doesn't check that every crate is listed. A new crate missing from release-plz.toml would silently leave the shared version.

check-release-plz.py closes that gap. It reads both files with Python's built-in tomllib and runs in deps. Its test has 71 checks and runs every break against each crate. All 9 hand-made breaks of the script were caught. release-plz.toml alone now runs the Rust set, so the guard runs whenever the config changes.

Checks run locally

  • Every ci-scripts test under dash.
  • The deps guards that don't build, including the new one.
  • lint-workflow.sh with SECRET_JOBS="release release-pr". Its control fails without that variable, as it should.
  • actionlint.
  • thrust-compat-plane's 894 tests at version 0.1.0. instance.current_version comes from CARGO_PKG_VERSION, and the parity fixtures normalise it.

Not verified until the App exists

The release and release-pr jobs themselves haven't run; they're skipped until RELEASE_APP_CLIENT_ID is set.

Supply-chain note: release-plz publishes no attestation for its binaries (gh attestation verify finds none). The action installs it with cargo-binstall.

The owner steps are the same as for #178. If a tag ruleset restricts tag creation, the App also needs Administration: read and write, which release-plz documents for protected tags.

Refs: #49

🤖 Generated with Claude Code

…written bot

The owner's rule: use an existing public solution wherever one does the
job, and hand-write only where none reliably does. #178's bot was
hand-written around git-cliff; release-plz (0.4.3, through
release-plz/action v0.5.148) does the release-candidate pull request, the
version in Cargo.toml and Cargo.lock, CHANGELOG.md, the tag and the
GitHub release.

- Remove cliff.toml, release-pr.yml, release-pr.sh and its test.
- release-plz.toml: git_only; every crate in one version_group; one tag
  and release, v{{ version }}, made for thrust-core, with git_tag_name
  set for the whole workspace (set only on thrust-core, the other crates
  looked for tags of their own and re-released all of history); one
  root CHANGELOG.md; release_always = false with pr_branch_prefix "rc/"
  (the source matches the configured prefix; the docs still say
  release-plz-); release_commits for fixes, features, performance,
  refactors, reverts and breaking changes; a feature bumps the minor in
  0.x. Branches are rc/<timestamp>: release-plz takes only a prefix.
- release-plz.yml: the release and release-pr jobs, as the release
  GitHub App, skipped until RELEASE_APP_CLIENT_ID is set.
- check-release-plz.py, the one hand-written piece: release-plz has no
  workspace-level version group and does not check that every crate is
  listed. Run by deps, tested in ci-scripts (71 checks, 9 of 9 hand
  mutants caught); release-plz.toml alone now runs the Rust set.
- The workspace version is 0.1.0, so the first release is v0.1.0
  (release-plz releases an untagged package at the version it holds).
- Each setting checked with release-plz 0.4.3 on a copy of main: the
  first release, nothing right after the tag, a fix (0.1.1, one
  Cargo.toml line, cargo metadata --locked passes), a feature and a
  breaking chore (0.2.0), test/docs commits and a web/-only fix
  (nothing). A change outside the crates is released by hand, as
  cicd.md describes; release-plz set-version is not the tool (it writes
  the one crate's own version).

Refs: #49
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@aRustyDev
aRustyDev merged commit 612da1f into main Nov 15, 2026
36 checks passed
@aRustyDev
aRustyDev deleted the refactor/release-plz branch November 15, 2026 07:05
aRustyDev added a commit that referenced this pull request Nov 15, 2026
…) into the OpenAPI Projects branch

#183 merged while #179 was waiting for its first run, and conflicted with it a second time. One conflict, `.github/workflows/ci.yml`, the end of the `deps` job: #183 renamed the release step to "Release configuration and workflow guards" and rewrote its `env` and `run` (`SECRET_JOBS: release release-pr`, `check-release-plz.py`, the `release-plz.yml` lint), directly above this branch's "OpenAPI schema diff (oasdiff)" step. Main's step is taken whole and the OpenAPI step stays after it, unchanged.

`Cargo.toml`, `Cargo.lock` and `docs/src/architecture/cicd.md` merged without a conflict. `cargo metadata --locked` resolves the lockfile with `utoipa` and #183's changes together, the merged `ci.yml` parses with both steps in `deps`, and `scripts/check-openapi.sh` gives the same 37 findings, 0 unaccepted, with its four controls refused.

Refs: #58
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
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.

1 participant