port binary-size-check.sh to rt binary-size-check (rt#720) #752
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!752
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "i/720-binary-size-check-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?
Port
scripts/binary-size-check.sh(273 lines, 12,221 B) to a Go subcommandrt binary-size-check, then delete the shell script. Part of the bash retirementarc (rt#720).
What changed
cmd/rt/binary_size_check.go— new Go subcommand (faithful port)internal/forgejo/interface.go—GetLatestReleaseadded to Client interface;Releaseextended withAssets []ReleaseAssetinternal/forgejo/reads.go—GetLatestReleaseimplementation.forgejo/workflows/go-ci.yml— "binary size step-change gate" step updated to callrt binary-size-check;BASE_REFenv mapping dropped (usesGITHUB_BASE_REFdirectly); comment updated for rt#720cmd/rt/main.go+cmd/rt/main_test.go+cmd/rt/testdata/help.txt— subcommand registered and surface pinned (count: 15→16)scripts/binary-size-check.sh— deletedchangelog.d/720-binary-size-check-port.changed.md— changelog fragmentPort fidelity
Same tri-state exit codes (0=pass / 1=step change exceeded / 2=could-not-grade), same flags (
--max-growth-pct,--baseline-bytes,--attribute-ref), same merge-base attribution on a red, same pass-with-disclosure output naming its own silences. The--max-growth-pctdefault (20) carries forward with its "starting value, not measured" annotation.go-ci.yml lines touched (bake fixture note)
The modified step is "binary size step-change gate" in the
gojob — therun:block that called./scripts/binary-size-check.shnow callsrt binary-size-check. The step comment block above it was also updated. No other steps in go-ci.yml were changed.forgejo-api.sh referrer count
binary-size-check.shwas one of four executable referrers toforgejo-api.sh(Shipwright arm-3 count). This deletion reduces that count from 4→3;forgejo-api.shcannot be deleted until the remaining three referrers land.ACs satisfied (rt#720)
go-ci.ymlinvokes noscripts/**/*.shfor this gateCloses #720
Changes requested — 5 required contexts are red, and one defect CI does not name
I ran each failing gate rather than inferring from the context names, so these are the actual causes.
1.
fragment-check×3 — a 47-word sentenceLimit is 30. The gate names the sentence and links the density rules. Fix the fragment, not
CHANGELOG.md—rt preprecomposes that file from fragments on every cut.2.
go-ci— lint, not build or testThe head builds and tests clean locally (
go build ./...rc=0,go test ./...rc=0). It iserrcheck:3. 🔴
tests/binary-size-check.batsis orphaned — and it fails quietlyThe PR deletes
scripts/binary-size-check.shand keeps the suite that tests it:Run against the tree a squash would land, every
runexits 127, command not found — and in myenvironment the suite still exits 0, because
runcaptures the status instead of aborting. Batsemits
BW01warnings rather than failures.So this is not merely a red — it is a suite that can go green while testing a file that does not
exist. Whatever is reddening
tests / batson CI, this file stops being a test the moment thescript is deleted. Delete it alongside the script, or repoint it at
rt binary-size-check.This is the arc's characteristic shape inside a single PR: a deletion breaking a reference that
lives in another file. Nothing structural catches it —
git merge-treereports clean, and a suitewhose subject vanished reports success.
What is fine
scripts/binary-size-check.sh); nothing else.merged tree and compiling it, with a mutation control confirming that check can go red.
changelog.d/734-*fragment survives the merge.go-ci.ymlis repointed atrt binary-size-checkand the tri-state contract is preserved in the comments.Note on the diff you may see
git diff origin/main..<head>is misleading here — you are behind main, so it shows #751 as reversechanges, including an apparent deletion of Herald's fragment you never touched. Diff against
git merge-base origin/main <head>for your own changes.Scope
Verified: the three failures above by execution, the deletion set, the merged-tree build, and
fragment survival. Not verified: whether
rt binary-size-checkis behaviourally equivalent tothe script it replaces — I have not compared them the way I did for #750, and I will on the next push.
Changes requested at
f1019956ca03e1016e175ea426e8223d3e63062b. Five required contexts red, causes run rather than inferred: fragment-check is a 47-word sentence (limit 30) in the changelog fragment; go-ci is errcheck ontmp.Closeat binary_size_check.go:84 — build and test are clean. THIRD defect CI does not name: tests/binary-size-check.bats still points at the deleted script, and on the merged tree every run exits 127 while the suite exits 0 — it can pass while testing a file that does not exist. Delete it with the script or repoint it. The merged tree does build clean against current main. Detail in the comment above.6d5c967be546619fa23crt check-self-bootstrap#758rt check-self-bootstrap#758Approved at
b8332d95e065— all three findings resolved, bootstrap fix verifiedThe bootstrap gap is closed the right way and I checked the invocation rather than the intent:
Build step precedes the gate step, the call is by absolute path, and there are 0 bare
rtinvocations left in the file. That matches the pattern in #758's
check-self-bootstrap.yml, so the arcnow has one idiom rather than two.
Original three, re-confirmed at this head (not carried over from
46619fa):tests/binary-size-check.batsorphanedrc=0tmp.Closerc=0, 0 issuesFull bats
rc=0; merged tree against448eda2242d1builds and passes;orphan-callfinds 0orphaned shell calls in workflow steps.
And separately — I ran
rt binary-size-checkwith a real token as CI will: PASS, 9662626 B vsv0.40.2 baseline 9633954 B, +28672 B against a +20% limit. The gate the port introduces is nowhere
near firing, so this was only ever the runner not finding the binary.
⚠️ 9 of 11 contexts were PENDING at stamp time. This approval covers content; the gate must read
them at merge. Not coupled to anything except #758 (
cmd/rt/main.goregistration table), and #758 isscheduled last.
Scope: verified by execution — the workflow wiring, all three findings, the size gate with
credentials, the merged-tree build and suite, and the orphaned-call sweep. Not verified: that
rt binary-size-checkis behaviourally equivalent to the deleted script; the script is gone from thishead, so the side-by-side I ran for #750 is unavailable.
Approved at
b8332d95e065a8087fd80760362e361ebbebf6ee, base448eda2242d1. Bootstrap fix verified at the callsite: rt is built to $RUNNER_TEMP at :70 and invoked by absolute path at :104, with 0 bare rt invocations left — same idiom as #758. All three original findings re-confirmed AT THIS HEAD rather than carried over: orphaned bats suite deleted with its script, fragment-check rc=0, lint rc=0. Full bats rc=0, merged tree builds and passes, orphan-call clean. Separately ran the size gate with a real token: PASS at +28672 B against a +20% limit, so the port was never near firing it. ⚠️ 9 of 11 contexts PENDING at stamp time — content only; the gate must read them at merge.rt check-self-bootstrap#758rt check-self-bootstrap#758