fix(prune): give squash-merged remote twins their own result class and heading, drop the dead skipRemotes guard (#449) #476

Merged
hexajon merged 1 commit from issue-449-prune-is-still-inconsistent-and-broken into main 2026-09-09 22:17:19 +00:00
Owner

Summary

Closes #449. The real breakage (six spurious "API error 500" lines on already-gone remote refs) was fixed in PR #462: deleteRemoteBranch classifies the forge's does-not-exist 500 as already-gone (internal/service/prune/run.go, pinned by the run_test.go already-gone cases). This finishes the two items decided on 2026-09-08.

  1. Display: squash-merged remote twins are their own class. PruneResult gains DeletedSquashMergedRemote and DeletedSquashMergedRemoteBranches (deleted_squash_merged_remote, deleted_squash_merged_remote_branches in JSON, additive). Run no longer appends squash twins to DeletedRemoteBranches or adds them to DeletedRemote. The text formatter renders a new heading, "Deleted squash-merged remote branch(es) (content already in )", so each deleted name appears under exactly one heading. The "Deleted N remote branch(es)" trailer now sums ancestry twins, orphans, and squash twins, so the total is unchanged. This reverses the 2026-07-10 fold; ADR 0008 carries a dated amendment and a Status touch.

  2. The skipRemotes guard is removed from deleteSquashMerged and Run. The ancestry candidates and the squash-merged set are disjoint by construction (findSquashMerged excludes ancestry-merged branches), so the guard had no live path. TestPruneSquashAndAncestrySetsDisjoint pins that fact in place of the removed guard test.

Tests: TestDeletedNamesAllAppearInOutput now asserts the new heading, that a squash twin is absent from the ancestry remote block, and the summed trailer. Prune service, formatter, and cmdutil packages pass; ./scripts/gate.sh full run passes (all 18 checks). Reference docs regenerated with no diff.

Closes #449

## Summary Closes #449. The real breakage (six spurious "API error 500" lines on already-gone remote refs) was fixed in PR #462: `deleteRemoteBranch` classifies the forge's does-not-exist 500 as already-gone (`internal/service/prune/run.go`, pinned by the run_test.go already-gone cases). This finishes the two items decided on 2026-09-08. 1. Display: squash-merged remote twins are their own class. `PruneResult` gains `DeletedSquashMergedRemote` and `DeletedSquashMergedRemoteBranches` (`deleted_squash_merged_remote`, `deleted_squash_merged_remote_branches` in JSON, additive). `Run` no longer appends squash twins to `DeletedRemoteBranches` or adds them to `DeletedRemote`. The text formatter renders a new heading, "Deleted squash-merged remote branch(es) (content already in <default>)", so each deleted name appears under exactly one heading. The "Deleted N remote branch(es)" trailer now sums ancestry twins, orphans, and squash twins, so the total is unchanged. This reverses the 2026-07-10 fold; ADR 0008 carries a dated amendment and a Status touch. 2. The `skipRemotes` guard is removed from `deleteSquashMerged` and `Run`. The ancestry candidates and the squash-merged set are disjoint by construction (`findSquashMerged` excludes ancestry-merged branches), so the guard had no live path. `TestPruneSquashAndAncestrySetsDisjoint` pins that fact in place of the removed guard test. Tests: `TestDeletedNamesAllAppearInOutput` now asserts the new heading, that a squash twin is absent from the ancestry remote block, and the summed trailer. Prune service, formatter, and cmdutil packages pass; `./scripts/gate.sh` full run passes (all 18 checks). Reference docs regenerated with no diff. Closes #449
fix(prune): give squash-merged remote twins their own result class and heading, drop the dead skipRemotes guard (#449)
All checks were successful
ci / mcp-conformance (pull_request) Successful in 2m6s
drift / govulncheck (pull_request) Has been skipped
drift / forgejo-smoke (pull_request) Has been skipped
drift / surface-diff (pull_request) Successful in 1m4s
ci / mcp-conformance (push) Successful in 3s
drift / govulncheck (push) Has been skipped
drift / surface-diff (push) Successful in -3s
drift / forgejo-smoke (push) Has been skipped
ci / gate (pull_request) Successful in 29m27s
ci / gate (push) Successful in 13m56s
96971c3f57
Closes #449
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sixfold-space/madtea!476
No description provided.