Skip to content

Migrate tag-tidy onto the CleanPipeline seam#202

Merged
jakebromberg merged 1 commit into
mainfrom
migrate/clean-tag
Jun 22, 2026
Merged

Migrate tag-tidy onto the CleanPipeline seam#202
jakebromberg merged 1 commit into
mainfrom
migrate/clean-tag

Conversation

@jakebromberg

Copy link
Copy Markdown
Owner

Step 3 of #118 (2 of 5). Moves git-tag-tidy onto git_tidy_core::clean::run_clean. decide = the existing should_clean; act owns release-tag protection (a printed skip), dry-run wording, local delete, and the remote fan-out. Per-group calls; CleanResult<RemovedRef> unchanged.

The remote fan-out is the case the seam's mapping doc calls out: one tag can be deleted from several remotes, any of which can fail while the tag is still recorded removed. act returns Outcome::Cleaned for the tag and pushes per-remote FailedItems into a captured &mut Vec merged after the run — the same tool-side pattern as repo-tidy's dirty_blocked. Console error lines stay in tag order; only the in-memory failed Vec order shifts (consumed solely for the exit code, never serialized).

Behavior-preserving: all existing tests pass unchanged. Local CI green.

Refs #118

Rewrite git-tag-tidy's hand-rolled clean loop in terms of the shared git_tidy_core::clean::run_clean seam (issue #118 step 3). The pure classification filter (the existing should_clean: stale_only -> Stale, local_only -> LocalOnly, all -> != Synced, default -> Stale|LocalOnly) becomes the silent decide predicate, and everything tool-specific — release-tag protection (a printed skip), dry-run wording, the local tag delete, the remote fan-out, and the success record — moves into the act closure. Wording, dry-run behavior, and the public CleanResult<RemovedRef> signature and return type are unchanged.

tag-tidy groups tags per repo, so run_clean is invoked once per RepoGroup (its name/repo_path drive the human wording) and the per-group succeeded/failed/skipped results are accumulated into one CleanResult.

The remote fan-out is the awkward case the seam's mapping doc calls out: a single tag can be deleted from several remotes, and an individual remote can fail while the tag is still recorded as removed, so one Outcome cannot carry both the success record and the per-remote failures. Following the doc, act pushes each failed remote into a &mut Vec<FailedItem> declared in run_clean before the per-group calls and still returns Outcome::Cleaned for the tag; after every per-group call those captured fan-out failures are merged into the overall failed set — the same tool-side accumulation pattern repo-tidy uses for dirty_blocked. The local-delete-failure path remains a single Outcome::Failed for the tag.

Refs #118
@jakebromberg jakebromberg merged commit fe86303 into main Jun 22, 2026
3 checks passed
@jakebromberg jakebromberg deleted the migrate/clean-tag branch June 22, 2026 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant