Skip to content

feat(release): reap rc tags per component using the tag grammar - #521

Merged
joshua-temple merged 1 commit into
mainfrom
feat/reaper-component-grammar
Jul 8, 2026
Merged

joshua-temple merged 1 commit into
mainfrom
feat/reaper-component-grammar

Conversation

@joshua-temple

Copy link
Copy Markdown
Collaborator

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 custom tag_grammar (those rc tags accumulated forever), and its superseded-base sweep could enumerate a sibling component's tags.

Fix

  • The reaper takes an optional component tag grammar, threaded via manage-release --component <name> --config <path> and a WithTagGrammar option on the manager (derived from the resolved component's strict taggrammar.Spec).
  • Candidates are parsed through the component's strict spec: a sibling's tags never parse, so they are never enumerated; a custom pre-release token is matched from the grammar, not 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.

Verification

go build ./..., go test ./... (2603 pass), go test ./... -race clean, 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.

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>
@joshua-temple
joshua-temple merged commit 9533bc2 into main Jul 8, 2026
20 checks passed
@joshua-temple
joshua-temple deleted the feat/reaper-component-grammar branch July 8, 2026 08:20
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