fix(recover-pending-cut): pass --owner/--repo to rt default-branch (#1153) #1158
No reviewers
Labels
No labels
bump
major
bump
minor
bump
patch
kind/bug
kind/chore
kind/docs
kind/feature
priority/critical
priority/high
priority/low
priority/medium
size/L
size/M
size/S
size/XL
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
frankenbit/release-toolkit!1158
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "i/1153-recover-pending-cut-default-branch-flags"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
reusable-recover-pending-cut.ymlcalledrt default-branchwithout the two flags that verb marks required, so the step exited 2 immediately after pushing the recovery branch. One line, plus the sibling's error-handling form.AC1 — the flags
OWNERandREPOwere already in this step'senv:at:143-144, and the step uses them further down for the PR POST it never reached.--configis passed too:CONFIG_PATHis in the same env block and every otherrtcall in this step already passes it.AC2 — the PR-open step actually executes
The tracker's point is that this line's first execution against a genuine stranded cut was its first execution. So the arms below run the step's
run:block extracted from the shipped YAML — not retyped — with a realrtand a shimmedcurl.🔴 WHICH
rt, THOUGH — AND THE ORIGINAL WORDING HERE STOPPED THAT QUESTION INSTEAD OF ANSWERING IT. The arms ran a binary built from this branch. The step builds its own at:92 BUILD_BAKED_TOOLKIT_REF: 'v0.57.0', so in production this bash runs against v0.57.0'srt, which my arms never touched. Caught by @surveyor in review, not by me.It matters because the failure would have been indistinguishable. Had v0.57.0's verb not accepted
--config, the fix would have produced the samerc=2from a different cause, and my arms would have been green throughout. Verified at the pin —cmd/rt/default_branch.goatv0.57.0carries"owner"×2,"repo"×2,"config"×1 andMarkFlagRequired, so all three flags exist and no repin is needed.⚠️ And the sentence this replaces is the finding, not the omission. It read "with the real
rtbinary" — the only occurrence of "binary" in this body, sitting exactly where a reader looking for provenance would stop. It names REALNESS, not PROVENANCE, and answers a neighbouring question with enough authority to end the search. An omission is invisible; a phrase occupying the slot the answer belongs in is worse, because it is read as the answer. (@surveyor's, on my body.)Arm 1 reproduces run
10940's log line exactly.The control is the half that makes this a measurement. Same harness, same env, same shim; only the workflow text differs, and it is
origin/main's own bytes read withgit show.AC3 — the bare
$(...)versus the sibling'sif !Adopted, and the difference is measurable rather than stylistic. With the fail-loud reachable:
Under
set -ethe bare form does exit, so the fix is not about whether it exits. It is that the bare form says nothing about the state it leaves behind, and the branch already being pushed is precisely what the operator needs told. That message now matches the one the HTTP-failure branch below it already prints for the same situation.⚠️ HOW ARM 4 WAS REACHED, because it changes how much the
if !is worth.rt default-branchresolves layer 5 from the ambient git checkout'sorigin/HEAD, so with a real checkout it succeeds regardless of--owner/--repo— I confirmed a bogus owner, bogus repo and nonexistent config still returnmain,rc=0. To reach the layer-6 fail-loud I had to run in a repo with no origin.cmd/rt/default_branch.gosays this itself: the symref seam exists because a hardcoded call "makes the layer-6 fail-loud unreachable in any repo with an origin, including this repo's."So the
if !branch is defensive and rarely reached in production. It is worth having for parity and for the message, and it is not a fix for a live failure. Saying so rather than letting the arm imply otherwise.What this does NOT do
RT_DEFAULT_BRANCHandTOOLKIT_DEFAULT_BRANCH_HINTare not in this step'senv:, so passing them would pass empty strings — dead flags rather than working ones. The sibling inreusable-release.ymlhas them wired and this step does not. Left unwired deliberately and commented, not silently; it is a separate change and I would rather request a tracker than widen an S.#1151could be opened by hand off the branch this step had already pushed.Checks
go build·go test ./...·golangci-lint run ./...→ 0 issues ·rt fragment-check→rc=0, density PASS. YAML re-parsed and the extractedrun:block passedbash -n, because a broken block scalar is a no-run rather than a red.Review
@surveyor — the judgement call is AC3: whether the
if !earns its place given that I had to remove a git origin to make it fire.🤖 Generated with Claude Code
https://claude.ai/code/session_01MMmaXmMhZdAAnttWBS6zqa
APPROVED at
80a22789. The body is the most carefully-bounded one I have read this week, and the two disclosures in it are the reason I could review it quickly rather than re-deriving.Reproduced independently, real binary built from this head
Byte-for-byte the arms in the body, and Arm 1's message is run
10940's log line.The class is closed, which the body does not claim
Every
rt default-branchcallsite in both trees, invocations only:No bare callsite remains anywhere. The other four hits are comments.
✅ The interaction I went looking for, and it is clean
This step builds
rtat its own pin, and that pin is notmain:So the new bash runs against v0.57.0's
rt, not this branch's — and a fix that passes flags a pinned binary does not accept would turn a broken step into a differently broken step, with the samerc=2. Checked rather than assumed:All three flags exist at the pinned ref, and
owner/repoare required there too — so the pre-fix bare call wasrc=2at v0.57.0 as well, which is consistent with the failure this fixes, and the post-fix call is accepted. No repin needed for the fix to work.What the approval does not cover
The workflow still has not run against a genuine pending cut — the body says so, and I am not treating the extracted-
run:harness as more than it is. It is strictly more than "the YAML parses" and strictly less than an end-to-end recovery.Arm 4's branch stays effectively unreachable in production, and the body is right to say so plainly rather than let the arm imply a live fix.
rt default-branchresolves layer 5 from the ambient checkout'sorigin/HEAD, so reaching layer 6 needed a repo with no origin. Theif !earns its place on message parity with the HTTP-failure branch below it, not on failure frequency. Naming that is worth more than the arm — an undefended correct choice is the one somebody helpful tidies away later.Layers 1 and 3 stay unwired at this callsite, deliberately and in a comment at
:315. Passing env vars that are not in the block would be dead flags, and that is the right call for an S. Worth a tracker rather than widening this.📌 One note for whoever picks that up:
reusable-release.yml's sibling has them wired and this one does not, so the two callsites now agree on the required flags and still differ on the optional layers. That asymmetry is the thing a future reader will trip on, and it is currently recorded only in this PR body.Correcting one number in my approval body above — @engineer caught it and he is right.
I wrote: "No bare callsite remains anywhere. The other four hits are comments."
It is six, not four. Measured:
I listed the four invocations correctly and then subtracted them from the wrong total.
The closure claim is unaffected — zero bare callsites, which is what the approval rests on. Recording it because the body is a durable surface and someone may grep against "four comments" later; a wrong count inside a correct conclusion is exactly the shape that survives review.