Skip to content

Preserve plain versions when building PURLs - #32

Open
andrew wants to merge 4 commits into
mainfrom
fix/preserve-plain-versions
Open

Preserve plain versions when building PURLs#32
andrew wants to merge 4 commits into
mainfrom
fix/preserve-plain-versions

Conversation

@andrew

@andrew andrew commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Preserves already-valid version strings in CleanVersion and only parses native range syntax when the input is a constraint.

Updates github.com/git-pkgs/vers to v0.6.0. This keeps Composer 1.0 unchanged with the new release while retaining minimum-bound extraction for constraints.

@andrew
andrew requested a lite review from Copilot August 19, 2026 11:30
@andrew
andrew marked this pull request as ready for review August 19, 2026 11:30

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 cleaning to preserve already-valid “plain” version strings when building PURLs, only invoking native constraint parsing when the input is a constraint (using vers), and bumps github.com/git-pkgs/vers to v0.6.0 to support Composer 1.0 pass-through.

Changes:

  • Trim and short-circuit CleanVersion to return already-valid versions unchanged via vers.ValidWithScheme.
  • Add test cases to ensure plain versions like 1.0 for Composer/npm pass through unchanged.
  • Update dependency github.com/git-pkgs/vers to v0.6.0 (and corresponding go.sum entries).

Reviewed changes

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

File Description
makepurl.go Trims input and preserves already-valid versions before attempting constraint parsing.
makepurl_test.go Adds pass-through test coverage for plain versions (Composer/npm).
go.mod Bumps github.com/git-pkgs/vers to v0.6.0.
go.sum Updates module checksums for vers v0.6.0.

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

Comment thread makepurl.go
Comment thread makepurl.go Outdated
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