Skip to content

fix(ci): stop release-tagging from racing itself on concurrent merges - #4361

Merged
pedrofrxncx merged 1 commit into
mainfrom
fix/release-tagging-push-race
Jul 7, 2026
Merged

pedrofrxncx merged 1 commit into
mainfrom
fix/release-tagging-push-race

Conversation

@pedrofrxncx

@pedrofrxncx pedrofrxncx commented Jul 7, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

release-tagging pushes a [release]: version-bump commit directly to main. When two PRs merge within seconds of each other, both runs trigger and the second push is rejected:

! [rejected]  main -> main (fetch first)

(Seen just now: #4357 and #4360 merged back-to-back — failed run.) Re-running doesn't help — the job checks out the original trigger commit, which is now behind main, so it's a permanent non-fast-forward.

Fix

  • concurrency guard (cancel-in-progress: false) serializes release-tagging runs so bumps queue instead of racing.
  • Rebase-and-retry push — rebase the bump onto latest main and retry (up to 5×) rather than hard-failing. The bump only touches version manifests, so it rebases cleanly over unrelated merges (the actual trigger here: chore(sandbox-env): bump chart to 0.9.2 to publish the golden cache template #4360 changed a Helm chart, not package.json). A real same-manifest conflict still fails loudly.

actionlint clean; YAML validated.

Note on the incident it fixes

No damage from that failure — the daemon image build is a separate workflow and published fine (sha-beee678); the golden feature is off by default so prod is unaffected. This just stops the red run from recurring.


Summary by cubic

Prevents release-tagging from racing on back-to-back merges by serializing runs and rebasing before push, so version bumps reliably land on main. Stops permanent non-fast-forward failures and the resulting red runs.

  • Bug Fixes
    • Added concurrency group release-tagging-main with cancel-in-progress: false to queue runs instead of racing.
    • Replaced direct push with a rebase-and-retry loop: push HEAD:main, on rejection fetch/rebase onto origin/main and retry up to 5 times; fail loudly on real conflicts.

Written for commit b1c1bdb. Summary will update on new commits.

Review in cubic

The release-tagging job pushes a `[release]:` version-bump commit straight to
main. Two merges landing seconds apart (e.g. #4357 and #4360) each triggered a
run, and the second lost the push with `! [rejected] (fetch first)`. Re-running
can't recover it: the job checks out the original trigger commit, which is now
behind main, so the push is a permanent non-fast-forward.

Two fixes:
- concurrency group (cancel-in-progress: false) serializes runs so bumps queue
  instead of racing.
- the push rebases its bump onto the latest main and retries (up to 5x) instead
  of failing on non-fast-forward. The bump only touches version manifests, so it
  rebases cleanly over unrelated merges (the actual failure here: #4360 touched
  a Helm chart, not package.json). A genuine same-manifest conflict still fails
  loudly rather than guessing.
@pedrofrxncx
pedrofrxncx merged commit 879ced5 into main Jul 7, 2026
14 checks passed
@pedrofrxncx
pedrofrxncx deleted the fix/release-tagging-push-race branch July 7, 2026 21:10
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