Repository navigation
feat(release): a git-cliff changelog and the rc/* release-candidate bot - #178
Merged
Merged
Conversation
After every push to main, release-pr.yml keeps one branch, rc/vX.Y.Z, equal to main plus a single commit `chore(release): vX.Y.Z` that writes CHANGELOG.md, the [workspace.package] version and the workspace packages' versions in Cargo.lock, and one pull request from it to main. - cliff.toml: features, fixes, performance, refactors, reverts and breaking changes are listed, and only a listed commit makes a release, so a docs-only merge does nothing. First version v0.1.0; in 0.x a feature or a breaking change bumps the minor. - The new section is prepended to main's CHANGELOG.md, never regenerated, and dated by main's head commit (git-cliff would date it today, so the same main would make a different branch tomorrow). - prepare holds no secret and computes the tree locally; publish posts it with the release App's token and refuses unless GitHub's tree matches, commits through the API (signed by GitHub), moves the branch, opens or updates the PR, and removes superseded rc/* branches. A push with GITHUB_TOKEN would start no workflow on the branch. - It skips when the head is a release, when the last merged release is untagged, or when nothing is releasable. publish stays off until the repository variable RELEASE_APP_CLIENT_ID is set. - test-release-pr.sh (122 checks) walks a release's life with a real git-cliff and checks publish against a fake gh; 21 hand mutants of the script were each caught. classify-changes.sh treats cliff.toml as a change that runs the Rust set, so its test runs. Refs: #49 Co-Authored-By: Claude Opus 5.5 <[email protected]>
aRustyDev
added a commit
that referenced
this pull request
Nov 15, 2026
…written bot (#183) 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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
PR 1 of the CI/CD plan (
.agents/plans/cicd-review/PLAN.md, in #177): the git-cliff changelog and the bot that keeps the release-candidate branch.After every push to
main, the newrelease-pr.ymlkeeps one branch,rc/vX.Y.Z. That branch ismainplus a single commit,chore(release): vX.Y.Z. The commit writes:CHANGELOG.md;[workspace.package];Cargo.lock.The bot also keeps one pull request from that branch to
main. Merging that pull request is the release.cliff.tomlv0.1.0. In 0.x, a feature or a breaking change bumps the minor version..github/scripts/release-pr.sh prepare.github/scripts/release-pr.sh publishrc/*branches of superseded versions..github/workflows/release-pr.ymlprepareandpublish.publishstays skipped until the repository variableRELEASE_APP_CLIENT_IDis set.Design points:
main'sCHANGELOG.mdand never regenerated.main's head commit (UTC). git-cliff would stamp an untagged section with today's date (I checked this). The samemainwould then make a different branch tomorrow.GITHUB_TOKEN. A branch pushed withGITHUB_TOKENstarts no workflow, so neithercinor the staging deploy (PR 2) would run on it.Tests
test-release-pr.sh(122 checks, inci-scripts):origin, using the repository's owncliff.tomland a real git-cliff.publish's API calls, their order, and the bytes it sends, against a fakegh.ci.ymlandrelease-pr.ymlpin the same git-cliff version (2.14.2).preparegivesv0.1.0: 75 listed commits (55 features, 11 fixes, 9 refactors).cargo metadata --locked --offlineaccepts the rewrittenCargo.tomlandCargo.lock. The control, an updatedCargo.tomlwith the old lockfile, fails with exit 101.ci-scriptstest under dash;depsguard that does not build;lint-workflow.sh(its control fails as expected withoutSECRET_JOBS=publish);actionlint.classify-changes.sh: a change tocliff.tomlalone now runs the Rust set, so the bot's test runs. Three cases were added for it.Owner steps before it goes live (also in
cicd.md, "Release candidates")release, limited tomain, with the secretRELEASE_APP_PRIVATE_KEY.RELEASE_APP_CLIENT_ID. Do this after step 2: GitHub creates an unprotected environment when a job names one that doesn't exist.rc/*ruleset with the App and admins as the only bypass actors.Don't merge an
rc/*PR until PR 3 (the release workflow) lands. Nothing would tag the merge.Refs: #49
🤖 Generated with Claude Code