fix: reap superseded rc tags at publish time - #265
Merged
Merged
Conversation
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
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.
Problem
Publish-time RC-tag cleanup only deleted tags whose base exactly equaled the published version. RC tags from an earlier base that was never published were orphaned: publishing v1.0.1 left v1.0.0-rc.0 behind when the v1.0.0 lifecycle was abandoned (diverged and superseded) before it ever published. The live fleet surfaced this on rc v0.3.0-rc.25.
Fix
cleanupRCTags now reaps every RC tag whose parsed base version is at or below the published version, using cascade's internal/version semver comparator. Tags on a strictly higher base (future work) and tags with a different prefix are preserved. Hotfix-variant RC tags (-rc.N.hotfix.M) are left to hotfix-rejoin cleanup, which owns that lifecycle. A 404 on an already-deleted tag stays a no-op, so cleanup remains idempotent.
Verification
go build, go test ./... (1726 pass), golangci-lint, cascade verify (no drift), and e2e build/vet all green. New TestCleanupRCTags_ReapsSupersededBases covers the below/equal/above boundary, 404 idempotency, prefix mismatch, and hotfix-variant exclusion. schema_version unchanged; pure-Go.