Repository navigation
fix(prune): preserve untrusted version file references - #11501
Conversation
📝 WalkthroughWalkthroughTracked config discovery now evaluates trust requirements by config type, skips ignored paths before parsing, and gates untrusted tracked files by their trust roots. The prune end-to-end test verifies expected tool output and prevents template execution. ChangesTracked config trust handling
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Config as Config::get_tracked_config_files
participant IgnoreCheck as config_path_is_ignored
participant TrustCheck as config_file::path_requires_trust
participant Prune as mise prune
Config->>IgnoreCheck: Check tracked config path
IgnoreCheck-->>Config: Return ignored status
Config->>TrustCheck: Determine trust requirement
TrustCheck-->>Config: Return requirement
Config->>Prune: Skip or load tracked config
Prune-->>Config: Produce dry-run output
Possibly related PRs
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 makes tracked-config trust checks file-type aware while preserving version references during pruning.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Reviews (3): Last reviewed commit: "fix(prune): respect ignored tracked conf..." | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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.
Inline comments:
In `@e2e/cli/test_prune_tracked_config_trust`:
- Around line 31-34: Update the assertions in the prune tracked-config trust
test to verify that the output includes dummy@3.0.0 as a prune candidate. Keep
the existing assertions for excluding versions 1.0.0 and 2.0.0, reporting the
untrusted tracked config, and confirming the marker is absent.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Central YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: 633ff031-07d0-4dd1-b455-df6bb6d05693
📒 Files selected for processing (4)
e2e/cli/test_prune_tracked_config_trustsrc/config/config_file/mod.rssrc/config/config_file/tool_versions.rssrc/config/mod.rs
Instruction counts
No instruction-count regression above 1%. Only instruction counts gate. Wall clock is shown for context — on identical hardware it moves 4-20% run to run. Measured by tak — instruction-counted CLI benchmarks, stored in this repository's git notes.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7281d71. Configure here.

Summary
.tool-versions.tool-versionswithout prompting or rendering themRoot cause
Tracked-config loading applied a blanket trust pre-check before parsing every tracked file. Idiomatic version files do not create trust records, so commands such as
mise prune --toolssilently discarded their references and could remove versions still used by other projects.Reported in discussion #11483.
Validation
mise run formatcargo fmt --all -- --checkmise run test:e2e cli/test_prune_tracked_config_trustmise run test:e2e config/test_tool_versions_trust_check config/test_trust_safe_config_trackedAI-assisted — Tool: Codex; model: unavailable; version: unavailable.
Note
Medium Risk
Changes trust gating for all tracked-config consumers (prune, upgrade, ls), affecting which tool versions stay protected; logic is narrower and covered by new e2e tests.
Overview
Tracked config loading no longer treats every tracked path as trust-gated before parse. Commands like
mise prune --toolswere dropping references from idiomatic version files and plain.tool-versionsbecause those files never get trust records, so installed versions could be pruned while still in use elsewhere.Loading now skips ignored tracked configs up front and uses
path_requires_trustso only configs that actually need trust (non-exemptmise.toml, templated.tool-versions) are skipped when untrusted. Plain.tool-versionsand idiomatic files are still parsed without trust; templated untrusted files are skipped without rendering templates. Trust is checked against the config root only (legacy per-file trust checks removed from this path).An e2e test covers idiomatic, plain, templated, and ignored tracked configs during
mise prune --dry-run.Reviewed by Cursor Bugbot for commit 9fecefb. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit
.tool-versionsfiles containing template expressions are no longer processed, preventing template evaluation side effects.