ci: surface git's real rejection in version-at-land single-writer#6403
Merged
Merged
Conversation
apply_and_push ran `git push` with capture_output and printed only the generic "exhausted retries ... the branch kept moving" summary on failure, swallowing git's stderr. A NON-race rejection — a branch ruleset (GH006 "Changes must be made through the merge queue"), a permission/auth failure, a hook — was therefore indistinguishable from a genuine fast-forward race and invisible in the run log. Echo the porcelain rejection (exit code + git's own message) on each failed attempt so the cause is diagnosable. Adds test_push_rejection_detail_is_surfaced, which forces a losing push and asserts git's rejection text reaches stderr. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017CdzQZrrtCETcDYH9MABhR
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.
Why
The Model-B single-writer (
version_at_land.py --push) rangit pushvia_git(capture_output=True, check=False)and, on failure, printed only its generic summary:version-at-land: exhausted retries without a fast-forward push; the branch kept moving. Re-run.git's actual stderr was captured and discarded.That made a non-race rejection indistinguishable from a genuine fast-forward race. Concretely, this masked a release outage: main's
main-merge-queueruleset (Require merge queue) rejects the bot's directgit push origin HEAD:mainwithGH006: Changes must be made through the merge queue, even with an always-mode Repository-admin bypass in place — but every run just said "the branch kept moving," so it read as transient contention for hours.What
Echo the porcelain rejection (exit code + git's own message) on each failed push attempt. No control-flow change — the retry loop still treats every failure as a lost race; this only makes the cause visible in the run log.
Test
Adds
test_push_rejection_detail_is_surfaced: forces a losing (non-ff) push and asserts git's rejection text reaches stderr. Fulltest_version_at_land.pysuite green locally (16 tests).Scope
Observability only. The release outage itself is a design conflict (direct-push single-writer vs. required merge queue), tracked separately; this PR ends the "flying blind" gap flagged during that investigation.
🤖 Generated with Claude Code
🔎 Provenance
claudem5~/Code/pulp-obsfix3239e1c5-c3ff-434a-ac47-7db21d930bceResume
Jump to this tab
Relaunch (any agent)
Restore URL — https://claude.ai/code/session_017CdzQZrrtCETcDYH9MABhR
stamped 2026-07-20 15:44 UTC