Migrate tag-tidy onto the CleanPipeline seam#202
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Step 3 of #118 (2 of 5). Moves
git-tag-tidyontogit_tidy_core::clean::run_clean.decide= the existingshould_clean;actowns 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.
actreturnsOutcome::Cleanedfor the tag and pushes per-remoteFailedItems into a captured&mut Vecmerged after the run — the same tool-side pattern as repo-tidy'sdirty_blocked. Console error lines stay in tag order; only the in-memoryfailedVec order shifts (consumed solely for the exit code, never serialized).Behavior-preserving: all existing tests pass unchanged. Local CI green.
Refs #118