Skip to content

fix(versioning): read sequential and two-part release tags as releases - #1351

Open
BryanFRD wants to merge 1 commit into
mainfrom
fix/sequential-floating-tags
Open

BryanFRD wants to merge 1 commit into
mainfrom
fix/sequential-floating-tags

Conversation

@BryanFRD

Copy link
Copy Markdown
Contributor

Closes #1346

What changed

  • A numeric tag is floating only when a longer tag under the same prefix extends it (v1 next to v1.2.3). Sequential v1..v3 and {year}.{seq} tags like v2026.3 are now read as releases. This applies to TagIndex and the uncached lookups alike.
  • The highest-tag lookup orders dotted numeric versions (3, 2026.3, 1.2.3) instead of requiring full semver, so the current version comes from the tags when no versioned file is configured.
  • truncate_version returns None when a level would not shorten the version. floatingTags: ["major"] with sequential versioning no longer re-creates v4 as its own alias, and the check preview no longer lists it.

Why not decide from floatingTags config

The issue suggests classifying from the configured levels and strategy. That needs the package config threaded into every tag lookup (changelog, query, publish, commit ranges), and it breaks on leftover aliases once floatingTags is removed from the config: those v1 tags would turn back into releases. Deciding from sibling tags needs no plumbing and handles both cases.

Verification

  • New tests: sequential and two-part tags through both find_highest_semver_tag paths and find_last_tag, the floating set computation, and the truncate rule.
  • Issue repro with the built binary (sequential, tags v1..v3, one feat: commit): check now plans 3 -> 4 (sequential, from tag v3).
  • cargo test: 1296 passed. formats::gomod::tests::read_version_uses_file_path_parent_dir fails locally on main too (a git tag call in my environment), unrelated.

A numeric tag is floating only when a longer release tag under the same
prefix extends it, so v1..v3 under sequential versioning and {year}.{seq}
tags are no longer skipped. The current version is resolved from the
highest numeric tag, not only full semver. Floating tag levels that would
not shorten the version are skipped instead of re-creating the release tag.

Closes #1346

Signed-off-by: BryanFRD <bryanferrando59@gmail.com>

@ferrfleet-interne ferrfleet-interne Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No blocking findings.

  • Floating detection now uses the whole tag set, and it runs over every entry, reachable or not. An alias whose release is orphaned is still excluded.
  • Both truncate_version callers (floating_tags.rs and package.rs) go through filter_map, so the new None for sequential major and two-part minor just drops the level.

Nit: parse_tag_version is laxer than semver::Version::parse. It accepts leading zeros (v01.2.3 parses to [1,2,3] but keeps 01.2.3 as the text), and it ranks build metadata by string order. Neither matters for tags FerrFlow creates itself.

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.

fix(versioning): sequential release tags are classified as floating tags

1 participant