Skip to content

feat: add glob pattern expansion to CLI find search paths and environment directories (Fixes #354)#362

Open
karthiknadig wants to merge 1 commit intomainfrom
feature/issue-354
Open

feat: add glob pattern expansion to CLI find search paths and environment directories (Fixes #354)#362
karthiknadig wants to merge 1 commit intomainfrom
feature/issue-354

Conversation

@karthiknadig
Copy link
Member

Expands glob patterns in search_paths and environment_directories when constructing the configuration for the find CLI command, using the expand_glob_patterns utility from pet-fs.

Fixes #354

@karthiknadig karthiknadig requested a review from Copilot February 25, 2026 16:14
@github-actions
Copy link

github-actions bot commented Feb 25, 2026

Test Coverage Report (Linux)

Metric Value
Current Coverage 58.8%
Base Branch Coverage 58.8%
Delta 0% ➖

Coverage unchanged.

@github-actions
Copy link

github-actions bot commented Feb 25, 2026

Performance Report (Linux) ➖

Metric PR (P50) PR (P95) Baseline (P50) Delta Change
Server Startup 1ms 1ms 1ms 0ms 0%
Full Refresh 77ms 369ms 76ms 1ms 0%

Results based on 10 iterations. P50 = median, P95 = 95th percentile.


Legend
  • 🚀 Significant speedup (>100ms faster)
  • ✅ Faster than baseline
  • ➖ No significant change
  • 🔺 Slower than baseline (>100ms)
  • ⚠️ Significant slowdown (>500ms)

@github-actions
Copy link

github-actions bot commented Feb 25, 2026

Performance Report (Windows) ✅

Metric PR (P50) PR (P95) Baseline (P50) Delta Change
Server Startup 9ms 13ms 12ms -3ms -25%
Full Refresh 163ms 2737ms 230ms -67ms -29.1%

Results based on 10 iterations. P50 = median, P95 = 95th percentile.


Legend
  • 🚀 Significant speedup (>100ms faster)
  • ✅ Faster than baseline
  • ➖ No significant change
  • 🔺 Slower than baseline (>100ms)
  • ⚠️ Significant slowdown (>500ms)

@github-actions
Copy link

github-actions bot commented Feb 25, 2026

Test Coverage Report (Windows)

Metric Value
Current Coverage 55.03%
Base Branch Coverage 55.04%
Delta -0.01% ❌

Coverage decreased. Please add tests for new code.

@github-actions
Copy link

github-actions bot commented Feb 25, 2026

Performance Report (macOS)

Metric PR (P50) PR (P95) Baseline (P50) Delta
Server Startup 62ms 537ms 70ms -8ms
Full Refresh 119ms 28313ms 164ms -45ms

Results based on 10 iterations. P50 = median, P95 = 95th percentile.


Legend
  • 🚀 Significant speedup (>100ms faster)
  • ✅ Faster than baseline
  • ➖ No significant change
  • 🔺 Slower than baseline (>100ms)
  • ⚠️ Significant slowdown (>500ms)

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds CLI parity with the JSONRPC server by expanding glob patterns in pet find configuration inputs, so quoted globs and env-var-provided globs work as expected.

Changes:

  • Expand glob patterns in search_paths when building Configuration for the CLI find command.
  • Expand glob patterns in environment_directories when building Configuration.
Comments suppressed due to low confidence (1)

crates/pet/src/lib.rs:150

  • With glob expansion, search_paths can become empty when the user explicitly provides only glob patterns that match nothing (or invalid patterns). In that case this code will now fall back to adding cwd, which changes the prior semantics where explicit search_paths disabled the default cwd behavior. Consider only defaulting to cwd when options.search_paths is None (not provided), not when it was provided but expanded to zero matches.
    if search_paths.is_empty() {
        if let Ok(cwd) = env::current_dir() {
            search_paths.push(cwd);
        }
    }

@karthiknadig karthiknadig enabled auto-merge (squash) February 25, 2026 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add glob pattern expansion to CLI find search paths and environment directories

2 participants