Skip to content

fix(release): break the qa:pre-release/tag circularity in release:finish - #303

Merged
kevintseng merged 1 commit into
mainfrom
fix/finish-release-tagging-circularity
Sep 5, 2026
Merged

fix(release): break the qa:pre-release/tag circularity in release:finish#303
kevintseng merged 1 commit into
mainfrom
fix/finish-release-tagging-circularity

Conversation

@kevintseng

Copy link
Copy Markdown
Contributor

What it does

Adds aboutToTagThisVersion to checkMainDeclaresPublishedVersion (scripts/lib/published-version.mjs), narrowly scoped to tolerate exactly one condition: real tags are visible, on main, just not the current package.json version's tag yet. Wired through check-version-coherence.mjs via a new env var MEMESH_FINISH_RELEASE_TAGGING=1, set only at finish-release.mjs's own internal qa:pre-release spawn.

Why it is needed

finish-release.mjs (this repo's own G4 gate, added tonight in PR #300) runs npm run qa:pre-release as a precondition before it creates the release tag. check-version-coherence.mjs's main-declares-published-version check always errors when main declares a version with no matching tag — which is main's state every single time release:finish runs, before gh release create has had a chance to act. qa:pre-release could therefore never pass on a freshly-bumped main, and release:finish could never succeed for any future release. This is a regression introduced by tonight's own G4 work, found by running it for real against v4.8.5.

The "no tags visible at all" branch (a shallow checkout with no tag data) is untouched and stays a hard error regardless of the flag — that is a different, real failure this fix does not touch. CI, PR checks, and every plain manual qa:pre-release run keep exactly today's behavior, since the env var is unset for all of them.

How to test

node scripts/check-version-coherence.mjs                              # still errors on main pre-tag (default, unset flag)
MEMESH_FINISH_RELEASE_TAGGING=1 node scripts/check-version-coherence.mjs  # now skips that one check, exit 0
node scripts/run-tests-isolated.mjs tests/main-declares-published-version.test.ts --maxWorkers=1  # 10/10 pass, including a break-test that an empty tag list still errors with the flag set
npm run release:finish -- --dry-run                                   # verify:artifact now PASSes on main pre-tag

Linked issues

None.

finish-release.mjs (added tonight, PR #300) runs `npm run qa:pre-release`
as its own precondition before creating the release tag. verify:release's
check-version-coherence.mjs always errors when main declares a version
with no matching tag yet -- which is exactly main's state every single
time release:finish runs, before it ever gets to `gh release create`.
qa:pre-release could therefore never pass on a freshly-bumped main, and
release:finish could never succeed.

checkMainDeclaresPublishedVersion gains aboutToTagThisVersion, narrowly
scoped to the one branch it can affect: real tags are visible, just not
this one yet. It does nothing to the "no tags visible at all" case, which
stays a hard error regardless. check-version-coherence.mjs wires this to
MEMESH_FINISH_RELEASE_TAGGING=1, set only at finish-release.mjs's own
qa:pre-release spawn -- unset for CI, PR checks, and every plain manual
run, which all keep today's behavior exactly.
@kevintseng
kevintseng merged commit 2c065f0 into main Sep 5, 2026
13 checks passed
@kevintseng
kevintseng deleted the fix/finish-release-tagging-circularity branch September 5, 2026 12:43
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