Skip to content

test(workspace): check dot-directory pruning on the walk the CLI uses - #16254

Merged
zkochan merged 1 commit into
mainfrom
test/dot-pruning-production-path
Sep 27, 2026
Merged

zkochan merged 1 commit into
mainfrom
test/dot-pruning-production-path

Conversation

@zkochan

@zkochan zkochan commented Sep 27, 2026 •

Copy link
Copy Markdown
Member

Summary

Follow-up to #16252. The dot-pruning unit tests called discovery with no managed directories, so they only exercised the prebuilt ignore template. The CLI always passes managed directories, which sends every walk through the rebuilt ignore list. #15262 dropped the dot-component pattern from that list with every test still green, and #16250 shipped in 12.7.0.

  • find_project_names (the helper behind the dot-pruning, negation and symlink unit tests) now discovers with and without a managed directory and asserts both agree.
  • The template and the rebuilt list are both built by compile_walk_ignores, so the rule that adds DOT_COMPONENT_IGNORE_PATTERN lives in one place.
  • New CLI test recursive_run_skips_projects_under_dot_directories: pnpm -r run build over packages: ['**'] must not run a project under .cache.

Verified by reverting the fix from #16252: the CLI test, non_terminal_star_does_not_match_dotted_directories, normalizes_literal_and_glob_patterns and the test from #16252 fail (nextest stopped at the first failures). With the fix, pnpm-workspace and the run_recursive suite pass (225 tests), and scoped clippy, dylint and rustfmt are clean.

No changeset: no user-visible change.

Squash Commit Body

The dot-pruning unit tests called discovery with no managed
directories, so they only exercised the prebuilt ignore template.
The CLI always passes managed directories, which sends every walk
through the rebuilt ignore list instead. pnpm/pnpm#15262 dropped the
dot-component pattern from that list and every test still passed,
which is how pnpm/pnpm#16250 shipped in 12.7.0.

find_project_names now discovers with and without a managed
directory and asserts both give the same projects, so every case
that goes through it covers both ignore lists. Both lists are now
built by compile_walk_ignores, so the rule that adds the dot-component
pattern lives in one place. A CLI test runs `pnpm -r run` over a
`**` workspace with a project under `.cache`.

Checklist

  • Added or updated tests.

Written by an agent (Claude Code, claude-opus-5-5).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Recursive builds now discover matching workspace projects in visible directories while excluding projects under .cache.
  • Tests
    • Added coverage for recursive workspace discovery and for consistent results when node_modules is ignored during project discovery.

The dot-pruning unit tests called discovery with no managed
directories, so they only exercised the prebuilt ignore template.
The CLI always passes managed directories, which sends every walk
through the rebuilt ignore list instead. #15262 dropped the
dot-component pattern from that list and every test still passed,
which is how #16250 shipped in 12.7.0.

find_project_names now discovers with and without a managed
directory and asserts both give the same projects, so every case
that goes through it covers both ignore lists. Both lists are now
built by compile_walk_ignores, so the rule that adds the dot-component
pattern lives in one place. A CLI test runs `pnpm -r run` over a
`**` workspace with a project under `.cache`.

Reverting #16252 fails the CLI test and the existing
dot-pruning unit tests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: pnpm/pnpm/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: c1c4421b-9151-43cc-b6b7-9386082c0ae2

📥 Commits

Reviewing files that changed from the base of the PR and between f8d8c20 and c16882d.

📒 Files selected for processing (3)
  • pnpm/crates/cli/tests/suite/run_recursive.rs
  • pnpm/crates/workspace/src/projects.rs
  • pnpm/crates/workspace/src/projects/tests.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.


📝 Walkthrough

Walkthrough

The change centralizes workspace walk-ignore construction and adds workspace and CLI tests for project discovery when dot directories and managed directories are involved.

Changes

Workspace project discovery

Layer / File(s) Summary
Walk-ignore construction and discovery checks
pnpm/crates/workspace/src/projects.rs, pnpm/crates/workspace/src/projects/tests.rs
compile_walk_ignores combines built-in, dot-component, and managed-directory ignores. Workspace tests compare discovery with and without node_modules ignored.
Recursive run under dot directories
pnpm/crates/cli/tests/suite/run_recursive.rs
An integration test checks that recursive run build runs a visible project and skips a project beneath .cache.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Suggested labels: product: pacquet

Merge Risk: ⚪ Minimal · up to c1688

The ignore-list change and its discovery tests present no identified merge-blocking risk; merge after normal checks.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.50000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.09%. Comparing base (a9d33c9) to head (c16882d).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pnpm/crates/workspace/src/projects.rs 87.50% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16254      +/-   ##
==========================================
- Coverage   92.09%   92.09%   -0.01%     
==========================================
  Files        1489     1489              
  Lines      201065   201068       +3     
==========================================
+ Hits       185173   185175       +2     
- Misses      15892    15893       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                                            main                                   pr
-----                                            ----                                   --
lockfile/parse_pnpm_lock                         1.00     12.4±0.05ms    30.1 MB/sec    1.02     12.7±0.05ms    29.6 MB/sec
packument/parse                                  1.00     40.2±0.74µs  1651.4 MB/sec    1.00     40.2±0.08µs  1652.0 MB/sec
tarball/download_dependency                      1.00      4.2±0.08ms  1039.0 KB/sec    1.01      4.2±0.15ms  1026.4 KB/sec
tarball_batch/cold_store_many_medium_tarballs    1.00    188.0±3.94ms 85.1 KElem/sec    1.10    207.1±3.05ms 77.2 KElem/sec
workspace_resolution/hoist_heavy                 1.01    259.2±3.23ms        ? ?/sec    1.00    257.5±2.42ms        ? ?/sec
workspace_sort/chained_projects                  1.00     15.3±1.14ms        ? ?/sec    1.01     15.4±0.91ms        ? ?/sec

@github-actions

Copy link
Copy Markdown
Contributor

Same-run regression check

HEAD and main are measured on the same runner. The tolerance is 5% of the main median or 2 ms, whichever is larger. A regression requires both the median slowdown and the gap between the fastest retained HEAD sample and slowest retained main sample to exceed this tolerance, after trimming up to 10% from each tail. Suspected regressions are rerun once with target order reversed and only fail if reproduced. This conservative noise guard is not a statistical confidence interval.

Inconclusive rows do not fail the check. They remain visible for performance review. Bencher retains absolute minimum timings for historical tracking; historical alerts do not gate this PR. Sequential measurements can still be affected by runner drift.

Scenario Engine main median HEAD median Change Tolerance Result
isolated-fresh-restore-cold-cache-cold-store pacquet 2418.96 ms 2385.10 ms -1.4% 120.95 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store pnpr 1483.98 ms 1443.72 ms -2.7% 74.20 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pacquet 234.52 ms 237.24 ms 1.2% 11.73 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pnpr 250.13 ms 250.36 ms 0.1% 12.51 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pacquet 9.01 ms 8.04 ms -10.8% 2.00 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pnpr 8.20 ms 8.73 ms 6.5% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pacquet 14.91 ms 8.91 ms -40.2% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pnpr 15.05 ms 16.02 ms 6.4% 2.00 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pacquet 2499.81 ms 2501.43 ms 0.1% 124.99 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pnpr 1539.26 ms 1474.92 ms -4.2% 76.96 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pacquet 494.27 ms 492.29 ms -0.4% 24.71 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pnpr 299.71 ms 308.00 ms 2.8% 14.99 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pacquet 1619.66 ms 1633.31 ms 0.8% 80.98 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pnpr 287.51 ms 297.67 ms 3.5% 14.38 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pacquet 254.36 ms 248.11 ms -2.5% 12.72 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pnpr 92.11 ms 93.69 ms 1.7% 4.61 ms Within tolerance
isolated-peer-heavy-resolve-hot-cache-offline pacquet 1092.23 ms 1074.18 ms -1.7% 54.61 ms Within tolerance
isolated-linked-workspace-resolve-hot-cache-offline pacquet 192.87 ms 188.07 ms -2.5% 9.64 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pacquet 4336.24 ms 4481.30 ms 3.3% 216.81 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pnpr 3483.58 ms 3430.83 ms -1.5% 174.18 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pacquet 123.71 ms 122.35 ms -1.1% 6.19 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pnpr 131.67 ms 133.60 ms 1.5% 6.58 ms Within tolerance

Integrated-Benchmark Report (Linux)

Commit: c16882d289a0

Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm; the linked-workspace scenario compares current Rust against main Rust. Bencher consumes pacquet@HEAD and pnpr@HEAD.

The tables below show mean ± σ. Bencher tracks absolute minimum latency; PR regression checks compare HEAD and main samples from the same runner. Historical timing alerts do not gate PRs.

