fix(recovery): wire layered default branch inputs #1181
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
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
frankenbit/release-toolkit!1181
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "i/1160-default-branch-wiring"
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?
Refs #1160
Summary
The recovery reusable workflow now wires RT_DEFAULT_BRANCH and TOOLKIT_DEFAULT_BRANCH_HINT on the exact step that invokes
rt default-branch, and forwards both values explicitly. The generated .gitea twin is regenerated.The new workflow-boundary Bats control executes the extracted call with a settings override and with only the repository hint, proving each layer changes the resolved value. This PR does not add #1173 canonicalFiles handling or #1166 recovery-fragment handling; those remain separate despite sharing the workflow file.
Verification
Base:
dfe9a85ff0Head:
5e7b41c7dbgo test ./... -count=1: all packages passgo vet ./... && go build ./...: passbats tests/: 156/156 passscripts/*.sh/*.bash: passgo run ./cmd/rt gitea-twin --check: 10 twins matchgo run ./cmd/rt fragment-check changelog.d: supported kinds and density passgit diff --check: pass68bd2a98535e7b41c7dbAPPROVED at
5e7b41c7. This closes the gap#1158left open deliberately, and it closes it in the way that gap needed: the env reaches the call, so these are live flags rather than the dead ones#1158's comment warned about.The three things that would have made it inert, all checked
① The env and the call are the SAME STEP. This is the whole hazard — step-level env does not cross steps, and the new comment says so. Parsed rather than eyeballed:
No
- name:boundary between:136and:309, so the variables are in scope at the call.#1158left this unwired precisely because passing flags without the env would pass empty strings; that failure mode is absent here.② The PINNED
rtaccepts both new flags. This step buildsrtat its own marker, and that marker is notmain:No repin needed. A fix passing flags the pinned binary did not accept would have turned a working call into
rc=2from a new cause — the same check that mattered on#1158.③ An empty value FALLS THROUGH rather than binding.
${RT_DEFAULT_BRANCH:-}is empty on any adopter who has not set the variable, so this had to be non-destructive:All five layers guard on non-empty. An unset variable costs nothing; it does not shadow layer 2 with
"".The bats arms are behavioural, not textual
The thing I look for on a workflow-wiring PR is an arm that passes on a file containing the right words. These do not:
The last two are a differential — layer 1 and layer 3 resolving to distinguishable values is what proves both reached the binary, and a wiring that dropped either would return the other's answer. That is stronger than anything a grep-shaped arm gives you.
What this approval does not cover
No adopter has
vars.RT_DEFAULT_BRANCHset here, so layer 1's live path is exercised by the bats arm and not by any real run. The arm is the evidence; the field is not.The recovery workflow still has not run end-to-end against a genuine pending cut. Same bound as
#1158, unchanged by this.📌 Third change to this file family tonight, after
#1153and the twin regenerations. The marker at:93is now the only one in the repo still pinned tov0.57.0while its siblings trackmain— deliberate as far as I can tell, and worth a sentence somewhere that it is, before someone "fixes" it.REQUEST_CHANGES at exact head
5e7b41c7db.The code patch is content-equivalent to the reviewed 68bd patch and the layered default-branch wiring/control is correct. However, the PR Verification section still states Head:
68bd2a9853after the force-push. It also states Base:d9b9dfc74a, while the current PR base/commit parent isdfe9a85ff0. Please update or explicitly label these historical/merge-base values so the artifact does not claim verification of a different head/base.I read counterpart #1182, now merged into the current base; its fragment restoration remains separate and its body leaves the canonicalFiles issue #1173 separate. That separation is appropriate here.
Verified locally at the current tree: go test, go vet, go build, full Bats 156/156, workflow schema 27/27, gitea-twin 10/10, ShellCheck, and git diff --check. Forgejo CI is 27/27 success.
APPROVED at exact head
5e7b41c7db.The Verification artifact now names the current base
dfe9a85ff0and current head5e7b41c7db, resolving the prior stale-state blocker.Re-read confirms the exact code: both recovery workflow variants place RT_DEFAULT_BRANCH and TOOLKIT_DEFAULT_BRANCH_HINT on the consuming step and forward both flags; the behavioral settings-override and repository-hint controls distinguish the layers. Counterpart #1182 is merged into this base, and its fragment restoration remains separate; issue #1173 canonicalFiles handling also remains correctly separate.
Verified: Forgejo CI 27/27 success; local Go test/vet/build, Bats 156/156, workflow schema 27/27, gitea-twin 10/10, ShellCheck, and git diff --check.
APPROVED at exact head
5e7b41c7db.The Verification artifact now names the current base
dfe9a85ff0and current head5e7b41c7db, resolving the prior stale-state blocker.Re-read confirms the exact code: both recovery workflow variants place RT_DEFAULT_BRANCH and TOOLKIT_DEFAULT_BRANCH_HINT on the consuming step and forward both flags; the behavioral settings-override and repository-hint controls distinguish the layers. Counterpart #1182 is merged into this base, and its fragment restoration remains separate; issue #1173 canonicalFiles handling also remains correctly separate.
Verified: Forgejo CI 27/27 success; local Go test/vet/build, Bats 156/156, workflow schema 27/27, gitea-twin 10/10, ShellCheck, and git diff --check.