feat(release): reap rc tags per component using the tag grammar - #521
Merged
Merged
Conversation
The release rc-tag reaper matched rc tags with a hardcoded -rc. pattern and a permissive prefix, so it never reaped a custom tag grammar (those tags accumulated forever) and its superseded-base sweep could enumerate a sibling component's tags. The reaper now takes an optional component tag grammar (threaded via manage-release --component and a WithTagGrammar option on the manager): candidates are parsed through the component's strict spec, so a sibling's tags never parse and are never enumerated, and a custom pre-release token is matched from the grammar rather than a literal -rc. The superseded-base comparison runs only on candidates already parsed under the component spec, so it cannot cross into another namespace. The draft reaper routes through the same grammar-aware parse for consistency. With no component grammar the reaper is behavior-identical to before. Refs #295. 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
The release rc-tag reaper (
internal/release/release.go) matched rc tags with a hardcoded-rc.pattern and a permissive prefix. So it never reaped a customtag_grammar(those rc tags accumulated forever), and its superseded-base sweep could enumerate a sibling component's tags.Fix
manage-release --component <name> --config <path>and aWithTagGrammaroption on the manager (derived from the resolved component's stricttaggrammar.Spec).-rc..Verification
go build ./...,go test ./...(2603 pass),go test ./... -raceclean,golangci-lint run ./...clean; single-component byte-identical baseline gate green. Tests prove per-namespace isolation (a component's reaper leaves a sibling's rc tags, including a custom-token tag, untouched), custom-grammar reaping (the accumulation bug), and that the no-grammar path matches the prior reaper exactly. The e2e harness reaper is already grammar-aware and untouched; live reaping is validated by the fleet at the release gate.Refs #295.