Repository navigation
feat(backend): skip remote discovery for exact versions in more backends - #11070
Conversation
Extend the resolve_exact_version fast path introduced for cargo in #11013 to the npm, go, gem, pipx, and dotnet backends. When a request parses as full semver, resolution skips fetching the remote version list entirely and defers authoritative validation to the underlying installer (npm/bun/pnpm/aube install pkg@v, go install mod@vX.Y.Z, gem install --version, pipx install pkg==v / uv tool install, dotnet tool install --version), which all fail when the version does not exist upstream. Non-semver version schemes (RubyGems 4-part versions, PEP 440 post/rc releases, legacy 4-part NuGet versions) and git-sourced pipx tools still fall through to normal remote discovery, so prefix resolution like 1.2.3 -> 1.2.3.4 keeps working where those schemes exist. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Entire-Checkpoint: d3b92f548c1c
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Central YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughFive package backends now resolve exact SemVer inputs locally, while non-SemVer, fuzzy, range, legacy, and Git-based inputs return ChangesExact version resolution
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR extends the
Confidence Score: 5/5Safe to merge — the change is a narrowly-scoped fast path that only activates for full three-part semver strings; all other version patterns (fuzzy, prerelease scheme variants, git-sourced) continue through the existing remote-discovery code path. Each backend's semver gate is correct and independently unit-tested. The go v-prefix normalization is consistent with how install_version_ later re-adds the prefix. The pipx git-source escape hatch is well-covered by tests. No correctness gap was found across all five backends. No files require special attention; all five backends follow the same pattern and the unit tests are comprehensive. Important Files Changed
Reviews (2): Last reviewed commit: "fix(backend): validate pipx registry url..." | Re-trigger Greptile |
Hyperfine Performance
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.7.7 x -- echo |
20.9 ± 1.1 | 18.6 | 26.5 | 1.01 ± 0.10 |
mise x -- echo |
20.6 ± 1.8 | 18.3 | 46.9 | 1.00 |
mise env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.7.7 env |
20.5 ± 1.1 | 18.4 | 25.0 | 1.10 ± 0.08 |
mise env |
18.7 ± 0.9 | 17.1 | 23.6 | 1.00 |
mise hook-env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.7.7 hook-env |
21.0 ± 1.0 | 19.0 | 24.7 | 1.07 ± 0.07 |
mise hook-env |
19.6 ± 1.0 | 17.8 | 23.8 | 1.00 |
mise ls
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.7.7 ls |
18.5 ± 1.0 | 16.7 | 23.1 | 1.06 ± 0.08 |
mise ls |
17.5 ± 1.0 | 15.4 | 22.0 | 1.00 |
xtasks/test/perf
| Command | mise-2026.7.7 | mise | Variance |
|---|---|---|---|
| install (cached) | 168ms | 171ms | -1% |
| ls (cached) | 64ms | 59ms | +8% |
| bin-paths (cached) | 63ms | 61ms | +3% |
| task-ls (cached) | 128ms | 128ms | +0% |
The exact-version fast path skipped resolve-time registry URL validation, so a malformed pipx.registry_url only surfaced as an installer network error instead of the intended configuration error (test_pipx_custom_registry). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Caution Review failedAn error occurred during the review process. Please try again later. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Extends the
resolve_exact_versionfast path introduced for cargo in #11013 to the npm, go, gem, pipx, and dotnet backends.When a version request parses as full semver (
versions::SemVer), resolution now skips fetching the remote version list entirely and defers authoritative validation to the underlying installer, which fails cleanly when the version doesn't exist upstream:npm/bun/pnpm/aube install pkg@versiongo install mod@vX.Y.Z(validates against the module proxy;v-prefixed requests are normalized to match listed versions)gem install --versionpipx install pkg==version/uv tool installdotnet tool install --versionThis mostly benefits flows the lockfile short-circuit doesn't cover: exact pins in
mise.tomlwithout a lockfile, first-timemise install tool@x.y.z, andmise x tool@x.y.z.What still uses remote discovery
latest,3,3.1,^1.2.3,next)5.0.0.1) and dotted prereleases (1.2.3.rc1), PEP 440 (1.2.3.post1,1.2.3rc1,1.2.3.4), legacy 4-part NuGet versionspipx:owner/repo,pipx:git+...) — versions there are repo tags, mirroring the cargogit_urlescape hatchBehavior tradeoff (same as #11013)
An exact 3-part pin that does not exist upstream now fails at install time with the installer's error, instead of being silently promoted to a separator-suffixed variant (
1.2.3→1.2.3.4/1.2.3-rc1) during resolution. Explicit exact pins also stay outside release-age filtering, per the existing comment intool_version.rs.Verification
mise install --dry-run npm:cowsay@1.6.0resolves with zero remote calls (nonpm view), while the fuzzy controlnpm:cowsay@1.6still fetches the version list and resolves to1.6.0This PR was generated by an AI coding assistant.
🤖 Generated with Claude Code
Note
Medium Risk
Changes version resolution behavior for exact pins across five install backends; wrong semver classification could skip needed remote discovery or change failure mode from resolution promotion to install-time errors.
Overview
Extends the
resolve_exact_versionfast path (from cargo) to npm, go, gem, pipx, and dotnet. When a pin parses as full semver viaversions::SemVer, mise skips remote version-list fetches and treats the string as exact; missing versions surface at install time from the package manager instead of during resolution.Backend-specific rules: go strips a leading
vbefore semver checks; pipx only applies the fast path for PyPI tools (git-sourced tools still use remote discovery); gem, dotnet, and pipx leave non-semver schemes (RubyGems 4-part/dotted prereleases, NuGet 4-part, PEP 440) on the remote-discovery path so prefix promotion keeps working.Tradeoff: exact semver pins that do not exist upstream no longer get silently promoted to separator-suffixed variants during resolution—they fail with the installer’s error instead.
Adds unit tests on each backend mirroring cargo (exact semver resolves, fuzzy/non-semver/git fall through).
Reviewed by Cursor Bugbot for commit c6fd9d2. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit
New Features
vprefix, can now resolve directly.Tests