Scenario: Isolated linker: fresh restore, cold cache + cold store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.450 ± 0.130 2.319 2.744 1.66 ± 0.18
pacquet@main 2.469 ± 0.143 2.313 2.669 1.67 ± 0.19
pnpr@HEAD 1.477 ± 0.142 1.335 1.705 1.00
pnpr@main 1.497 ± 0.151 1.335 1.704 1.01 ± 0.14
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.4504733550599997,
      "stddev": 0.1304608429682913,
      "median": 2.38509802096,
      "user": 1.66188082,
      "system": 1.8574558199999998,
      "min": 2.31881033646,
      "max": 2.74392811246
    },
    {
      "command": "pacquet@main",
      "mean": 2.46923946176,
      "stddev": 0.14330029466255392,
      "median": 2.41895952946,
      "user": 1.5619031199999998,
      "system": 1.8027628199999994,
      "min": 2.31297471146,
      "max": 2.66934775546
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.47687968736,
      "stddev": 0.14238993285121315,
      "median": 1.4437204444599998,
      "user": 1.3897720199999999,
      "system": 1.67651662,
      "min": 1.33540102146,
      "max": 1.70458453046
    },
    {
      "command": "pnpr@main",
      "mean": 1.49702420066,
      "stddev": 0.15095898221109216,
      "median": 1.4839765254600001,
      "user": 1.30632602,
      "system": 1.6168066199999998,
      "min": 1.33468933246,
      "max": 1.70438440146
    }
  ]
}

Scenario: Isolated linker: fresh restore, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 234.5 ± 5.8 220.0 239.6 1.00
pacquet@main 285.5 ± 81.2 210.7 410.0 1.22 ± 0.35
pnpr@HEAD 249.9 ± 4.9 239.1 256.9 1.07 ± 0.03
pnpr@main 248.1 ± 11.6 221.5 264.0 1.06 ± 0.06
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.23451184768000002,
      "stddev": 0.005841928284055605,
      "median": 0.23724438938000003,
      "user": 0.24842244000000005,
      "system": 0.58544208,
      "min": 0.22003733238000003,
      "max": 0.23955713538000004
    },
    {
      "command": "pacquet@main",
      "mean": 0.28549919747999997,
      "stddev": 0.08120215533537185,
      "median": 0.23451939538000002,
      "user": 0.30628464,
      "system": 0.69393158,
      "min": 0.21066246938000002,
      "max": 0.40999102238
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.24989428648,
      "stddev": 0.0049324008618506065,
      "median": 0.25036158387999996,
      "user": 0.26400684,
      "system": 0.59551668,
      "min": 0.23907502438000003,
      "max": 0.25694994338
    },
    {
      "command": "pnpr@main",
      "mean": 0.24809369898000005,
      "stddev": 0.011633722980137881,
      "median": 0.25012963838,
      "user": 0.24985544,
      "system": 0.5920619799999998,
      "min": 0.22147211438000003,
      "max": 0.26397608538
    }
  ]
}

Scenario: Isolated linker: repeat install, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 8.2 ± 1.0 6.8 12.9 1.00
pacquet@main 9.0 ± 0.8 7.3 12.9 1.09 ± 0.17
pnpr@HEAD 8.8 ± 0.8 7.3 12.3 1.07 ± 0.16
pnpr@main 8.4 ± 0.8 7.0 11.6 1.01 ± 0.16
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.008247474579783394,
      "stddev": 0.0010210152616517518,
      "median": 0.0080373208,
      "user": 0.004919939061371837,
      "system": 0.003745056317689528,
      "min": 0.0068059898,
      "max": 0.0128506728
    },
    {
      "command": "pacquet@main",
      "mean": 0.009020831476012462,
      "stddev": 0.0008192500861144725,
      "median": 0.009005457800000002,
      "user": 0.005193849719626164,
      "system": 0.004325304049844238,
      "min": 0.0073456528,
      "max": 0.012877537800000002
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.008810007135793363,
      "stddev": 0.000806953341056191,
      "median": 0.0087319488,
      "user": 0.005217242656826571,
      "system": 0.004078873062730627,
      "min": 0.007293244800000001,
      "max": 0.0122737138
    },
    {
      "command": "pnpr@main",
      "mean": 0.008361187295652177,
      "stddev": 0.0008160896075931891,
      "median": 0.0082017718,
      "user": 0.0048220295652173905,
      "system": 0.004005034782608696,
      "min": 0.0070410408,
      "max": 0.011640834800000001
    }
  ]
}

