Skip to content

fix(version): ignore non-version tags in latest-tag discovery#382

Merged
joshua-temple merged 1 commit into
mainfrom
fix/version-discovery-ignores-nonversion-tags
Jun 26, 2026
Merged

fix(version): ignore non-version tags in latest-tag discovery#382
joshua-temple merged 1 commit into
mainfrom
fix/version-discovery-ignores-nonversion-tags

Conversation

@joshua-temple

Copy link
Copy Markdown
Collaborator

Problem

The nightly-release dry-run path cuts a vX.Y.Z-dryrun.N git tag to exercise Release and the fleet. But git.GetLatestTag/GetLatestReleaseTag took the newest tag by raw sort order with no version-format filter, so the dryrun tag (or any foreign tag like vnightly) outsorted real releases, was handed to version.Parse, and failed every orchestrate version calc with invalid version format. Surfaced by the dry-run validation; the orchestrate tests and the Release Test gate failed whenever a dryrun tag was newest.

Fix

Add IsValidVersionTag in internal/git (regex kept in lockstep with version.semverRegex by an external-package sync-guard test, since git cannot import version) and filter both discovery functions to valid versions only. Hardens discovery against any malformed/foreign tag generally, and lets the dry-run cut its tag without breaking version calc.

Tests

Red-without-fix unit tests in internal/git plus an orchestrate regression (TestSetup_DryrunTagPresent_DoesNotBreakVersionCalc) mirroring the exact production failure. go test ./... 2000 pass; lint clean. Part of #373.

git.GetLatestTag and GetLatestReleaseTag returned the newest tag by raw sort order without filtering to cascade's version format, so a vX.Y.Z-dryrun.N tag (cut by the nightly-release dry-run path) or any foreign tag outsorted real releases, was handed to version.Parse, and failed every orchestrate version calculation with invalid version format. Add an IsValidVersionTag predicate in internal/git (regex kept in sync with version.semverRegex by an external-package guard test, since git cannot import version) and filter both discovery functions to the valid-version set. Hardens discovery against any malformed or foreign tag, and lets the dry-run path cut its dryrun tag without breaking version calc. Part of #373.

Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant