fix(release-cut): only count changesets that declare a bump (#1068) - #1071
Merged
Conversation
The first real dispatch of release-cut blocked on its own changeset. Guard 3
counted every `.changeset/*.md`, but an EMPTY changeset ("---" immediately
followed by "---") is this repo's convention for a change with no package
codepath — gh1062, gh280, gh1039 and gh1056 all use it — and carries no version
intent. So by the guard's own stated rationale ("the manifest is BEHIND the
intents"), it was over-firing: nothing was behind anything.
Left as-is this would have forced a no-op Version Packages PR before every
release that followed a CI-only change, to clear a guard that had nothing to
report.
Guard 3 now parses each changeset's frontmatter and counts it only when a
package bump is declared. A bump still blocks; an empty changeset beside it
still blocks and is not named in the error, so the message points only at what
actually needs consuming.
Verified by reproducing the original failure rather than reasoning about it:
run against real repo state, the old guard exits 1 naming gh1068-release-cut.md
and the new guard exits 0 emitting version=1.0.0 / tag=v1.0.0. The guard tests
gain the empty-changeset case, the mixed case, and keep the bump case — 10 pass,
still extracted from the workflow YAML at test time so they cannot drift.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WiXADb8QTDCvPCoKLvGdqL
Contributor
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
The first real dispatch of
release-cut(run 32381357163) blocked — on the changeset added by the PR that shipped it:The dry-run did its job: guards ran, nothing was created, steps 7–9 skipped. But guard 3 was wrong.
It counted every
.changeset/*.md. An empty changeset (---immediately followed by---) is this repo's convention for a change with no package codepath —gh1062-auto-repin-single-pr,gh280-test-gpgsign,gh1039-pin-direct-deps,gh1056-org-repair-allowall use it — and carries no version intent. So by the guard's own stated rationale ("the manifest is BEHIND the intents"), it was over-firing: nothing was behind anything.Left as-is, every release following a CI-only change would have needed a no-op Version Packages PR first, purely to clear a guard with nothing to report.
The fix
Guard 3 now parses each changeset's frontmatter and counts it only when a package bump is declared:
"@bounded-systems/prx": patch→ blocks (unchanged)The guard's real purpose — catching an unmerged Version Packages PR — is untouched. Guard 1 (
expect-versionvs the manifest) independently catches the case where a newer version has been cut.Verified by reproducing the failure, not by reasoning about it
Run against real repo state, same working tree, both guard versions:
main)exit 1— blocks ongh1068-release-cut.mdexit 0— emitsversion=1.0.0,tag=v1.0.0Tests go 8 → 10, still extracting the workflow's real guard script from the YAML at test time so they cannot drift from what ships. New cases: an empty changeset does not block; a bump still blocks when an empty one sits beside it (and the empty one is not named in the error). 6 of the 10 still assert a guard blocks.
Also clean:
bunx tsc --noEmit,bunx biome check, YAML parses.Notes
v1.0.0tag from the earlier refused push would have tripped guard 2 locally. Deleted; it never reached the remote.[settings]grant letting this repo's Actions actor createv*tags (mint#18). The dry-run cannot detect that — it never pushes.Refs #1068
Checklist
6d35f9d, 0 failures;mergeable_state: clean; coverage unchanged at 87%