Scenario: Isolated linker: repeat install, cold cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 10.3 ± 3.0 7.7 22.4 1.00
pacquet@main 15.1 ± 3.3 10.0 28.4 1.46 ± 0.53
pnpr@HEAD 16.5 ± 3.1 11.1 27.3 1.60 ± 0.55
pnpr@main 15.3 ± 3.8 8.6 30.9 1.48 ± 0.56
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.010343353859090913,
      "stddev": 0.00297942929983169,
      "median": 0.0089147718,
      "user": 0.005587686363636363,
      "system": 0.00537272290909091,
      "min": 0.0077064323,
      "max": 0.0223505293
    },
    {
      "command": "pacquet@main",
      "mean": 0.015050785860000002,
      "stddev": 0.003299549472330537,
      "median": 0.0149068033,
      "user": 0.007824696,
      "system": 0.008079863679999999,
      "min": 0.009952505300000001,
      "max": 0.028433445300000002
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.01652714588787879,
      "stddev": 0.0031453289724248314,
      "median": 0.0160193583,
      "user": 0.008979951515151519,
      "system": 0.008457396848484849,
      "min": 0.0111262783,
      "max": 0.027293001300000005
    },
    {
      "command": "pnpr@main",
      "mean": 0.015340398549999999,
      "stddev": 0.0038131560697613667,
      "median": 0.0150546103,
      "user": 0.007475717741935481,
      "system": 0.008793072258064515,
      "min": 0.0086447443,
      "max": 0.030933754300000005
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + cold store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.530 ± 0.069 2.480 2.716 1.67 ± 0.13
pacquet@main 2.507 ± 0.019 2.485 2.542 1.66 ± 0.13
pnpr@HEAD 1.512 ± 0.114 1.397 1.775 1.00
pnpr@main 1.528 ± 0.124 1.400 1.736 1.01 ± 0.11
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.52969667552,
      "stddev": 0.06945680013898431,
      "median": 2.50143379752,
      "user": 1.86839758,
      "system": 1.5600606999999997,
      "min": 2.4802778175199998,
      "max": 2.7156564185199996
    },
    {
      "command": "pacquet@main",
      "mean": 2.5065826750199998,
      "stddev": 0.01885786439472662,
      "median": 2.4998149985199998,
      "user": 1.7472684800000002,
      "system": 1.5019478999999998,
      "min": 2.4845489555199998,
      "max": 2.54198399452
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.5119399662200002,
      "stddev": 0.11443040972549463,
      "median": 1.4749230505200002,
      "user": 1.06404758,
      "system": 1.1771079,
      "min": 1.39703063652,
      "max": 1.7747644105200002
    },
    {
      "command": "pnpr@main",
      "mean": 1.5284444118200002,
      "stddev": 0.12375671582169295,
      "median": 1.53926360452,
      "user": 1.0509047800000002,
      "system": 1.1814469,
      "min": 1.3998470115200001,
      "max": 1.7363496575200001
    }
  ]
}

Scenario: Isolated linker: fresh install, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 494.0 ± 37.7 445.8 578.5 1.66 ± 0.14
pacquet@main 495.9 ± 21.2 472.1 531.8 1.66 ± 0.09
pnpr@HEAD 306.1 ± 9.3 288.4 318.8 1.03 ± 0.05
pnpr@main 298.4 ± 10.4 283.3 316.7 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.49399153094,
      "stddev": 0.037744621855934024,
      "median": 0.49229239814000003,
      "user": 0.68841158,
      "system": 0.7388848199999999,
      "min": 0.44575260964,
      "max": 0.57851116264
    },
    {
      "command": "pacquet@main",
      "mean": 0.49589575844,
      "stddev": 0.021178464898686373,
      "median": 0.49427498664,
      "user": 0.6692980799999999,
      "system": 0.7562440199999999,
      "min": 0.47208361364,
      "max": 0.53183712464
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.30606977644,
      "stddev": 0.009297320823703584,
      "median": 0.30800305214,
      "user": 0.25823678,
      "system": 0.60507802,
      "min": 0.28835023664000003,
      "max": 0.31880651364
    },
    {
      "command": "pnpr@main",
      "mean": 0.29842408894,
      "stddev": 0.010431556301436664,
      "median": 0.29970521714,
      "user": 0.24969048000000002,
      "system": 0.56730252,
      "min": 0.28331439964,
      "max": 0.31669921464
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + hot store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.626 ± 0.020 1.595 1.651 5.64 ± 0.14
pacquet@main 1.623 ± 0.023 1.582 1.653 5.63 ± 0.15
pnpr@HEAD 0.298 ± 0.009 0.285 0.310 1.03 ± 0.04
pnpr@main 0.288 ± 0.006 0.282 0.301 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.6258693340600001,
      "stddev": 0.020235375258391877,
      "median": 1.63331237916,
      "user": 0.8274035599999999,
      "system": 0.83351884,
      "min": 1.59463634466,
      "max": 1.65079138866
    },
    {
      "command": "pacquet@main",
      "mean": 1.62324067156,
      "stddev": 0.02275533619188159,
      "median": 1.6196606181600002,
      "user": 0.8610197599999999,
      "system": 0.8106955399999999,
      "min": 1.58212464366,
      "max": 1.65287904266
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.29766718395999997,
      "stddev": 0.008970415970153417,
      "median": 0.29766582516000006,
      "user": 0.25366626000000003,
      "system": 0.5717468400000001,
      "min": 0.28474360766,
      "max": 0.31000995866000003
    },
    {
      "command": "pnpr@main",
      "mean": 0.28843168086000004,
      "stddev": 0.006404441881544278,
      "median": 0.28751410116000004,
      "user": 0.23370075999999998,
      "system": 0.5593058399999999,
      "min": 0.28220037466000003,
      "max": 0.30110278466
    }
  ]
}

Scenario: Isolated linker: fresh resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 250.0 ± 12.3 228.4 275.1 2.70 ± 0.16
pacquet@main 251.0 ± 23.0 204.6 289.6 2.71 ± 0.26
pnpr@HEAD 93.5 ± 2.1 87.9 96.8 1.01 ± 0.04
pnpr@main 92.6 ± 3.0 86.7 102.0 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.2499767049466667,
      "stddev": 0.012274171451519619,
      "median": 0.24810560728000003,
      "user": 0.24557061666666666,
      "system": 0.08780359,
      "min": 0.22841226228000003,
      "max": 0.27510679528000004
    },
    {
      "command": "pacquet@main",
      "mean": 0.2509846369163636,
      "stddev": 0.023040859648560168,
      "median": 0.25436122528,
      "user": 0.24064247272727268,
      "system": 0.08103093090909091,
      "min": 0.20457610428,
      "max": 0.28958494428000003
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.09349322001333336,
      "stddev": 0.002136091730547958,
      "median": 0.09369358878,
      "user": 0.03390016666666666,
      "system": 0.015472439999999995,
      "min": 0.08791154328,
      "max": 0.09678951228
    },
    {
      "command": "pnpr@main",
      "mean": 0.09258251992516131,
      "stddev": 0.0030413176504727195,
      "median": 0.09210920028000001,
      "user": 0.032063425806451606,
      "system": 0.01651232387096774,
      "min": 0.08665414428000001,
      "max": 0.10203157028000001
    }
  ]
}

Scenario: Isolated linker: peer-heavy resolve, hot cache, offline

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.038 ± 0.110 0.828 1.164 1.01 ± 0.19
pacquet@main 1.027 ± 0.157 0.679 1.155 1.00
pnpm@HEAD 3.295 ± 0.083 3.183 3.469 3.21 ± 0.50
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.0379601934422222,
      "stddev": 0.10951183949751418,
      "median": 1.07417620922,
      "user": 1.075317168888889,
      "system": 0.3245633511111111,
      "min": 0.82835856722,
      "max": 1.16422003822
    },
    {
      "command": "pacquet@main",
      "mean": 1.0266773532200002,
      "stddev": 0.15739805242832605,
      "median": 1.0922293842200002,
      "user": 1.0830619466666667,
      "system": 0.34753924,
      "min": 0.67860341822,
      "max": 1.15458920422
    },
    {
      "command": "pnpm@HEAD",
      "mean": 3.2951183555533334,
      "stddev": 0.08334419835799005,
      "median": 3.29354404022,
      "user": 4.9324789466666665,
      "system": 0.23035768444444443,
      "min": 3.18333926922,
      "max": 3.46858004022
    }
  ]
}

Scenario: Isolated linker: linked-workspace resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 190.3 ± 5.7 183.5 200.6 1.00
pacquet@main 191.1 ± 5.5 180.8 200.3 1.00 ± 0.04
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.19034764723333333,
      "stddev": 0.005696355087817445,
      "median": 0.18806619630000002,
      "user": 0.14432535999999999,
      "system": 0.08021831333333333,
      "min": 0.1834742153,
      "max": 0.20057412630000002
    },
    {
      "command": "pacquet@main",
      "mean": 0.1910770556125,
      "stddev": 0.005509428311127265,
      "median": 0.19287059780000002,
      "user": 0.15511626,
      "system": 0.07140737999999999,
      "min": 0.18082768230000001,
      "max": 0.2002976673
    }
  ]
}

Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.477 ± 0.125 4.331 4.677 1.29 ± 0.05
pacquet@main 4.437 ± 0.184 4.286 4.718 1.28 ± 0.07
pnpr@HEAD 3.462 ± 0.105 3.366 3.660 1.00
pnpr@main 3.504 ± 0.133 3.375 3.769 1.01 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.477375182379999,
      "stddev": 0.12509544896773608,
      "median": 4.48129732658,
      "user": 1.4141876,
      "system": 1.3718750400000002,
      "min": 4.33051134358,
      "max": 4.6766043355799995
    },
    {
      "command": "pacquet@main",
      "mean": 4.436873436079999,
      "stddev": 0.18428878409555938,
      "median": 4.33623806708,
      "user": 1.3715794,
      "system": 1.3312055399999996,
      "min": 4.285625394579999,
      "max": 4.717831278579999
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.4618915890799995,
      "stddev": 0.10506220472980568,
      "median": 3.43083348408,
      "user": 1.2903784999999999,
      "system": 1.2939009399999999,
      "min": 3.36557696258,
      "max": 3.66034481658
    },
    {
      "command": "pnpr@main",
      "mean": 3.5043104132800003,
      "stddev": 0.13287030072093606,
      "median": 3.48357704958,
      "user": 1.2488465000000002,
      "system": 1.31064524,
      "min": 3.37546324358,
      "max": 3.76877668858
    }
  ]
}

Scenario: GVS linker: fresh restore, hot cache + hot store

Same install as the isolated fresh-restore hot/hot scenario, into the shared virtual store, the layout pnpm 12 installs into by default. Scenarios run on separate machines, so compare main and branch within each table.

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 123.4 ± 6.7 116.8 144.6 1.00 ± 0.07
pacquet@main 122.9 ± 4.4 114.5 132.1 1.00
pnpr@HEAD 135.0 ± 6.1 125.3 152.2 1.10 ± 0.06
pnpr@main 131.3 ± 3.7 125.0 137.4 1.07 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.1233994489325,
      "stddev": 0.006697926451080886,
      "median": 0.12235276162000001,
      "user": 0.1548077175,
      "system": 0.13604465249999997,
      "min": 0.11683836412000001,
      "max": 0.14463574512000002
    },
    {
      "command": "pacquet@main",
      "mean": 0.12290567207238096,
      "stddev": 0.004360294292023298,
      "median": 0.12371050912,
      "user": 0.1492638276190476,
      "system": 0.13792343523809522,
      "min": 0.11450013512000001,
      "max": 0.13206998712
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.13498070306444443,
      "stddev": 0.0061152746737954435,
      "median": 0.13360476212,
      "user": 0.15879105777777777,
      "system": 0.1400824511111111,
      "min": 0.12530390912,
      "max": 0.15224270412000002
    },
    {
      "command": "pnpr@main",
      "mean": 0.13125105722526317,
      "stddev": 0.003668270078114414,
      "median": 0.13166694012000002,
      "user": 0.16038978,
      "system": 0.13639923473684212,
      "min": 0.12495395312000002,
      "max": 0.13737527212
    }
  ]
}

@zkochan
zkochan marked this pull request as ready for review September 27, 2026 09:17
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Cover dot-directory pruning on managed workspace walks

🧪 Tests 🕐 20-40 Minutes

Grey Divider

AI Description

• Unifies template and managed-directory walk ignores through one compiler.
• Verifies project discovery matches with and without managed directories.
• Prevents recursive CLI scripts from running inside dot-prefixed directories.
Diagram

