Preserve plain versions when building PURLs - #32
Open
andrew wants to merge 4 commits into
Open
Conversation
There was a problem hiding this comment.
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
CleanVersionto return already-valid versions unchanged viavers.ValidWithScheme. - Add test cases to ensure plain versions like
1.0for Composer/npm pass through unchanged. - Update dependency
github.com/git-pkgs/verstov0.6.0(and correspondinggo.sumentries).
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Preserves already-valid version strings in
CleanVersionand only parses native range syntax when the input is a constraint.Updates
github.com/git-pkgs/verstov0.6.0. This keeps Composer1.0unchanged with the new release while retaining minimum-bound extraction for constraints.