Repository navigation
fix(ci): branch release/X.Y.Z from post-freeze dev SHA - #618
Merged
Merged
Conversation
The 'Create release branch from dev' step re-read dev's ref and trusted the result. GitHub's REST ref read is not strongly consistent right after a write, so ~1s after commit-action pushes the freeze the read can still return the pre-freeze SHA; retry only retries on failure, so the stale-but-successful read slipped through and release/X.Y.Z was branched without the freeze, failing downstream release validation (missing '## [X.Y.Z] - TBD'). Poll dev until it advances past the captured pre-freeze SHA before branching, and hard-fail if it never does. Applied to this repo's workflow and the synced assets/workspace template. Refs: #617
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.
Description
Fixes a read-after-write race in
prepare-releasethat can create therelease/X.Y.Zbranch at the pre-freeze dev SHA, so the release branch lacks## [X.Y.Z] - TBDand the downstreamReleaseworkflow fails validation(
does not contain '## [X.Y.Z] - TBD'). Surfaced on the 0.3.8 release.Type of Change
ci-- CI/CD pipeline changes (fix)Root cause
Within a successful
Prepare Releaserun, the "Create release branch from dev"step re-reads
dev's ref and branches from whatever it returns:DEV_SHA=$(retry ... gh api ".../git/ref/heads/dev" --jq '.object.sha')GitHub's REST ref read is not strongly consistent immediately after a write —
~1s after commit-action pushes the freeze, the read can still return the
pre-freeze SHA.
retryonly retries on failure, so a stale-but-successfulread passes through and the release branch is cut without the freeze. The failure
only surfaces two steps later in
Release.Evidence (run
27949666239): capture pre-prepare dev SHAa1e787c(11:34:42) →commit freeze
0a9334d(11:34:44) → create branch re-read dev →a1e787c(11:34:45) →
release/0.3.8cut at the pre-freeze SHA.Changes
Poll
devuntil its SHA differs from the capturedprepare_start_sha(withbackoff), and hard-fail if it never advances; branch from that confirmed
post-freeze SHA. Applied to both copies of the identical step:
.github/workflows/prepare-release.ymlassets/workspace/.github/workflows/prepare-release.ymlChangelog Entry
Fixed
release/X.Y.Zat the pre-freeze dev SHA (#617)## [X.Y.Z] - TBDfreezeTesting
pre-commit runpasses (yamllint/shellcheck/generate-docs/etc.).dev showed
0a9334d(or failed loudly) instead of branching ata1e787c.Notes
Separate root cause from #612 (smoke-test dispatch idempotency) — this is the
devcontainer's own release branch-creation step. The already-stale
release/0.3.8still needs a one-off recovery (fast-forward to dev + re-run Release); this PR
prevents recurrence.
Refs: #617