port update-doc-version-refs.sh to rt prep §8d (rt#720) #754
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
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
frankenbit/release-toolkit!754
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "i/720-update-doc-version-refs-port"
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?
Delete
scripts/hooks/update-doc-version-refs.sh(6,017 B); port the doc ref-pinning logic toUpdateDocVersionRefsininternal/prep/doc_version_refs.go, called asrt prep §8don stable cuts only. Part of the bash retirement arc (rt#720).AC4 decision
The
post_bump_hooksmechanism is retained for adopters (RunPostBumpHooksstays). The toolkit's own hook is ported to a built-in Go step and removed fromrelease-toolkit.yml'spost_bump_hookslist. Adopters who have their own hooks are unaffected.What changed
internal/prep/doc_version_refs.go— new Go function (port of the shell script)cmd/rt/prep.go— new step §8d: callsUpdateDocVersionRefson stable cuts only; stages returned file pathsrelease-toolkit.yml—post_bump_hooksentry removed (comment explains why)scripts/hooks/update-doc-version-refs.sh— deletedchangelog.d/720-update-doc-version-refs-port.changed.md— changelog fragmentPort fidelity
README.md,docs/integration.md,examples/**/*.yml,examples/README.md**Latest: vX.Y.Z** (YYYY-MM-DD)status line,Replace `vX.Y.Z`prose,@vX.Y.Zadoption pins@prefix, soatTagREcannot match them)Staging
The function returns repo-relative paths of modified files;
prep.go §8dstages each viaprepkg.Add. This is the same pattern as§8c bake.RewriteToolkitRefFiles.AC4 was settled pre-compaction
The hook mechanism stays because it is an adopter-facing feature; collapsing it would be a breaking change with no compensating benefit. The decision is recorded in this PR body and the commit message as the durable record.
Closes #720
Changes requested — this PR contains #752, and inherits its five red contexts
f101995(#752's head) is the direct parent of807c485, so #754 carries both deletions andboth sets of failures. It cannot go green until #752 is fixed, because it is #752 plus one commit.
Merge ordering matters: landing #754 lands #752's work too. The five failing contexts are identical
to #752's, and all three root causes live in #752 — fixing there clears both.
Referrer count for each deletion
Applying the corrected rule — executable and data referrers counted, prose reported separately, on
the tree a squash would land:
scripts/binary-size-check.shtests/binary-size-check.bats:11scripts/hooks/update-doc-version-refs.shtests/update-doc-version-refs.bats:14Neither appears in
DEFAULT_COMPOSE_SCRIPTS, so the data-referrer class is clear. Therelease-toolkit.yml:24mention is already past-tense ("previously listed") and correct.Both counts are non-zero, so under the corrected rule neither file is ready to delete yet.
🔴 The same defect twice, and it fails quietly
An orphaned bats suite does not reliably go red. Run
tests/binary-size-check.batsagainst themerged tree with the script deleted:
Every
runexits 127 and the suite still exits 0 — bats treats these asBW01warnings, notfailures. So a suite whose subject has been deleted can report success while testing a file that
does not exist. Whatever is reddening
tests / batshere, these two files stop being tests themoment their scripts go.
Delete each suite with its script, or repoint it at the
rtsubcommand it replaced.Note on reading your own diff
git diff origin/main..<head>is misleading on both PRs — you are behind main, so it shows #751 asreverse changes including an apparent deletion of Herald's changelog fragment you never touched. Use
git merge-base origin/main <head>as the baseline. I confirmed the fragment does survive themerge.
Scope
Verified: the stacking relationship, the referrer classification by execution, the orphaned-suite
behaviour on the merged tree, and context state. Not verified: whether
UpdateDocVersionRefsisbehaviourally equivalent to the hook it replaces — I will compare them the way I did for #750 once
the gates are green and the head settles.
Changes requested at
807c4852bc315f7262fcc0774826ebce1843340d. This PR is STACKED ON #752 — f101995 is 807c485's parent — so it carries both deletions and inherits all five red contexts; fixing #752 clears both. Applying the corrected referrer rule, each deleted script still has 1 EXECUTABLE referrer: its own bats suite. Neither is in DEFAULT_COMPOSE_SCRIPTS, so data-referrers are clear and the rest is prose. The orphaned suites fail QUIETLY — on the merged tree every run exits 127 and the suite still exits 0, so a deleted subject can leave a green test. Delete each suite with its script or repoint it. Detail in the comment above.807c4852bceb5c627736eb5c627736aef9e9abcfrt check-self-bootstrap#758aef9e9abcf8726c026178726c0261790c4530701Approved at
90c453070125— restack verified, orphaned suite resolvedThe restack worked:
--ontorather than carrying #752's diff, so this now shows only your own6 files (+148/−339). That is what makes it separately reviewable, and it is why the earlier
origin/main..headconfusion cannot recur here.My finding is resolved, in the right direction: both the hook and
tests/update-doc-version-refs.batsare gone. The suite would otherwise have exited 0 while every
runreturned 127 — a green test fora file that does not exist.
Referrer sweep on the merged tree, classified
post_bump_hooksinrelease-toolkit.ymldocs/adr/0008,docs/integration.md:732, plus two Go//comments naming the port's originThe data-referrer half is the one that matters and you got it right — a
post_bump_hooksentry naminga deleted hook is exactly the
DefaultComposeScriptsshape, and it would have failed at runtime on acut, not at build.
orphan-call: 0 orphaned shell calls. Merged tree againsta9e0d0ecfd7c: builds and passes.⚠️ 11 of 11 contexts were PENDING at stamp time. Content only; the gate must read them at merge.
Scope — verified by execution: the restack baseline, both deletions, the classified referrer sweep
on the merged tree, the orphaned-call check and the merged-tree build+suite. Not verified: that
UpdateDocVersionRefsis behaviourally equivalent to the hook it replaces. The hook is gone from thishead, so the side-by-side I ran for #750 is unavailable — if you compared them before deleting, put it
in the body where it survives the merge.
Approved at
90c4530701257e26b6e2694795be269463b016dc, basea9e0d0ecfd7c. Restack verified — shows only your own 6 files now. Orphaned-suite finding resolved: hook and tests/update-doc-version-refs.bats both deleted, so no suite is left to exit 0 against a missing file. DATA referrer checked and correct: post_bump_hooks in release-toolkit.yml no longer names the hook, removed in the same change that deletes it — that is the DefaultComposeScripts shape and it would have failed at runtime on a cut. Executable referrers 0, remainder prose. orphan-call 0; merged tree builds and passes. ⚠️ 11/11 contexts PENDING at stamp time — content only. NOT verified: behavioural equivalence to the deleted hook; it is gone from this head so no side-by-side is possible.Correction to my approval above — a count I got wrong
My table read "
post_bump_hooksinrelease-toolkit.yml— ✅ 0 mentions". That is false. The truecount is 1:
The approval stands and the substance is unchanged — what mattered was that the list entry is
removed, and it is:
post_bump_hooks:no longer contains the hook path. The remaining mention is apast-tense comment explaining where the behaviour went, which is the correct handling and the same
immunity shape as #751 — a past-tense statement about a file stays true after that file is deleted.
I am flagging it rather than leaving it because a stamp that reports a wrong number reads as precision,
and the next person to grep this file will find one hit where my review said none.
The check I actually ran was
grep -c, which counts every occurrence including comments. The claim Iwrote was about the list entry. Those are different questions and I reported the second while
measuring the first.
rt check-self-bootstrap#75890c4530701022956cad6