fix(release): push version tags in one atomic push (avoid commit_refs race)#2195
Merged
Conversation
… race) changeset publish creates a git tag per package; changesets/action then pushes them with one concurrent `git push origin <tag>` per tag. With the large Changesets "fixed" group (~73 packages bumping in lockstep), that burst of simultaneous ref-creation pushes races GitHub's ref backend, which returns `remote: fatal error in commit_refs` and rejects ~half the tags — failing the Release job even though npm publishing already fully succeeded (#2191: 54/73 tags pushed, 19 rejected). Route the publish command through scripts/release-publish.sh, which runs `changeset publish` then pushes ALL new tags in a SINGLE atomic `git push origin --tags`. One push is one ref transaction, so there is no concurrency to race; the action's later per-tag pushes become no-ops because every tag already exists on the remote. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Problem
The Release job failed on #2191 with
remote: fatal error in commit_refsand ~half the version tags[remote rejected] ... (failure).Root cause:
changeset publishpublishes every package to npm and creates one git tag per package.changesets/actionthen pushes those tags by firing onegit push origin <tag>per tag concurrently (every[command]/usr/bin/git pushin the log shares the same millisecond timestamp). With our large Changesetsfixedgroup (~73 packages bumping in lockstep), that burst of simultaneous ref-creation pushes races GitHub's ref backend →fatal error in commit_refs→ ~half the tags rejected. npm publishing had already fully succeeded by then, so the job fails after the artifacts are live.Concrete fallout on
10.0.0: all 73 packages published to npm, but only 54/73 git tags reached the remote — 19 are missing and no future release run will recreate them (changeset only tags what it publishes).Fix
Route the publish command through
scripts/release-publish.sh:All new tags go up in a single atomic
git push= one ref transaction, so there's no concurrency to race. The action's subsequent per-tag pushes become harmless no-ops (every tag already exists on the remote at the same SHA).Files
scripts/release-publish.sh— new, documented wrapper (publish + atomic tag push)package.json—releasescript now ends in the wrapper instead of barechangeset publish.github/workflows/release.yml— comment explaining whyNot covered here
Backfilling the 19
10.0.0tags already missing from the remote is a separate one-time op (these packages are published, so changeset won't re-tag them).🤖 Generated with Claude Code