Repository navigation
fix(lock): fail when active tools cannot resolve - #10586
Conversation
📝 WalkthroughWalkthrough
ChangesLock resolution failure propagation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 makes
Confidence Score: 5/5Safe to merge — changes are narrowly scoped to the resolution-failure path and the active_unresolved guard correctly limits new errors to tools in both the active toolset and the user's filter. The active_unresolved logic relies on tvl.requests reflecting only priority-winning requests (confirmed via Toolset::merge), so overridden configs cannot accidentally trigger the new error path. The tool-filter guard is evaluated before active_unresolved, correctly short-circuiting for out-of-filter tools. The e2e test exercises all three distinguishable outcomes. No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "fix(lock): respect tool filters for unre..." | Re-trigger Greptile |
Hyperfine Performance
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.6.12 x -- echo |
22.5 ± 1.9 | 19.0 | 30.4 | 1.00 |
mise x -- echo |
24.5 ± 2.1 | 20.7 | 45.1 | 1.09 ± 0.13 |
mise env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.6.12 env |
23.3 ± 1.8 | 19.4 | 30.4 | 1.00 |
mise env |
23.7 ± 1.7 | 20.0 | 32.6 | 1.02 ± 0.11 |
mise hook-env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.6.12 hook-env |
23.0 ± 1.5 | 20.5 | 33.7 | 1.00 |
mise hook-env |
24.0 ± 1.4 | 20.0 | 30.7 | 1.04 ± 0.09 |
mise ls
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.6.12 ls |
19.5 ± 1.3 | 16.7 | 26.7 | 1.00 |
mise ls |
20.1 ± 1.1 | 16.7 | 24.5 | 1.03 ± 0.09 |
xtasks/test/perf
| Command | mise-2026.6.12 | mise | Variance |
|---|---|---|---|
| install (cached) | 154ms | 155ms | +0% |
| ls (cached) | 69ms | 71ms | -2% |
| bin-paths (cached) | 75ms | 77ms | -2% |
| task-ls (cached) | 144ms | 143ms | +0% |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
e2e/cli/test_lock_resolution_failure (1)
48-50: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider more robust quoting for output variable.
The pattern
"echo '$output'"works but is fragile—if$outputcontains single quotes, the command could break. Using double quotes would be safer and more conventional for bash string interpolation.♻️ Suggested alternative quoting patterns
output=$(RTX_FAILURE=1 mise lock jq --platform linux-x64 2>&1) -assert_contains "echo '$output'" "Processing 1 tool(s)" -assert_not_contains "echo '$output'" "failed to resolve dummy@3.0.0" +assert_contains "echo \"$output\"" "Processing 1 tool(s)" +assert_not_contains "echo \"$output\"" "failed to resolve dummy@3.0.0"🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@e2e/cli/test_lock_resolution_failure` around lines 48 - 50, The pattern `"echo '$output'"` used in both the assert_contains and assert_not_contains function calls is fragile due to mixed quoting. If the output variable contains single quotes, the command could break. Update both assert_contains and assert_not_contains calls to use consistent double-quote wrapping for the output variable interpolation instead of the current mixed single and double quote pattern, ensuring robust bash string handling for all edge cases.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@e2e/cli/test_lock_resolution_failure`:
- Around line 48-50: The pattern `"echo '$output'"` used in both the
assert_contains and assert_not_contains function calls is fragile due to mixed
quoting. If the output variable contains single quotes, the command could break.
Update both assert_contains and assert_not_contains calls to use consistent
double-quote wrapping for the output variable interpolation instead of the
current mixed single and double quote pattern, ensuring robust bash string
handling for all edge cases.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Central YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: b8c5cdbc-68ab-4417-893c-8cbb72a465d5
📒 Files selected for processing (2)
e2e/cli/test_lock_resolution_failuresrc/cli/lock.rs
🚧 Files skipped from review as they are similar to previous changes (1)
- src/cli/lock.rs
Summary
mise lockreturn an error when an active lock-scope tool request cannot resolvelatestand idiomatic version filesTests
cargo fmt --checkcargo test --bin mise cli::lock::testsmise run test:e2e e2e/cli/test_lock_resolution_failureNote
Medium Risk
Changes lockfile update preconditions and error propagation in
get_tools_to_lock; behavior shifts from silent skip to hard failure for active unresolved tools, which is intended but affects CI and local lock workflows.Overview
mise locknow errors when a tool in the current lock scope has an active config request that cannot be resolved, instead of silently skipping it and still updating the lockfile.In
get_tools_to_lock, matching requests use a sharedrequest_matcheshelper, andactive_unresolvedmarks config requests that are still active in the toolset for the tools being locked (all tools on an unfiltered run, or only the named tools on a filtered run). Resolution/option failures for those requests propagate viaResult; other overridden/latest/idiomatic fallbacks still log and continue as before.The lock command awaits that
Result, so a failed resolve aborts the run and leaves existing lock content unchanged. A new e2e test (RTX_FAILURE=1) covers unfiltered and explicitdummyfailures plusmise lock jqsucceeding without touching a brokendummyentry.Reviewed by Cursor Bugbot for commit 7f812f8. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit