ReviewOS

stacks/bumpx

Make release branch and tag publication atomic

#2007
Closed chris opened this 9 days ago ·
9 days ago

Problem

bumpx --push --tag currently creates the release commit and annotated tag, then runs git pull before git push --follow-tags.

If the upstream branch advances in that interval and the pull rebases the release commit, the annotated tag remains attached to the pre-rebase commit. Because that commit is no longer reachable from the pushed branch, --follow-tags may omit the tag entirely. If the tag is pushed separately, it can instead identify a different commit from the release branch.

This occurred during a Pantry release and left the local release tag on an orphaned pre-rebase commit.

Required contract

  • synchronize with the configured upstream before modifying release files
  • require a clean working tree before synchronization
  • use a fast-forward-only synchronization
  • publish the current branch and the exact newly-created release tag in one atomic push
  • reject a late upstream race without publishing the branch or tag
  • integration-test both an upstream update before synchronization and a late update before publication
  • verify the remote tag dereferences to the same commit as the remote release branch
9 days ago

Implemented and released in v0.2.7.

Verified after fetching from GitHub that origin/main, local HEAD, local v0.2.7^{}, the remote main ref, and the remote dereferenced v0.2.7 tag all resolve to 9cda967f322366da184ce7901595de9e02ae6a30.

The full local suite passed with 457 tests, 2 intentional skips, and 0 failures. Typecheck and both package builds also passed. The integration coverage now proves both pre-release upstream synchronization and all-or-nothing rejection when the upstream advances before atomic publication.

Sign in to comment on this issue.