feat(system): support wildcards in system files#10374
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe PR adds glob pattern expansion to ChangesGlob Wildcard Expansion Feature
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 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. Comment |
Greptile SummaryThis PR adds glob wildcard support to
Confidence Score: 5/5Safe to merge — wildcard expansion is additive (non-glob entries follow the original code path), conflicts and apply logic are unchanged, and both previously identified defects are corrected. The new wildcard path is well-isolated: non-glob entries return immediately through the original FileRequest construction. The two concretely broken cases from prior review are directly fixed by the No files require special attention. Important Files Changed
Reviews (3): Last reviewed commit: "feat(system): support wildcards in syste..." | Re-trigger Greptile |
9bd2a38 to
7bd93b2
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7bd93b2. Configure here.
7bd93b2 to
4210ca2
Compare
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 `@src/system/files.rs`:
- Around line 261-265: The '**' regex capture used by wildcard_regex can be
empty which leaves the literal '/' from the pattern in the expansion and yields
paths with a double separator (e.g. "...//tool.toml"); add a unit test next to
test_recursive_wildcard_target_expansion that asserts expanding a pattern like
".../**/*.toml" can yield a direct child path ".../tool.toml". Fix
expand_target_pattern so when translating captures into the expanded PathBuf it
avoids inserting an extra '/' for empty '**' captures—either by skipping
insertion of the following separator when the capture is empty or by normalizing
the assembled PathBuf (removing empty components or using PathBuf::push
semantics) to prevent a double '/' in the resulting path. Ensure you reference
the wildcard_regex and expand_target_pattern functions when making changes and
update tests to cover the zero-depth expansion case.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: cdc830e4-b5ca-4f85-b827-a322283cc754
📒 Files selected for processing (3)
docs/system-files.mde2e/cli/test_system_filessrc/system/files.rs
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@src/system/files.rs`:
- Around line 179-180: The glob expansion currently drops per-match GlobError
silently when building matches from glob::glob(&source_pattern); modify the
Ok(paths) arm so it iterates the Result<PathBuf, GlobError> values, logging a
warning for each Err (including the GlobError and the offending source_pattern
or path) and only collecting the successful PathBufs into matches (i.e., skip
errored entries rather than filter_map(|p| p.ok()) silently); reference the
glob::glob call, the source_pattern variable, and the matches binding to locate
where to add per-item logging and collection.
- Around line 258-325: Summary: Windows paths with backslashes break glob
parsing/expansion because wildcard_regex and expand_target_pattern only treat
'/' as the separator. Fix: normalize separators to a single canonical char
before processing and convert back when producing PathBuf. Concretely, in
wildcard_regex(pattern: &str) call a normalized let pattern =
pattern.replace('\\','/'); then build the regex from that normalized pattern (or
alternately treat separators in regex pieces as [\\/]); in
expand_target_pattern(pattern: &str, captures: &[String]) normalize the input
pattern the same way and also normalize each capture (replace('\\','/')) before
stitching into out; after composing out, convert it back to native separators if
needed (e.g. replace '/' with std::path::MAIN_SEPARATOR) or create PathBuf from
the normalized string so Windows tests for *.toml and **/*.toml pass. Also
ensure read_glob_class and any logic checking for '/' are applied to the
normalized string so the **/ zero-directories case behaves correctly.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 57bf1788-0aca-4387-87b3-4d0396b1090c
📒 Files selected for processing (3)
docs/system-files.mde2e/cli/test_system_filessrc/system/files.rs
✅ Files skipped from review due to trivial changes (1)
- docs/system-files.md
🚧 Files skipped from review as they are similar to previous changes (1)
- e2e/cli/test_system_files
Hyperfine Performance
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.6.5 x -- echo |
17.7 ± 0.8 | 16.3 | 22.2 | 1.00 |
mise x -- echo |
18.4 ± 1.1 | 16.6 | 30.6 | 1.04 ± 0.08 |
mise env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.6.5 env |
17.7 ± 0.7 | 16.1 | 20.8 | 1.00 |
mise env |
18.2 ± 0.8 | 16.7 | 22.3 | 1.03 ± 0.06 |
mise hook-env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.6.5 hook-env |
18.6 ± 0.8 | 16.7 | 22.6 | 1.00 |
mise hook-env |
18.7 ± 0.8 | 17.3 | 22.5 | 1.01 ± 0.06 |
mise ls
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.6.5 ls |
14.7 ± 0.7 | 13.5 | 19.6 | 1.00 |
mise ls |
15.4 ± 0.8 | 14.0 | 19.5 | 1.05 ± 0.07 |
xtasks/test/perf
| Command | mise-2026.6.5 | mise | Variance |
|---|---|---|---|
| install (cached) | 128ms | 131ms | -2% |
| ls (cached) | 56ms | 58ms | -3% |
| bin-paths (cached) | 63ms | 64ms | -1% |
| task-ls (cached) | 121ms | 123ms | -1% |
4210ca2 to
04db101
Compare

Summary
[system.files]into concrete file requests*and**captures into target pathsValidation
cargo fmt --checkcargo test system::filesmise run test:e2e e2e/cli/test_system_filesThis PR was generated by an AI coding assistant.
Note
Medium Risk
New glob-to-target mapping drives where
mise system installwrites under the home directory; logic bugs could place or skip files incorrectly, though mismatches are mostly warned and skipped.Overview
Adds glob wildcard expansion for
[system.files]: source paths may use*,**,?, and[…], and when multiple files match, the target key must use aligned wildcards so each match maps to a concrete install path (copy, symlink, etc. unchanged per expanded entry).files_from_confignow runs entries throughexpand_requestinstead of oneFileRequestper TOML row. Invalid or empty globs warn and skip that entry (including “multiple sources, non-wildcard target”); a single match with a literal target still works. Implementation builds regex captures from the source pattern (including**/matching zero directories and Windows path separators) and substitutes into the target pattern.Docs and e2e cover
*,?, classes,**, empty-pattern behavior; unit tests cover expansion edge cases. The system-files e2e also setschmod 644on the SSH template output before permission-drift checks so the test is reliable.Reviewed by Cursor Bugbot for commit 04db101. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit
New Features
Documentation
Tests
Bug Fixes