Skip to content

Support capture-group tag sorting for non-GitHub sources #101

Description

@kergoth

Summary

For non-GitHub tag discovery, the current ordering strategy can be too dependent on whole-string semver parsing. Some upstream tag formats are better described by a regex with meaningful capture groups.

Problem

If a tag_pattern regex already defines the meaningful version components, the sort logic should be able to use those captured groups directly instead of attempting to interpret the full tag string as a semver-like value.

Proposal

If tag_pattern contains capture groups:

  • use each captured group as one sort field
  • attempt integer comparison for a group when it parses cleanly as an integer
  • otherwise compare that group lexicographically

This would make ordering more flexible for upstreams whose tags do not fit standard semver parsing.

Done looks like

  • Capture groups in tag_pattern are detected and used as the ordering key for relevant non-GitHub sources.
  • Numeric groups sort numerically.
  • Non-numeric groups sort lexicographically.
  • Existing behavior remains intact for sources without capture groups.

Open question

A reasonable fallback alternative is ordering by tag date or commit date instead of tag name. That approach may be simpler and more universal, but it also changes the semantics of what "latest" means. This issue should explicitly decide whether that alternative is needed, instead of letting it remain implicit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions