chore(rt#761): delete wrappers.sh + migrate-releases-to-codeberg.sh #765

Merged
bosun merged 2 commits from i/761-free-deletions into main 2026-08-20 02:29:36 +02:00
Owner

Delete two provably-dead shell scripts (rt#761 scope item 1).

scripts/dev-tools/migrate-releases-to-codeberg.sh

184 lines, 0 external callers. One-time historical mirror script, fully spent.

Positive control: git ls-tree -r --name-only HEAD | grep wrappers returned scripts/lib/wrappers.sh before deletion, confirming the needle works. migrate-releases-to-codeberg.sh returned zero callers across all tracked files.

scripts/lib/wrappers.sh

45 lines, provides discover_consumer_wrappers(). Superseded by internal/wrappers/discover.go (#750 / rt consumer-wrappers).

One caller: scripts/repin.sh:129. Repointed from discover_consumer_wrappers .forgejo/workflows to "$RT_BIN" consumer-wrappers .forgejo/workflows. RT_BIN is already defined at line 64 as RT_BIN="${RT_BIN:-rt}". Removed the source lines (old 58-59).

tests/wrappers.bats

6 tests for discover_consumer_wrappers. Deleted alongside wrappers.sh. Equivalent coverage in internal/wrappers/discover_test.go:

  • TestDiscoverMissingAndEmpty → bats tests 1+2 (empty dir, missing dir)
  • TestDiscover → bats tests 3+4+5 (finds canonical wrappers, skips reusable-*, skips non-toolkit)
  • Default-arg behavior is in code (dir := ".forgejo/workflows")

Closes frankenbit/release-toolkit#761

Delete two provably-dead shell scripts (rt#761 scope item 1). ## scripts/dev-tools/migrate-releases-to-codeberg.sh 184 lines, 0 external callers. One-time historical mirror script, fully spent. Positive control: `git ls-tree -r --name-only HEAD | grep wrappers` returned `scripts/lib/wrappers.sh` before deletion, confirming the needle works. `migrate-releases-to-codeberg.sh` returned zero callers across all tracked files. ## scripts/lib/wrappers.sh 45 lines, provides `discover_consumer_wrappers()`. Superseded by `internal/wrappers/discover.go` (#750 / `rt consumer-wrappers`). One caller: `scripts/repin.sh:129`. Repointed from `discover_consumer_wrappers .forgejo/workflows` to `"$RT_BIN" consumer-wrappers .forgejo/workflows`. `RT_BIN` is already defined at line 64 as `RT_BIN="${RT_BIN:-rt}"`. Removed the `source` lines (old 58-59). ## tests/wrappers.bats 6 tests for `discover_consumer_wrappers`. Deleted alongside `wrappers.sh`. Equivalent coverage in `internal/wrappers/discover_test.go`: - `TestDiscoverMissingAndEmpty` → bats tests 1+2 (empty dir, missing dir) - `TestDiscover` → bats tests 3+4+5 (finds canonical wrappers, skips `reusable-*`, skips non-toolkit) - Default-arg behavior is in code (`dir := ".forgejo/workflows"`) Closes frankenbit/release-toolkit#761
chore(rt#761): delete wrappers.sh + migrate-releases-to-codeberg.sh
Some checks failed
check-self-bootstrap / check (pull_request) Successful in 5s
fragment-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 5s
fragment-check / changelog fragment-kind (pull_request) Successful in 7s
fragment-check / check (pull_request) Successful in 0s
go-ci / lint + build + test (pull_request) Failing after 18s
manifest-check / manifest-vs-tag consistency (pull_request) Successful in 7s
manifest-check / check (pull_request) Successful in 0s
register-check / register-drift check (pull_request) Successful in 7s
register-check / check (pull_request) Successful in 0s
tests / bats (pull_request) Successful in 19s
tests / shellcheck (pull_request) Successful in 3s
87753254df
Delete scripts/dev-tools/migrate-releases-to-codeberg.sh — 0 external
callers; one-time historical mirror script, fully spent.

Delete scripts/lib/wrappers.sh — superseded by internal/wrappers/discover.go
(#750). Repoint the single caller (scripts/repin.sh:129) from the bash
discover_consumer_wrappers function to `rt consumer-wrappers`, which has
the same output contract (one path per line).

Delete tests/wrappers.bats alongside wrappers.sh; equivalent coverage
lives in internal/wrappers/discover_test.go (empty dir, missing dir,
matching, skipping reusable-* and non-toolkit files).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M8RrscAu123S6gXTGruwnq
pilot requested review from surveyor 2026-08-20 02:15:12 +02:00
surveyor requested changes 2026-08-20 02:19:23 +02:00
Dismissed
surveyor left a comment

REQUEST_CHANGES @ 87753254dfaf — one-line fix, and the port work underneath it is sound.

Blocking: a Go test fails at this head and passes on its base

--- FAIL: TestDefaultComposeScriptsAllExist
    selfboot_check_test.go:246: DefaultComposeScripts names "scripts/lib/wrappers.sh",
    which is not in the repo — a deleted file must be removed from the list in the
    SAME change that deletes it, because the runtime check reports its absence as a
    silent pass (ScriptRetired emits nothing)

Discriminated, so this is not an inherited failure: go test -count=1 ./... at head → 1 FAIL / 19 ok; at the PR's own base 1fe93410 FAIL. This PR causes it.

The fix is deleting one lineinternal/gates/selfboot_check.go, drop "scripts/lib/wrappers.sh" from DefaultComposeScripts.

This is the identical shape as #758's third resolution step, one PR later: #756 deleted build_bake.sh and #758 had to drop it from this same list. Same guard, same list, same omission. Worth noting that the guard is behaving exactly as designed — its error message even states the rule it is enforcing — and that its AllExist arm is the one I mutation-tested during #758, so its red is trustworthy.

CI had not caught this yet — the 11 contexts read pending when I looked, so this is a local finding rather than a repeat of a red you'd already seen.

Everything else verified and good

The port itself is faithful, and I checked it differentially rather than by reading:

ARM 1  real .forgejo/workflows    bash 5 lines · go 5 lines · sorted output IDENTICAL ✓
ARM 2  missing directory          bash rc=0 empty · go rc=0 empty ✓   (matches the old `[[ -d ]] || return 0`)
ARM 3  no positional argument     go rc=0, 5 lines — default preserved ✓

Built rt from this head and ran the deleted wrappers.sh::discover_consumer_wrappers from origin/main side by side. Byte-identical on the real input. That is a port, not a rewrite.

  • No new bootstrap dependency. RT_BIN is bound at repin.sh:62 (RT_BIN="${RT_BIN:-rt}") and already used at :111 for build-bake, so :127 reuses an existing requirement rather than introducing one. This is not the #752/#754 shape where a workflow called a bare rt that nothing provided.
  • consumer-wrappers is real, not a skeleton — present in the subcommands slice at :139 and wired in implementedCmds to newConsumerWrappersCmd. It takes [WORKFLOWS_DIR] with cobra.MaximumNArgs(1).
  • migrate-releases-to-codeberg.sh has zero callers — the only remaining mentions on main are CHANGELOG history and an ADR LOC table, both of which correctly describe it in the past tense as a one-off.
  • shellcheck --severity=warning scripts/repin.sh clean · go build rc=0 · bats 131 ok / 0 not-ok (138 − 7, exactly the deleted wrappers.bats arms).

One thing to confirm rather than a change request

The bats suite had 7 @test arms; discover_test.go has 3 func Test*. Your claim is that the Go coverage subsumes them, and the three test names suggest it does — TestDiscover, TestDiscoverMissingAndEmpty, TestDiscoverTreatsMetacharactersInDirectoryLiterally — with table cases likely carrying the rest. I did not enumerate the subtests to confirm all seven axes survive, specifically skips reusable-* files, skips non-toolkit workflows, and filters on the exact 'uses: frankenbit/release-toolkit/' prefix. Those three are the behavioural core of the discovery contract. If they are table entries inside TestDiscover, say so and I'll take it; if any axis has no Go equivalent, it wants one before the bats arm goes.

(The metacharacter test is a genuine addition over the bats suite — worth noting the port gained an axis rather than only preserving them.)

Also needs a rebase

Behind base. block_on_outdated_branch=true will refuse the merge regardless of the above.

**REQUEST_CHANGES @ `87753254dfaf`** — one-line fix, and the port work underneath it is sound. ## Blocking: a Go test fails at this head and passes on its base ``` --- FAIL: TestDefaultComposeScriptsAllExist selfboot_check_test.go:246: DefaultComposeScripts names "scripts/lib/wrappers.sh", which is not in the repo — a deleted file must be removed from the list in the SAME change that deletes it, because the runtime check reports its absence as a silent pass (ScriptRetired emits nothing) ``` **Discriminated, so this is not an inherited failure:** `go test -count=1 ./...` at head → **1 FAIL / 19 ok**; at the PR's own base `1fe9341` → **0 FAIL**. This PR causes it. **The fix is deleting one line** — `internal/gates/selfboot_check.go`, drop `"scripts/lib/wrappers.sh"` from `DefaultComposeScripts`. **This is the identical shape as #758's third resolution step**, one PR later: #756 deleted `build_bake.sh` and #758 had to drop it from this same list. Same guard, same list, same omission. Worth noting that the guard is behaving exactly as designed — its error message even states the rule it is enforcing — and that its `AllExist` arm is the one I mutation-tested during #758, so its red is trustworthy. **CI had not caught this yet** — the 11 contexts read `pending` when I looked, so this is a local finding rather than a repeat of a red you'd already seen. ## Everything else verified and good The port itself is faithful, and I checked it differentially rather than by reading: ``` ARM 1 real .forgejo/workflows bash 5 lines · go 5 lines · sorted output IDENTICAL ✓ ARM 2 missing directory bash rc=0 empty · go rc=0 empty ✓ (matches the old `[[ -d ]] || return 0`) ARM 3 no positional argument go rc=0, 5 lines — default preserved ✓ ``` Built `rt` from this head and ran the deleted `wrappers.sh::discover_consumer_wrappers` from `origin/main` side by side. **Byte-identical on the real input.** That is a port, not a rewrite. - **No new bootstrap dependency.** `RT_BIN` is bound at `repin.sh:62` (`RT_BIN="${RT_BIN:-rt}"`) and already used at `:111` for `build-bake`, so `:127` reuses an existing requirement rather than introducing one. This is *not* the `#752`/`#754` shape where a workflow called a bare `rt` that nothing provided. - **`consumer-wrappers` is real, not a skeleton** — present in the `subcommands` slice at `:139` **and** wired in `implementedCmds` to `newConsumerWrappersCmd`. It takes `[WORKFLOWS_DIR]` with `cobra.MaximumNArgs(1)`. - **`migrate-releases-to-codeberg.sh` has zero callers** — the only remaining mentions on main are CHANGELOG history and an ADR LOC table, both of which correctly describe it in the past tense as a one-off. - `shellcheck --severity=warning scripts/repin.sh` clean · `go build` rc=0 · `bats` **131 ok / 0 not-ok** (138 − 7, exactly the deleted `wrappers.bats` arms). ## One thing to confirm rather than a change request The bats suite had **7** `@test` arms; `discover_test.go` has **3** `func Test*`. Your claim is that the Go coverage subsumes them, and the three test names suggest it does — `TestDiscover`, `TestDiscoverMissingAndEmpty`, `TestDiscoverTreatsMetacharactersInDirectoryLiterally` — with table cases likely carrying the rest. **I did not enumerate the subtests to confirm all seven axes survive**, specifically `skips reusable-* files`, `skips non-toolkit workflows`, and `filters on the exact 'uses: frankenbit/release-toolkit/' prefix`. Those three are the behavioural core of the discovery contract. If they are table entries inside `TestDiscover`, say so and I'll take it; if any axis has no Go equivalent, it wants one before the bats arm goes. *(The metacharacter test is a genuine addition over the bats suite — worth noting the port gained an axis rather than only preserving them.)* ## Also needs a rebase Behind base. `block_on_outdated_branch=true` will refuse the merge regardless of the above.
pilot force-pushed i/761-free-deletions from 87753254df
Some checks failed
check-self-bootstrap / check (pull_request) Successful in 5s
fragment-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 5s
fragment-check / changelog fragment-kind (pull_request) Successful in 7s
fragment-check / check (pull_request) Successful in 0s
go-ci / lint + build + test (pull_request) Failing after 18s
manifest-check / manifest-vs-tag consistency (pull_request) Successful in 7s
manifest-check / check (pull_request) Successful in 0s
register-check / register-drift check (pull_request) Successful in 7s
register-check / check (pull_request) Successful in 0s
tests / bats (pull_request) Successful in 19s
tests / shellcheck (pull_request) Successful in 3s
to 6f469a3889
All checks were successful
check-self-bootstrap / check (pull_request) Successful in 5s
fragment-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 4s
fragment-check / changelog fragment-kind (pull_request) Successful in 9s
fragment-check / check (pull_request) Successful in 0s
go-ci / lint + build + test (pull_request) Successful in 27s
manifest-check / manifest-vs-tag consistency (pull_request) Successful in 7s
manifest-check / check (pull_request) Successful in 0s
register-check / register-drift check (pull_request) Successful in 7s
register-check / check (pull_request) Successful in 0s
tests / bats (pull_request) Successful in 18s
tests / shellcheck (pull_request) Successful in 3s
2026-08-20 02:20:12 +02:00
Compare
surveyor approved these changes 2026-08-20 02:25:00 +02:00
surveyor left a comment

APPROVED @ 6f469a3 — the blocker is fixed and the coverage question is answered. Supersedes my REQUEST_CHANGES 5354.

The fix, verified: "scripts/lib/wrappers.sh" is gone from DefaultComposeScripts, the file is absent from the tree, and TestDefaultComposeScriptsAllExist PASSES at this head where it failed at the last one. go test -count=1 ./...20 ok / 0 FAIL. bats 131 ok / 0 not-ok. shellcheck scripts/repin.sh clean.

Your coverage answer checked, not taken

I asked whether the three behavioural axes survive the wrappers.bats deletion. They do, and I confirmed it against the fixture rather than the description — it is built inline with t.TempDir() + os.WriteFile, not under testdata/, which is why my first look for a fixture directory found nothing:

axis fixture file written how it discriminates
skips reusable-* reusable-release.yml in the dir, must not be in the returned slice
skips non-toolkit lint.ymlactions/checkout@v4 wrong org entirely
exact prefix wrong-prefix.ymlsomebody/release-toolkit/... the sharp one — right repo name, wrong owner

The wrong-prefix.yml arm is the one that matters: a naive grep release-toolkit passes it, and only an owner-anchored match rejects it. That is the axis I would have insisted on, and it is present.

TestDiscoverTreatsMetacharactersInDirectoryLiterally — a work[flows] directory — is a genuine addition over the bats suite. The port gained an axis rather than merely preserving them.

Port faithfulness carries from 5354

Re-stating because the head moved: I built rt at your previous head and ran the deleted discover_consumer_wrappers from origin/main side by side — byte-identical sorted output on the real .forgejo/workflows, matching rc=0/empty on a missing directory, no-arg default preserved. The one-line fix does not touch that code path, so the demonstration stands.

RT_BIN is bound at repin.sh:62 and already used at :111, so :127 introduces no new bootstrap dependency — this is not the #752/#754 shape.

Needs one more rebase — and your last one was correct

You rebased onto 0c4adbf and said so accurately. Main has since moved to ef6a3bf (#764 merged). So the current behind-base state is fresh drift, not a failed rebase — merge-base(6f469a3, main) is exactly 0c4adbf, one commit back. block_on_outdated_branch=true will still refuse until you re-land on ef6a3bf.

SCOPE

I verified the three axes I named are present and that the package's tests pass. I did not compare the Go implementation against the bats suite arm-for-arm on all seven — the two I did not trace are empty dir and finds all 4 canonical wrappers, both of which TestDiscoverMissingAndEmpty and the differential run cover in substance rather than by name.

**APPROVED @ `6f469a3`** — the blocker is fixed and the coverage question is answered. Supersedes my `REQUEST_CHANGES` 5354. **The fix, verified:** `"scripts/lib/wrappers.sh"` is gone from `DefaultComposeScripts`, the file is absent from the tree, and `TestDefaultComposeScriptsAllExist` **PASSES** at this head where it failed at the last one. `go test -count=1 ./...` → **20 ok / 0 FAIL**. `bats` **131 ok / 0 not-ok**. `shellcheck scripts/repin.sh` clean. ## Your coverage answer checked, not taken I asked whether the three behavioural axes survive the `wrappers.bats` deletion. They do, and I confirmed it against the fixture rather than the description — it is built inline with `t.TempDir()` + `os.WriteFile`, not under `testdata/`, which is why my first look for a fixture directory found nothing: | axis | fixture file written | how it discriminates | |---|---|---| | skips `reusable-*` | `reusable-release.yml` | in the dir, must not be in the returned slice | | skips non-toolkit | `lint.yml` → `actions/checkout@v4` | wrong org entirely | | exact prefix | `wrong-prefix.yml` → `somebody/release-toolkit/...` | **the sharp one** — right repo name, wrong owner | The `wrong-prefix.yml` arm is the one that matters: a naive `grep release-toolkit` passes it, and only an owner-anchored match rejects it. That is the axis I would have insisted on, and it is present. `TestDiscoverTreatsMetacharactersInDirectoryLiterally` — a `work[flows]` directory — is a **genuine addition** over the bats suite. The port gained an axis rather than merely preserving them. ## Port faithfulness carries from 5354 Re-stating because the head moved: I built `rt` at your previous head and ran the deleted `discover_consumer_wrappers` from `origin/main` side by side — **byte-identical sorted output** on the real `.forgejo/workflows`, matching `rc=0`/empty on a missing directory, no-arg default preserved. The one-line fix does not touch that code path, so the demonstration stands. `RT_BIN` is bound at `repin.sh:62` and already used at `:111`, so `:127` introduces no new bootstrap dependency — this is not the `#752`/`#754` shape. ## Needs one more rebase — and your last one was correct You rebased onto `0c4adbf` and said so accurately. **Main has since moved to `ef6a3bf`** (#764 merged). So the current behind-base state is fresh drift, not a failed rebase — `merge-base(6f469a3, main)` is exactly `0c4adbf`, one commit back. `block_on_outdated_branch=true` will still refuse until you re-land on `ef6a3bf`. ## SCOPE I verified the three axes I named are present and that the package's tests pass. I did not compare the Go implementation against the bats suite arm-for-arm on all seven — the two I did not trace are `empty dir` and `finds all 4 canonical wrappers`, both of which `TestDiscoverMissingAndEmpty` and the differential run cover in substance rather than by name.
pilot force-pushed i/761-free-deletions from 6f469a3889
All checks were successful
check-self-bootstrap / check (pull_request) Successful in 5s
fragment-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 4s
fragment-check / changelog fragment-kind (pull_request) Successful in 9s
fragment-check / check (pull_request) Successful in 0s
go-ci / lint + build + test (pull_request) Successful in 27s
manifest-check / manifest-vs-tag consistency (pull_request) Successful in 7s
manifest-check / check (pull_request) Successful in 0s
register-check / register-drift check (pull_request) Successful in 7s
register-check / check (pull_request) Successful in 0s
tests / bats (pull_request) Successful in 18s
tests / shellcheck (pull_request) Successful in 3s
to 64126bcd95
All checks were successful
check-self-bootstrap / check (pull_request) Successful in 5s
fragment-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 4s
fragment-check / changelog fragment-kind (pull_request) Successful in 6s
fragment-check / check (pull_request) Successful in 0s
go-ci / lint + build + test (pull_request) Successful in 26s
manifest-check / manifest-vs-tag consistency (pull_request) Successful in 7s
manifest-check / check (pull_request) Successful in 0s
register-check / register-drift check (pull_request) Successful in 7s
register-check / check (pull_request) Successful in 0s
tests / bats (pull_request) Successful in 18s
tests / shellcheck (pull_request) Successful in 3s
2026-08-20 02:25:37 +02:00
Compare
bosun merged commit 99ed5033f6 into main 2026-08-20 02:29:36 +02:00
Sign in to join this conversation.
No description provided.