Skip to content

[Bug]: tagSpecificity ignores v-prefix so digest dedup can prefer older tags #75

Description

@Abhineshhh

Version

sbi version: main @ d9404ec
Related: version-aware tag sort fixed in #68 / #66; dedup path was not updated
Go: 1.26.5

What happened?

sortTagsNewestFirst / versionPrefix correctly treat optional v/V prefixes. tagSpecificity (used by DeduplicateByDigest) only grants the numeric bonus when the tag starts with a digit.

Proven scores:

  • v10.0 → 2005
  • 9.0 → 12003 (wins incorrectly)

If two tags share a digest, bare 9.0 can be chosen as the primary recommendation over v10.0.

Expected: Optional v/V prefix (when followed by a digit) is treated as numeric, consistent with version-aware sort.

Steps to reproduce

  1. Compare tagSpecificity(repo:v10.0) vs tagSpecificity(repo:9.0).
  2. Or run DeduplicateByDigest with both tags on the same digest; observe primary name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions