Skip to content

fix: ignore hidden directories during server discovery#259

Merged
toby-coleman merged 9 commits into
mainfrom
copilot/fix-discovery-command-venv-issue
Jun 2, 2026
Merged

fix: ignore hidden directories during server discovery#259
toby-coleman merged 9 commits into
mainfrom
copilot/fix-discovery-command-venv-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 17, 2026

Summary

plugboard server discover could fail when the target directory contained a hidden virtualenv such as .venv, because discovery attempted to recurse into and import files from hidden paths. This change makes discovery skip hidden directories while preserving normal module discovery.

Changes

  • Discovery traversal

    • Keep the recursive import walk based on os.walk.
    • Prune hidden directories in place via dirs[:] so discovery does not descend into .venv and similar paths.
    • Simplify module name construction using Path(...).relative_to(...).with_suffix("").
  • Regression coverage

    • Consolidate the discovery coverage into a single parametrized CLI test.
    • Cover package and non-package projects both with and without hidden directories.
    • Verify that visible modules are still discovered and discovery completes without raising when hidden directories are present.

Copilot AI and others added 3 commits May 17, 2026 20:41
Copilot AI changed the title [WIP] Fix discovery command failure when .venv folder is present fix: ignore hidden directories during server discovery May 17, 2026
Copilot AI requested a review from toby-coleman May 17, 2026 20:44
Comment thread plugboard/cli/server/__init__.py
Comment thread tests/unit/test_cli.py Outdated
Copilot AI and others added 2 commits May 17, 2026 21:02
Agent-Logs-Url: https://github.com/plugboard-dev/plugboard/sessions/95e9b248-3b2e-44b6-8916-b2c37aa87c09

Co-authored-by: toby-coleman <13170610+toby-coleman@users.noreply.github.com>
Agent-Logs-Url: https://github.com/plugboard-dev/plugboard/sessions/95e9b248-3b2e-44b6-8916-b2c37aa87c09

Co-authored-by: toby-coleman <13170610+toby-coleman@users.noreply.github.com>
Copilot AI requested a review from toby-coleman May 17, 2026 21:04
Comment thread plugboard/cli/server/__init__.py Outdated
Copilot AI and others added 2 commits May 17, 2026 21:13
Agent-Logs-Url: https://github.com/plugboard-dev/plugboard/sessions/2d8dca45-18df-4778-8cbe-25c9bccbf641

Co-authored-by: toby-coleman <13170610+toby-coleman@users.noreply.github.com>
Agent-Logs-Url: https://github.com/plugboard-dev/plugboard/sessions/2d8dca45-18df-4778-8cbe-25c9bccbf641

Co-authored-by: toby-coleman <13170610+toby-coleman@users.noreply.github.com>
Copilot AI requested a review from toby-coleman May 17, 2026 21:15
@toby-coleman toby-coleman marked this pull request as ready for review May 17, 2026 21:18
@github-actions
Copy link
Copy Markdown

Benchmark comparison for 97996e58 (base) vs 58f20321 (PR)


------------------------------------------------------------------------------------------------------------------ benchmark: 2 tests -----------------------------------------------------------------------------------------------------------------
Name (time in ms)                                                                         Min                 Max                Mean            StdDev              Median               IQR            Outliers     OPS            Rounds  Iterations
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_benchmark_process_run (pr/.benchmarks/Linux-CPython-3.14-64bit/0001_pr)         420.9185 (1.0)      423.7608 (1.0)      422.0182 (1.0)      1.1293 (1.0)      421.4850 (1.0)      1.5078 (1.0)           1;0  2.3696 (1.0)           5           1
test_benchmark_process_run (main/.benchmarks/Linux-CPython-3.14-64bit/0001_base)     422.6454 (1.00)     434.5691 (1.03)     426.7634 (1.01)     4.7228 (4.18)     425.5294 (1.01)     5.7463 (3.81)          1;0  2.3432 (0.99)          5           1
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Legend:
  Outliers: 1 Standard Deviation from Mean; 1.5 IQR (InterQuartile Range) from 1st Quartile and 3rd Quartile.
  OPS: Operations Per Second, computed as 1 / Mean

@codecov
Copy link
Copy Markdown

codecov Bot commented May 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions
Copy link
Copy Markdown

Benchmark comparison for 7a6f8dcc (base) vs caec63b3 (PR)


------------------------------------------------------------------------------------------------------------------ benchmark: 2 tests -----------------------------------------------------------------------------------------------------------------
Name (time in ms)                                                                         Min                 Max                Mean            StdDev              Median               IQR            Outliers     OPS            Rounds  Iterations
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_benchmark_process_run (pr/.benchmarks/Linux-CPython-3.14-64bit/0001_pr)         519.2073 (1.0)      527.4996 (1.0)      523.3900 (1.0)      3.1511 (1.0)      523.2350 (1.0)      4.5110 (1.0)           2;0  1.9106 (1.0)           5           1
test_benchmark_process_run (main/.benchmarks/Linux-CPython-3.14-64bit/0001_base)     523.7548 (1.01)     536.5726 (1.02)     529.2097 (1.01)     5.4315 (1.72)     529.6245 (1.01)     9.1257 (2.02)          2;0  1.8896 (0.99)          5           1
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Legend:
  Outliers: 1 Standard Deviation from Mean; 1.5 IQR (InterQuartile Range) from 1st Quartile and 3rd Quartile.
  OPS: Operations Per Second, computed as 1 / Mean

@toby-coleman toby-coleman merged commit 8eb9451 into main Jun 2, 2026
41 of 44 checks passed
@toby-coleman toby-coleman deleted the copilot/fix-discovery-command-venv-issue branch June 2, 2026 21:27
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.

bug: plugboard server discovery command fails if venv is present

2 participants