fix(release): mirror verified gate into the PR status rollup - #5457
Merged
Conversation
The release workflow verifies gate through a workflow_dispatch check-run on its scratch branch, but those check-runs have no pull-request association. The protected release PR therefore omits gate from its required-context rollup and rejects every merge with HTTP 405, even when a newer gate check-run is green. After the exact-SHA gate wait succeeds, publish gate:success as a SHA-scoped commit status before opening the PR. Fail closed if that POST fails, remove the ineffective post-PR re-dispatch race, preserve gh pr create diagnostics, and document the corrected protection flow. Extend the release harness to prove status/PR/merge ordering and both new failure paths. Fixes kubestellar#5356 Signed-off-by: Danathar <doug.baggett@gmail.com>
Contributor
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
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
Automated tagged releases reach the protected merge into
v4and are rejected for the full retry window:The release workflow has already observed a successful
gatecheck-run on the exact release commit at that point. Nevertheless, release PRs such as #5402 remained blocked andv4.0.1could not be cut.Root cause
The release commit earns
gateby dispatchingdocker.ymlon a throwawayrelease-gate/v<version>branch. That proves the exact SHA, but aworkflow_dispatchcheck-run has no pull-request association: itspull_requestslist is empty, including when the workflow is dispatched after the release PR exists.Branch protection evaluates the release PR's required-context rollup. That rollup contained the SHA-scoped
dcoandtidecommit statuses but never the successful workflow-dispatchgatecheck-run, so the protected merge correctly reportedgateas missing.The post-PR re-dispatch added by #5363 cannot repair that representation mismatch. #5402 had a second green gate suite newer than every empty PR-open suite by 35 seconds and still received the same 405 for the entire merge window. Recency is not the discriminator; PR association is.
Implementation
.github/workflows/tagged-release.ymlstatuses: writeonly to thereleasejob, while explicitly preserving that job's existing permissions;gatecheck-run on the exact release SHA, postsgate: successthrough the commit Statuses API;gh pr createresponse on failure instead of masking the diagnostic;src/scripts/test-release-push-retry.shgate: successpayload, job permission, and ordering.src/docs/releases.mddocuments the actual scratch-check, status-mirror, protected-PR merge, and cleanup flow..github/workflows/docker.ymlcorrects the release-gate archaeology while preserving the ordinary PRgatejob unchanged.Design and safety invariants
The commit status is a transport for an already-earned verdict, not a second gate implementation. A missing, red, or timed-out docker check-run stops the preceding step, so it is impossible for this path to post success without first accepting docker.yml's result on the same
commit_sha. The status POST itself is fail-closed.The existing check-run remains the source of truth and remains what the workflow waits on. A commit status is used only because it is SHA-scoped and therefore visible to the release PR without a check-suite/PR association. GitHub's protected merge endpoint still makes the final decision, and the
sha=argument still prevents merging a moved head.statuses: writeis job-scoped rather than workflow-wide. No PAT, GitHub App, repository secret, branch-protection bypass, force push, or protection configuration change is introduced.Rejected alternatives:
pull_requests: []; it cannot enter the PR rollup and only adds a race and up to 10 minutes of waiting.gatefrom branch protection would weaken protection for every otherv4update and is unnecessary.Verification
bash src/scripts/test-release-push-retry.sh— PASS: 10 execution scenarios plus workflow-wiring assertions.bash src/scripts/check-release-lines.sh— PASS.bash src/scripts/check-no-image-attestations.sh— PASS.bash src/scripts/check-action-pins.sh .github/workflows— PASS with upstream action repositories reachable.bash -n src/scripts/test-release-push-retry.sh— PASS.git diff --check— PASS.The protected release merge itself cannot be exercised from a fork; the next release attempt is the end-to-end confirmation. This PR deliberately does not change ordinary contributor PR gate behavior, image publication, version derivation, release deferral, tag retries, or GitHub Release creation.
Fixes #5356
— hive: backend=codex