Repository navigation
fix(use): prefer exact releases when pinning - #11838
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughThe resolver now supports exact remote release preference for ChangesExact pin resolution
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant UseCommand
participant VersionResolver
participant RemoteBackend
User->>UseCommand: use tool with --pin
UseCommand->>VersionResolver: resolve with exact preference
VersionResolver->>RemoteBackend: validate exact release
RemoteBackend-->>VersionResolver: return available release or lookup error
VersionResolver-->>UseCommand: return resolved concrete version
UseCommand-->>User: write pinned configuration
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 SummaryThe PR updates effective
Confidence Score: 5/5The PR appears safe to merge. The previously reported syntax-validation bypass is fixed because pinning now verifies the requested literal against remotely enumerated releases before accepting it, and no blocking failure remains. Important Files Changed
Reviews (4): Last reviewed commit: "fix(use): prefer exact releases when pin..." | Re-trigger Greptile |
eca815b to
f496fb2
Compare
|
This PR currently has failing checks. If this continues for 7 days, it will be closed automatically. This is warning day 1 of 7. Please update the PR when you have a chance. Feel free to reopen or create a new PR if it is closed and you'd like to continue working on it. This comment was generated by an automated workflow. |
Summary
mise usepinning would otherwise reuse a more-specific installed fuzzy matchprefix:selectors, exact installed fast paths, lockfile precedence, and offline behavior--pinsaves the resolved concrete version rather than changing every request into an exact selectorProblem
mise use --pin erlang@27.3could reuse an installed27.3.4.10before checking whether the exact27.3release existed remotely. The result therefore depended on which matching versions were already installed.The resolver now receives an exact-release preference only from effective
mise usepinning (--pin,MISE_PIN=1, or asdf compatibility, unless overridden by--fuzzy). It keeps an already installed exact match network-free, otherwise checks for an exact release before accepting an installed fuzzy match. Online lookup failures are returned instead of silently pinning the wrong version; explicit offline mode keeps local resolution.Addresses #4889
Verification
mise run test:e2e e2e/cli/test_use_pin_exactmise exec -- cargo test --all-features toolset::tool_version(37 passed)mise exec -- cargo check --all-featuresmise exec -- cargo clippy --workspace --all-features --all-targets -- -D warningsmise exec -- cargo fmt --all -- --checkmise exec -- shfmt -d e2e/cli/test_use_pin_exactmise exec -- shellcheck e2e/cli/test_use_pin_exactmise run render:usageerlang@27.3.4.10: selectederlang@27.3and would save27.3mise run formatandmise run lintcannot run their hk wrapper in this Sapling working copy because hk reportsfailed to find git repository; the underlying Rustfmt, shfmt, ShellCheck, Clippy, and Markdownlint checks were run individually. The existing broadertest_usecurrently reaches an unrelated network-dependent ubi installation and failed with GitHub HTTP 401; all new offline regression cases pass in the dedicated E2E.AI-assisted — Tool: Codex; model: OpenAI/GPT-5; version: unavailable.
Summary by CodeRabbit
New Features
mise use --pinnow saves the resolved concrete tool version to the configuration.prefix:syntax for recursive prefix matching.Documentation