fix(ci): serialise docs deploys so release tags stop racing main - #46
Open
CSSFrancis wants to merge 1 commit into
Open
fix(ci): serialise docs deploys so release tags stop racing main#46CSSFrancis wants to merge 1 commit into
CSSFrancis wants to merge 1 commit into
Conversation
The concurrency guard was keyed on github.ref with the comment "Only one
docs deployment should run at a time to avoid race conditions on the
gh-pages branch". A push to main and a push to its v* tag are different
refs, so they landed in different groups and ran concurrently — the guard
never applied to the case it was written for.
Both runs push to gh-pages. The second lost:
! [remote rejected] gh-pages -> gh-pages (cannot lock ref
'refs/heads/gh-pages': is at 38726cd but expected 0f190b2)
The build itself succeeded, so the failure looks cosmetic in the Actions
tab, but the versioned directory never gets published while
prepare_release has already added the version to switcher.json — so the
switcher offers a 404. v0.4.2 and v0.5.0 are both missing from gh-pages
for this reason.
Split the grouping: the workflow keeps a per-ref group so a new push
still supersedes an in-flight build of the same ref (PR iterations), and
the deploy job takes a ref-independent "docs-deploy" group with
cancel-in-progress: false so deploys queue. Cancelling would drop a
version directory just as surely as the race did.
Does not backfill the two missing directories — re-running those Docs
runs publishes them, since keep_files: true makes deploys additive.
Assisted-by: Claude Opus 5 (1M context)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #46 +/- ##
=======================================
Coverage 90.32% 90.32%
=======================================
Files 39 39
Lines 4185 4185
=======================================
Hits 3780 3780
Misses 405 405 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
The failure
The
Docsrun for tagv0.5.0failed at the deploy step:Build docssucceeded — only the push lost.Why the existing guard didn't catch it
A push to
mainand a push to itsv*tag are different refs, so they gointo different concurrency groups and run concurrently. Both push to
gh-pages; the second is rejected. The guard never applied to the case its owncomment describes.
Why it matters more than a red X
prepare_releaseadds the new version toswitcher.jsonregardless, so a lostdeploy leaves the switcher advertising a directory that doesn't exist. On
gh-pagestoday bothv0.4.2andv0.5.0are missing while the switcheroffers them — those entries 404.
The fix
Split the two concerns:
docs-build-${{ github.ref }}) so anew push still supersedes an in-flight build of the same ref — PR iterations
keep cancelling as before.
deployjob takes a ref-independent group (docs-deploy) withcancel-in-progress: false, so deploys queue. Cancelling would drop aversion directory just as surely as the race did.
Backfill
Not included here. Re-running the two Docs runs publishes the missing
directories —
keep_files: truemakes deploys additive, so nothing isoverwritten. I've already re-run the
v0.5.0one.🤖 Generated with Claude Code
https://claude.ai/code/session_012TTbBeDrPJBTpruuszC3mD