sequenceDiagram
    actor User
    participant CLI as Recursive CLI
    participant Discovery as Workspace Discovery
    participant Compiler as Ignore Compiler
    participant Walker as Glob Walker
    participant Scripts as Project Scripts
    User->>CLI: pnpm -r run build
    CLI->>Discovery: Discover with managed dirs
    Discovery->>Compiler: Compile all ignores
    Compiler-->>Discovery: Unified ignore matcher
    Discovery->>Walker: Walk with matcher
    Walker-->>Discovery: Visible manifests
    Discovery-->>CLI: Workspace projects
    CLI->>Scripts: Run visible builds
Loading
High-Level Assessment

The chosen approach is optimal: it preserves the cached ignore template while centralizing both cached and rebuilt matcher construction. Keeping separate assembly logic would retain the regression risk, while recompiling every matcher would remove the useful fast path without improving correctness.

Files changed (3) +96 / -27

Refactor (1) +32 / -25
projects.rsCentralize workspace walk ignore compilation +32/-25

Centralize workspace walk ignore compilation

• Introduces 'compile_walk_ignores' to assemble built-in, dot-component, positional, and managed-directory patterns consistently. Both the cached template and dynamically rebuilt ignore lists now use this helper, preventing their pruning behavior from diverging.

pnpm/crates/workspace/src/projects.rs

Tests (2) +64 / -2
run_recursive.rsAdd recursive CLI coverage for hidden workspace projects +40/-0

Add recursive CLI coverage for hidden workspace projects

• Adds an end-to-end test for a '**' workspace containing visible and dot-directory projects. It verifies recursive builds run only for the visible project when the CLI supplies managed directories.

pnpm/crates/cli/tests/suite/run_recursive.rs

tests.rsExercise discovery with and without managed directories +24/-2

Exercise discovery with and without managed directories

• Updates the shared project-discovery test helper to run every case through both the cached-template and managed-directory paths. It asserts both configurations discover identical project names.

pnpm/crates/workspace/src/projects/tests.rs

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (1) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. A test comment misstates unit coverage 📘 Rule violation ⚙ Maintainability
Description
recursive_run_skips_projects_under_dot_directories says the crate's unit tests pass no managed
directories, but find_project_names now runs every case both with and without one. Anyone using
this comment to understand regression coverage is sent to an obsolete distinction and may duplicate
or mis-scope later tests.
Code

pnpm/crates/cli/tests/suite/run_recursive.rs[R333-335]

+/// A `**` pattern must not reach a project under a dot-prefixed directory
+/// (pnpm/pnpm#16250). The CLI hands discovery its managed directories,
+/// which is the walk this pins; the crate's unit tests pass none by default.
Relevance

●●● Strong

Recent accepted precedents require comments to describe current behavior and accurate test
rationale.

PR-#15854
PR-#15600

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Rule 772199 requires modified comments to describe current behavior. The CLI test comment says unit
tests pass no managed directories, while the modified find_project_names helper explicitly runs
each case once without and once with a managed directory.

Rule 772199: Comments must describe current behavior, not historical implementations
pnpm/crates/cli/tests/suite/run_recursive.rs[333-335]
pnpm/crates/workspace/src/projects/tests.rs[30-41]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new CLI test comment says crate unit tests pass no managed directories, while the updated unit-test helper now exercises discovery both with and without a managed directory.

## Fix Focus Areas
- pnpm/crates/cli/tests/suite/run_recursive.rs[333-335]

## Recommended Fix
Replace the stale clause with the current distinction: the unit helper checks both ignore-building paths, while this end-to-end test proves that managed directories propagate through real recursive CLI execution.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
✅ Compliance rules (platform): 64 rules
✅ Skills: review-code
✅ Cross-repo context — repo relationships
  Explored: repo: pnpm/meta-updater (sha: c9936b78) — View relationship
Review mode: ⚖️ Balanced: This modifies workspace discovery and CLI traversal behavior, with performance-sensitive walk-ignore logic and multiple related test paths, but not enough independent logic to warrant extended review.

Grey Divider

Tip of the day
💡 Did you know, you can describe a rule in plain language on the Rules page and Qodo drafts it for you

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Sep 27, 2026
@zkochan
zkochan merged commit d1afdd3 into main Sep 27, 2026
53 checks passed
@zkochan
zkochan deleted the test/dot-pruning-production-path branch September 27, 2026 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product: pacquet reviewed: coderabbit CodeRabbit submitted an approving review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants