Repository navigation
Release script refuses a release that can't be cut - #166
Merged
Merged
Conversation
The release script now refuses a version that isn't plain X.Y.Z, one not higher than the manifest's on origin/main, a v<version> tag that exists locally or on origin, and a latest CI run on main that isn't a success on main's tip. The fake gh reports the latest workflow run on a branch through `gh run list`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Check the tag on origin before locally, since fetching main brings in the tags on it. Share the [package] field lookup with the version bump, pass the checks their inputs as arguments, and drop setup the refusal tests don't need. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in the claude-written release summary (#167). The release tests keep both sides' helpers: the CI-run and origin-refs helpers for the refusals, and the fake claude helpers for the summary. The CI refusal test's merge_pr call takes the body argument main added. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Sep 30, 2026
Merged
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.
Summary
scripts/release.sh <version>now refuses a release that can't be cut, before the worktree is made or anything is pushed:Origin's tags are checked before local ones because fetching main brings in the tags on it. A tag that came in that way is reported as being on origin.
Evidence
cargo test --test releasewith the new tests: all fail. With no checks in the script,0.1.0,v0.4.0and red CI on main all went ahead and opened a PR.After:
cargo test --test releasepasses 15 tests. Each refusal test asserts a non-zero exit,refusing to releaseplus the reason on stderr, origin's refs (for-each-ref) unchanged, and the fakegh's PR list unchanged:v0.4.0,0.4,abc,0.4.0-rc.1,01.4.0,0.4.0.1and""0.1.0on main:0.1.0,0.0.9and0.0.10.0.10.0still goes through, so versions compare as numbers, not text.completed failure, isin_progress, or is on an older commit than main's tipcargo test --no-fail-fastpasses every test exceptmerge_run::ctrl_c_after_the_merge_finishes_the_post_merge_steps_and_exits_as_merged. That test failed in two full runs, both times on the harness's fixed 10-second "the agent never started" deadline (tests/support/mod.rs:225), which only trips under full-suite load. It passes 3 of 3 times on its own, and it uses neithergh run listnorgh fake run.cargo clippy --all-targets -- -D warningsandshellcheck scripts/release.share clean.Merge Danger
Door: two-way
Blast Radius: maintainer-only
This only changes the maintainer's release script and the test fake. The thirdshift binary and the workflows are unchanged. At worst, a release that could be cut gets refused, and reverting this PR fixes that.
Unaddressed findings
Spec
0.4.0-alpha) would fail the numeric comparison with an unclear error rather than a clean refusal. Pre-releases are out of scope for Cut a release with one command: bump PR, agent-written summary, merge and tag #150, and the manifest has always been plainX.Y.Z.ci.ymlonpush. That is how CI runs on main. If the workflow is renamed, the script refuses ("CI has not run") rather than going ahead.Standards
refusereads the global$version. It is a message helper likeprogress, and the version is fixed for the whole run.assert_refusedcould be a method onRelease. The file already keeps free helpers such asstderr, so it stays a function.LATEST_RUN_LINEin the fake repeats the script's--jq. This follows the existingWORKFLOW_RUN_LINESpattern, so an unexpected query fails loudly.Closes #157
🤖 Generated with Claude Code