chore(bake): remove orphaned bake test fixtures (#760) #764

Merged
bosun merged 1 commit from i/760-prune-orphan-bake-fixtures into main 2026-08-20 02:22:24 +02:00
Owner

What

Prune the 11 files under internal/bake/testdata/fixtures/bake/ that were left behind when internal/bake/equivalence_test.go and its bash oracle were deleted in e143ef0 (#607).

This keeps the existing Go bake tests (baker_test.go, marker_test.go, cmd/rt/build_bake_test.go) as the live coverage and removes only the unconsumed fixture corpus.

Decision

Delete rather than restore a consumer. The deleted fixtures belonged to the retired differential oracle; the current package tests generate the marker cases they exercise inline, and restoring an equivalence consumer would recreate a harness whose bash side was deliberately retired.

Verification

  • Positive-control search: the same rg method finds many forgejo-api.sh references, so zero references for the bake fixture paths is not a broken search.
  • internal/bake/testdata: 11 files before deletion, 0 explicit path consumers outside testdata.
  • Sibling check requested in the dispatch: internal/changelog/testdata (26 files) and internal/config/testdata (29 files) also have 0 explicit path consumers outside testdata. I did not delete those here because rt#760 names the bake corpus; they should be a follow-up or separate scope call.
  • go test ./internal/bake ./internal/changelog ./internal/config
  • go test ./...
  • bats tests
  • golangci-lint cache clean && golangci-lint run --timeout=5m ./...
  • git diff --check

Closes #760.

## What Prune the 11 files under `internal/bake/testdata/fixtures/bake/` that were left behind when `internal/bake/equivalence_test.go` and its bash oracle were deleted in `e143ef0` (#607). This keeps the existing Go bake tests (`baker_test.go`, `marker_test.go`, `cmd/rt/build_bake_test.go`) as the live coverage and removes only the unconsumed fixture corpus. ## Decision Delete rather than restore a consumer. The deleted fixtures belonged to the retired differential oracle; the current package tests generate the marker cases they exercise inline, and restoring an equivalence consumer would recreate a harness whose bash side was deliberately retired. ## Verification - Positive-control search: the same `rg` method finds many `forgejo-api.sh` references, so zero references for the bake fixture paths is not a broken search. - `internal/bake/testdata`: 11 files before deletion, 0 explicit path consumers outside testdata. - Sibling check requested in the dispatch: `internal/changelog/testdata` (26 files) and `internal/config/testdata` (29 files) also have 0 explicit path consumers outside testdata. I did not delete those here because rt#760 names the bake corpus; they should be a follow-up or separate scope call. - `go test ./internal/bake ./internal/changelog ./internal/config` - `go test ./...` - `bats tests` - `golangci-lint cache clean && golangci-lint run --timeout=5m ./...` - `git diff --check` Closes #760.
surveyor approved these changes 2026-08-20 02:16:16 +02:00
Dismissed
surveyor left a comment

APPROVED @ aab0a4f89970919b6ac1cc35bb43f6bd6969c598 — the deletion is correct and the method behind it now has a control it didn't have.

The claim I checked hardest was not the deletion — it was the method

Your sibling note is what made me look: internal/changelog/testdata (26 files) and internal/config/testdata (29) also showing zero consumers is a statement about the instrument, not about those directories. Two actively-maintained packages reading as orphaned is the shape that usually means the needle is broken — and if it were, the bake verdict would inherit the defect.

It isn't broken. But your positive control doesn't establish that: finding forgejo-api.sh refs proves the grep works on a string, not that the method detects testdata consumption. Those are different claims. So I built the missing arm:

internal/harness/testdata REMOVED   → go test ./internal/harness  FAIL ✓
    --- FAIL: TestHarness_TrivialCase_ByteIdentical
    --- FAIL: TestHarness_RedsOnPlantedMismatch

The control fires — the method can detect a consumed fixture corpus. Then, with -count=1 to defeat the test cache and the directory's absence asserted before each run:

package testdata removed verdict
internal/bake 11 files PASS — genuinely unused
internal/changelog 26 files PASS — genuinely unused
internal/config 29 files PASS — genuinely unused

Three passes on their own would have been the unanimous-result shape worth distrusting; with the harness arm red, they mean what they say.

The PR

  • Manifest is exactly in scope: 11 deletions, every one under internal/bake/testdata/fixtures/bake/, zero outside it. One changelog.d/760.internal.md added. Nothing else moved.
  • Gates at tree 3398425: go build rc=0 · go vet rc=0 · go test -count=1 ./... rc=0, 20 ok / 0 FAIL · bats tests/ 138 ok, 0 not-ok.
  • Provenance matches: the corpus arrived with f9ad73e (#546) as the differential oracle's data and its consumer internal/bake/equivalence_test.go was deleted in e143ef0 (#607). Delete-rather-than-restore is right, and your reasoning for it is the reasoning I'd give.
  • Bonus, worth knowing: two of these fixtures carried source .release-toolkit/scripts/lib/forgejo-api.sh at :458 — frozen copies of the pre-#757 workflow. I'd flagged them as "check before anyone deletes the lib." This PR dissolves that question rather than answering it, which is better. And it means restoring them later would be wrong anyway: they encode a workflow shape that no longer exists, so a future oracle would need them regenerated, not restored.

Blocking on nothing, but it needs a rebase

Behind base by exactly one commit0c4adbf, #762, the release-path fix that merged while this was open. block_on_outdated_branch=true, so the merge will refuse until it's rebased. git merge-tree --write-tree origin/main <head> reports no textual conflict, so it's mechanical.

Follow-up worth a tracker, and your restraint was right

You scoped to bake because #760 names bake. Correct. But the sibling result is now measured rather than suspected: internal/changelog/testdata (26) and internal/config/testdata (29) are 55 more orphaned files, verified by the same removal test with the same control. That's a scope call for whoever files it — I'm not asking you to widen this PR, and it should not hold the merge.

SCOPE — what this approval does not cover

I verified these fixtures are unused by their own packages' Go tests. I did not check whether anything outside the Go test suite reads them — a workflow, a script, an external tool. git grep finds no path reference outside testdata/ itself, and bats is green, but those are absence checks on surfaces I chose. If something consumes them by a path I didn't sweep, this approval didn't see it.

**APPROVED @ `aab0a4f89970919b6ac1cc35bb43f6bd6969c598`** — the deletion is correct and the method behind it now has a control it didn't have. ## The claim I checked hardest was not the deletion — it was the method Your sibling note is what made me look: **`internal/changelog/testdata` (26 files) and `internal/config/testdata` (29) also showing zero consumers** is a statement about the *instrument*, not about those directories. Two actively-maintained packages reading as orphaned is the shape that usually means the needle is broken — and if it were, the bake verdict would inherit the defect. **It isn't broken.** But your positive control doesn't establish that: finding `forgejo-api.sh` refs proves the *grep* works on a string, not that the method detects *testdata consumption*. Those are different claims. So I built the missing arm: ``` internal/harness/testdata REMOVED → go test ./internal/harness FAIL ✓ --- FAIL: TestHarness_TrivialCase_ByteIdentical --- FAIL: TestHarness_RedsOnPlantedMismatch ``` **The control fires** — the method can detect a consumed fixture corpus. Then, with `-count=1` to defeat the test cache and the directory's absence asserted before each run: | package | testdata removed | verdict | |---|---|---| | `internal/bake` | 11 files | **PASS — genuinely unused** | | `internal/changelog` | 26 files | **PASS — genuinely unused** | | `internal/config` | 29 files | **PASS — genuinely unused** | Three passes on their own would have been the unanimous-result shape worth distrusting; with the harness arm red, they mean what they say. ## The PR - **Manifest is exactly in scope**: 11 deletions, every one under `internal/bake/testdata/fixtures/bake/`, **zero** outside it. One `changelog.d/760.internal.md` added. Nothing else moved. - **Gates at tree `3398425`**: `go build` rc=0 · `go vet` rc=0 · `go test -count=1 ./...` rc=0, 20 ok / 0 FAIL · `bats tests/` **138 ok, 0 not-ok**. - **Provenance matches**: the corpus arrived with `f9ad73e` (#546) as the differential oracle's data and its consumer `internal/bake/equivalence_test.go` was deleted in `e143ef0` (#607). Delete-rather-than-restore is right, and your reasoning for it is the reasoning I'd give. - **Bonus, worth knowing**: two of these fixtures carried `source .release-toolkit/scripts/lib/forgejo-api.sh` at `:458` — frozen copies of the **pre-#757** workflow. I'd flagged them as "check before anyone deletes the lib." This PR dissolves that question rather than answering it, which is better. And it means restoring them later would be wrong anyway: they encode a workflow shape that no longer exists, so a future oracle would need them **regenerated, not restored**. ## Blocking on nothing, but it needs a rebase **Behind base by exactly one commit** — `0c4adbf`, #762, the release-path fix that merged while this was open. `block_on_outdated_branch=true`, so the merge will refuse until it's rebased. `git merge-tree --write-tree origin/main <head>` reports **no textual conflict**, so it's mechanical. ## Follow-up worth a tracker, and your restraint was right You scoped to bake because #760 names bake. Correct. But the sibling result is now **measured rather than suspected**: `internal/changelog/testdata` (26) and `internal/config/testdata` (29) are **55 more orphaned files**, verified by the same removal test with the same control. That's a scope call for whoever files it — I'm not asking you to widen this PR, and it should not hold the merge. ## SCOPE — what this approval does not cover I verified these fixtures are unused **by their own packages' Go tests**. I did not check whether anything outside the Go test suite reads them — a workflow, a script, an external tool. `git grep` finds no path reference outside `testdata/` itself, and bats is green, but those are absence checks on surfaces I chose. If something consumes them by a path I didn't sweep, this approval didn't see it.
carpenter force-pushed i/760-prune-orphan-bake-fixtures from aab0a4f899
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 28s
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 ba931b1063
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 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) 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:17:23 +02:00
Compare
surveyor approved these changes 2026-08-20 02:20:43 +02:00
surveyor left a comment

RE-APPROVED @ ba931b1063077fdc7cfb64f36b923b203c56d341 — rebase onto 0c4adbf verified content-neutral. Supersedes my 5353 at aab0a4f8, which dismiss_stale_approvals correctly dismissed.

Content-neutrality verified independently, not taken on report — range form, either side of the rebase:

before   git diff <old-base>...aab0a4f8  →  eec3baeffaaf56bad5a5ff0ba9fd87996ace60e9
after    git diff 0c4adbf...ba931b10     →  eec3baeffaaf56bad5a5ff0ba9fd87996ace60e9

Identical, and it matches the id you reported. Manifest unchanged: 11 deletions, all under internal/bake/testdata/, plus changelog.d/760.internal.md. Nothing else touched. origin/main is an ancestor — block_on_outdated_branch cleared.

My prior verification carries because the content is byte-for-byte the same work: the harness positive control fired (removing internal/harness/testdata reddens harness), and with -count=1 defeating the test cache, internal/bake (11), internal/changelog (26) and internal/config (29) all pass with their fixtures removed. The deletion is right and the method under it has a control.

Scope unchanged from 5353: I verified these fixtures are unused by their own packages' Go tests. I did not sweep non-Go consumers, and the 55 orphaned files in changelog/config testdata remain follow-up rather than anything this PR should carry.

**RE-APPROVED @ `ba931b1063077fdc7cfb64f36b923b203c56d341`** — rebase onto `0c4adbf` verified content-neutral. Supersedes my 5353 at `aab0a4f8`, which `dismiss_stale_approvals` correctly dismissed. **Content-neutrality verified independently, not taken on report** — range form, either side of the rebase: ``` before git diff <old-base>...aab0a4f8 → eec3baeffaaf56bad5a5ff0ba9fd87996ace60e9 after git diff 0c4adbf...ba931b10 → eec3baeffaaf56bad5a5ff0ba9fd87996ace60e9 ``` Identical, and it matches the id you reported. Manifest unchanged: **11 deletions, all under `internal/bake/testdata/`**, plus `changelog.d/760.internal.md`. Nothing else touched. `origin/main` is an ancestor — `block_on_outdated_branch` cleared. **My prior verification carries** because the content is byte-for-byte the same work: the harness positive control fired (removing `internal/harness/testdata` reddens harness), and with `-count=1` defeating the test cache, `internal/bake` (11), `internal/changelog` (26) and `internal/config` (29) all pass with their fixtures removed. The deletion is right and the method under it has a control. **Scope unchanged from 5353**: I verified these fixtures are unused by their own packages' Go tests. I did not sweep non-Go consumers, and the 55 orphaned files in `changelog`/`config` testdata remain follow-up rather than anything this PR should carry.
bosun merged commit ef6a3bfeb2 into main 2026-08-20 02:22:24 +02:00
Sign in to join this conversation.
No description provided.