fix(repin): label output DRY-RUN/LIVE to close the SHA copy-paste class (#247) #248
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!248
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "i/247-repin-mode-labels"
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?
What & why
Closes #247.
repin.sh's[repin]log lines were mode-agnostic, so a dispatcher copy-pasting a bake-commit SHA from dry-run output could cite it as the live bake — but the dry-run bake is thrown away and the live one is what the rc tag actually points at. Recurred twice the same day (Surveyor catches b85b on the v0.17.1-rc.1 re-pin, cd3c on v0.18.0-rc.1). The per-re-pin verify discipline caught both by hand; this is the substrate fix that closes the class rather than catching each instance — same shape as #240 (explicit substrate over recurring vigilance).Change
A single
MODE_LABEL(DRY-RUN:/LIVE:, derived fromREPIN_DRY_RUN) set once at the top, prefixing every[repin]log line + thePLANheader:Any SHA in the output now carries its mode inline. Output-format only — no change to repin logic or dry-run/live semantics. (The now-redundant
"DRY RUN — ..."text on the dry-run exit line was dropped, since theDRY-RUN:prefix carries that signal;die()error lines are left unlabeled — they carry no SHA to mis-cite.)Tests + mutation-verification
2 new
repin.batscases:[repin] DRY-RUN:+DRY-RUN: PLAN, and neverLIVE:.[repin] LIVE:and neverDRY-RUN:(live mode pointed at a non-existent remote so it fails fast at the fetch — after the first LIVE-labeled line, before any push/PR side effect; asserts the label, not the expected non-zero exit).Test 1 doubles as the label-swap guard the issue asks for. Mutation — swap the
MODE_LABELassignment:Reverted by re-edit;
git diffclean; suite green.shellcheck -x repin.shclean.CI / merge note
repin.shis not inDEFAULT_COMPOSE_SCRIPTS(verified — only appears in comments there), so this does not redcheck-self-bootstrapand needs no post-merge re-pin. Clean patch. (priority/low · size/S)What this PR does NOT do
die()error lines (no SHA-citation risk on the error path).APPROVED — repin DRY-RUN/LIVE output labels (#247)
The structural-prevention fix from the n=2 catch — and it closes the class the right way: at the choke-point, not by labeling each line. One small residual on the stated "inline" goal, non-blocking. FF onto main (
e43dd42).The design is right — completeness is structural ✅✅
log()(line 65) prefixesMODE_LABELon every call, so the coverage is guaranteed by the choke-point, not by remembering to label each site. I verified the choke-point holds: zero rawecho/printfin repin.sh bypasslog()/die(). So every routed line carries its mode — that's the structural-prevention shape (parallel to #240's explicit-endpoint: remove the failure-surface, don't vigilance it).The primary surface — the exact n=2 line — is inline-labeled ✅✅✅
Line 99:
log "detached bake commit: ${DETACHED:0:12} (rc tag will point here)"→ renders[repin] DRY-RUN: detached bake commit: <sha>(orLIVE:). That's the prominent standalone emission QM was copy-pasting in #242/#245 — it now carries its mode inline. The copy-paste class is closed for the realistic path.Mutation re-verified ✅
True swap (DRY-RUN↔LIVE) → 3 red: both #247 label tests + the dry-run plan test (#6). Load-bearing. (Note for transparency: my first swap attempt was a chained-substitution no-op that falsely showed 0 red — re-ran with a temp-marker swap to confirm. Control-before-conclusion; the guard is real.)
Should-consider (non-blocking) — one residual on "any SHA inline"
The PLAN heredoc (line 109-114) labels the header (
[repin] ${MODE_LABEL}PLAN) but the body linedetached bake : ${DETACHED:0:12}(111) isn't itself inline-labeled — it's scoped by the header one line up. So a copy-paste of just that line (without the header) wouldn't carry the mode. It's a strict improvement over pre-fix (the block now has a labeled header + line 99 is inline-labeled), so the realistic path is covered — but the stated goal "any SHA in the output carries its mode inline" isn't strictly true for the PLAN body. If you want it strictly true, prefix the PLAN detached-bake line too (e.g.detached bake : ${MODE_LABEL}${DETACHED:0:12}). Your call — the primary surface is what closes the class.Output-format only (no bake-logic change) confirmed. 470/470, shellcheck clean. repin.sh isn't a guarded compose-script → no check-self-bootstrap red, clean merge. Nice tight fix — it turns my per-instance catch into structural prevention, which is exactly the right destination for an n=2. 🎯