Visitar URL original
fix(validators): don't treat x in a prerelease tag as a version wildcard by sholub-dev · Pull Request #1856 · modelcontextprotocol/registry · GitHub
Skip to content

fix(validators): don't treat x in a prerelease tag as a version wildcard - #1856

Open
sholub-dev wants to merge 1 commit into
modelcontextprotocol:mainfrom
sholub-dev:fix/prerelease-version-wildcard
Open

sholub-dev wants to merge 1 commit into
modelcontextprotocol:mainfrom
sholub-dev:fix/prerelease-version-wildcard

Conversation

@sholub-dev

@sholub-dev sholub-dev commented Nov 13, 2026 •

Copy link
Copy Markdown

Fixes #1855

looksLikeVersionRange flagged any dotted version containing x/X/* as a range, so valid prerelease versions like 19.0.0-experimental.1, 2.1.0-hotfix.1 and 1.4.0-linux-x64 were rejected. The wildcard check now only looks at the part before the first -. Bare ranges (1.x, 1.*, 1.x-beta, 1.2.*-rc.1) are still rejected.

Tests: table cases for valid prerelease versions and two wildcard-plus-prerelease cases that must still fail. go test ./internal/validators/ passes.

@JosephDoUrden JosephDoUrden left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tested this locally. go test ./internal/validators/ all green, 14 Version cases pass. Put the old Contains check back and the 3 new allow cases fail, so the tests do catch it. Also threw about 40 more prerelease and wildcard inputs at it (1.0.0-x, 1.0.0-rc.x, v1.x-1, 1.2.*-rc.1, x.x.x-x), all come out right. Looks merge-ready to me.

This branch has not been deployed

No deployments
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.

Valid prerelease versions rejected as "version looks like a range"

2 participants