Skip to content

Use vers minimum version API - #36

Merged
andrew merged 1 commit into
mainfrom
clean-version-minimum
Aug 27, 2026
Merged

Use vers minimum version API#36
andrew merged 1 commit into
mainfrom
clean-version-minimum

Conversation

@andrew

@andrew andrew commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Use Range.MinimumVersion when converting constraints to PURL versions. This avoids selecting excluded lower bounds and handles unions using ecosystem version ordering.

Preserve the original constraint when no included minimum exists.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates version-constraint normalization for PURL generation by using vers.Range.MinimumVersion() to select the lowest included version from constraints, and preserving the original constraint string when no included minimum exists (e.g., exclusive lower bounds or certain Maven ranges).

Changes:

  • Update CleanVersion to use Range.MinimumVersion() instead of taking the first interval’s raw minimum bound.
  • Preserve the original constraint when an included minimum cannot be identified (e.g., >1.0.0, (1.0,2.0]).
  • Extend tests to cover exclusive bounds, unions, and proper escaping in generated PURLs.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
makepurl.go Switches constraint-to-version extraction to Range.MinimumVersion() and preserves original input when no included minimum exists.
makepurl_test.go Adds coverage for exclusive constraints, union ordering, Maven exclusive-lower ranges, and PURL escaping for > constraints.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@andrew
andrew merged commit 4d09205 into main Aug 27, 2026
7 checks passed
@andrew
andrew deleted the clean-version-minimum branch August 27, 2026 15:27
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.

2 participants