Skip to content

fix: ensure workspace environments are found when searchKind is provided#346

Draft
karthiknadig wants to merge 5 commits intomainfrom
official-alpaca
Draft

fix: ensure workspace environments are found when searchKind is provided#346
karthiknadig wants to merge 5 commits intomainfrom
official-alpaca

Conversation

@karthiknadig
Copy link
Member

Fixes #151

@github-actions
Copy link

github-actions bot commented Feb 10, 2026

Test Coverage Report (Linux)

Metric Value
Current Coverage 58.5%
Base Branch Coverage 58.0%
Delta .5% ✅

Coverage increased! Great work!

@github-actions
Copy link

github-actions bot commented Feb 10, 2026

Performance Report (Linux) ✅

Metric PR (P50) PR (P95) Baseline (P50) Delta Change
Server Startup 1ms 1ms 1ms 0ms 0%
Full Refresh 81ms 261ms 87ms -6ms 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 10, 2026

Test Coverage Report (Windows)

Metric Value
Current Coverage 54.98%
Base Branch Coverage 54.5%
Delta 0.48% ✅

Coverage increased! Great work!

@github-actions
Copy link

github-actions bot commented Feb 10, 2026

Performance Report (Windows) ✅

Metric PR (P50) PR (P95) Baseline (P50) Delta Change
Server Startup 9ms 13ms 10ms -1ms -10%
Full Refresh 164ms 403ms 166ms -2ms -1.2%

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 10, 2026

Performance Report (macOS)

Metric PR (P50) PR (P95) Baseline (P50) Delta
Server Startup 75ms 692ms 87ms -12ms
Full Refresh 157ms 37667ms 142ms 15ms

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

Fixes environment discovery when refresh is called with searchKind but without searchPaths, ensuring workspace-based environments (notably Venv) are still discoverable (Issue #151).

Changes:

  • Adjust handle_refresh to keep workspace_directories when only searchKind is provided, instead of restricting discovery to global locations only.
  • Add a regression test intended to validate searchKind behavior with workspace venv discovery.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
crates/pet/src/jsonrpc.rs Updates refresh-scoping logic so searchKind doesn’t inadvertently prevent workspace environment discovery.
crates/pet/src/find.rs Adds a new test attempting to cover the reported searchKind/workspace discovery regression.

Addresses PR review comments:
1. Extract the refresh-option→config/search_scope logic into a helper
   function �uild_refresh_config that can be unit tested
2. Add fast, deterministic unit tests that directly test the bug fix:
   - test_search_kind_preserves_workspace_directories: verifies the
     critical fix that workspace_directories are NOT cleared when only
     searchKind is provided
   - test_search_paths_replaces_workspace_directories: verifies
     searchPaths still correctly replaces workspace_directories
   - test_no_options_preserves_config: verifies default behavior
3. Remove the slow integration-style test from find.rs that was
   environment-dependent and didn't actually test the bug in handle_refresh

Fixes #151
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

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

- Change build_refresh_config from pub to pub(crate) to avoid expanding API surface
- Use tempfile::TempDir in test for deterministic is_dir() behavior
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

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

searchKind now preserves workspace_directories so workspace-based
environments (venvs, virtualenvs) can be discovered.
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

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

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.

refresh on venv kind does not detect environments.

1 participant