Repository navigation
fix(workspace): restore dot-directory pruning during discovery - #16252
Conversation
manifest_walk_ignores rebuilt the walk ignores from IGNORE_PATTERNS, the positional dot ignores, and the globs for the pnpm-managed directories whenever a managed directory was configured, and dropped DOT_COMPONENT_IGNORE_PATTERN from the union. Only the template path kept the dot pruning, and discovery from the CLI always passes managed directories, so the generic walk never reached it. A wildcard such as `**` therefore matched packages inside `.cache` and other dot-prefixed directories, and the walk descended into them even when the pattern excluded the directory, so one malformed manifest under an excluded hidden directory aborted discovery. Keep DOT_COMPONENT_IGNORE_PATTERN in the rebuilt list whenever the include pattern does not name a dot component itself, matching the rule the template and the positional ignores already apply. Closes pnpm#16250.
|
💖 Thanks for opening this pull request! 💖 |
|
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 configurationConfiguration used: Repository: pnpm/pnpm/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughWorkspace discovery now retains dot-directory pruning when managed directories are configured. A regression test checks that the ChangesWorkspace discovery
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Assessment against linked issues
Suggested labels: Merge Risk: ⚪ Minimal · up to Wildcard workspace discovery excludes hidden directories while still allowing explicitly named dot components. No concrete merge-blocking risk remains. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change restores exclusion of hidden directories from ordinary wildcard discovery. No new exposure was identified, but the effect on all downstream workspace operations was not established. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #16252 +/- ##
==========================================
+ Coverage 92.07% 92.09% +0.01%
==========================================
Files 1487 1489 +2
Lines 200527 201056 +529
==========================================
+ Hits 184639 185154 +515
- Misses 15888 15902 +14 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Same-run regression checkHEAD 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.
Integrated-Benchmark Report (Linux)Commit: 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
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.4518104091999997,
"stddev": 0.11094202542378388,
"median": 2.4304383257,
"user": 1.51708124,
"system": 1.6984696,
"min": 2.3221783407,
"max": 2.6144810157
},
{
"command": "pacquet@main",
"mean": 2.5643037744,
"stddev": 0.17351262063244627,
"median": 2.5549119202,
"user": 1.73248934,
"system": 2.0448239999999993,
"min": 2.3576936517,
"max": 2.8459559027
},
{
"command": "pnpr@HEAD",
"mean": 1.4331091174000001,
"stddev": 0.08115424116371937,
"median": 1.4152858392,
"user": 1.4799915399999999,
"system": 1.7152353000000002,
"min": 1.3472238047000002,
"max": 1.5928102047000001
},
{
"command": "pnpr@main",
"mean": 1.5371036903,
"stddev": 0.10184656245315724,
"median": 1.4955830217000001,
"user": 1.47603794,
"system": 1.6660379999999997,
"min": 1.4106975257,
"max": 1.6875378027000003
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.21864767440000002,
"stddev": 0.010877446570664922,
"median": 0.2206635964,
"user": 0.23446081999999996,
"system": 0.52555052,
"min": 0.2026280839,
"max": 0.2398206139
},
{
"command": "pacquet@main",
"mean": 0.23316713490000002,
"stddev": 0.009941940176632356,
"median": 0.2311831769,
"user": 0.25336682,
"system": 0.58132202,
"min": 0.2139309149,
"max": 0.2528776589
},
{
"command": "pnpr@HEAD",
"mean": 0.24964469499999997,
"stddev": 0.010600981195669747,
"median": 0.2505735384,
"user": 0.26535462,
"system": 0.5739724199999999,
"min": 0.2367100529,
"max": 0.27153529890000005
},
{
"command": "pnpr@main",
"mean": 0.23704060869999996,
"stddev": 0.008331616049699519,
"median": 0.23852239190000002,
"user": 0.24674161999999997,
"system": 0.56029982,
"min": 0.2212177869,
"max": 0.2471221229
}
]
}Scenario: Isolated linker: repeat install, hot cache + hot store
Confirmation (reversed target order)
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.014929834160952378,
"stddev": 0.0022197375907214148,
"median": 0.01484732178,
"user": 0.008461539047619048,
"system": 0.0072833376190476196,
"min": 0.0075040387800000006,
"max": 0.02072907978
},
{
"command": "pacquet@main",
"mean": 0.00863453746918919,
"stddev": 0.0008824784679835348,
"median": 0.00844511478,
"user": 0.004896986891891889,
"system": 0.004259481486486483,
"min": 0.00719826878,
"max": 0.01200752478
},
{
"command": "pnpr@HEAD",
"mean": 0.007976594917380184,
"stddev": 0.0006676160240546091,
"median": 0.007871566780000002,
"user": 0.004262164281150162,
"system": 0.004142114440894568,
"min": 0.006766089780000001,
"max": 0.01055111878
},
{
"command": "pnpr@main",
"mean": 0.008135324400253177,
"stddev": 0.0006540040689201281,
"median": 0.00801803178,
"user": 0.004197704177215191,
"system": 0.004442801835443037,
"min": 0.006932528780000001,
"max": 0.01054028878
}
],
"confirmation": {
"results": [
{
"command": "pnpr@main",
"mean": 0.008930906397809179,
"stddev": 0.0006087325953253689,
"median": 0.008863729260000001,
"user": 0.0049500466431095375,
"system": 0.004504465017667845,
"min": 0.007413119260000001,
"max": 0.01101761826
},
{
"command": "pnpr@HEAD",
"mean": 0.008239390414340847,
"stddev": 0.0005855469171947259,
"median": 0.008202799260000001,
"user": 0.004468808360128618,
"system": 0.004226005466237942,
"min": 0.006949249260000001,
"max": 0.01211319926
},
{
"command": "pacquet@main",
"mean": 0.007845897983809523,
"stddev": 0.0004646124866272727,
"median": 0.00784326926,
"user": 0.004458003174603175,
"system": 0.003816268571428572,
"min": 0.006945909260000001,
"max": 0.01235163826
},
{
"command": "pacquet@HEAD",
"mean": 0.008936686080668697,
"stddev": 0.002499069586955815,
"median": 0.00812337026,
"user": 0.0047363908814589606,
"system": 0.0047061553191489304,
"min": 0.006950449260000001,
"max": 0.01954716826
}
]
}
}Scenario: Isolated linker: repeat install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.007462151083529414,
"stddev": 0.00046117114559623555,
"median": 0.007406060760000001,
"user": 0.004553728382352942,
"system": 0.0033268452941176466,
"min": 0.0066992777600000004,
"max": 0.00991108576
},
{
"command": "pacquet@main",
"mean": 0.007717971000677969,
"stddev": 0.0008107944114785976,
"median": 0.007511923760000001,
"user": 0.0043536362711864415,
"system": 0.0037957483389830502,
"min": 0.006642571760000001,
"max": 0.01136418376
},
{
"command": "pnpr@HEAD",
"mean": 0.007876616134149656,
"stddev": 0.0005057232260929957,
"median": 0.00777564826,
"user": 0.004718664081632654,
"system": 0.0036195697278911527,
"min": 0.006991126760000001,
"max": 0.009886349760000001
},
{
"command": "pnpr@main",
"mean": 0.013961230841560285,
"stddev": 0.0027397738215047453,
"median": 0.014358297760000001,
"user": 0.007919112482269501,
"system": 0.006708597943262411,
"min": 0.007650091760000002,
"max": 0.02016517076
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.6188584638199996,
"stddev": 0.052168698062094086,
"median": 2.6051654916199998,
"user": 2.10713158,
"system": 2.0315336,
"min": 2.58574373962,
"max": 2.76254823662
},
{
"command": "pacquet@main",
"mean": 2.61001654662,
"stddev": 0.024471983489426984,
"median": 2.6069437331199996,
"user": 2.0891979800000002,
"system": 1.9907124,
"min": 2.58199750662,
"max": 2.67110058562
},
{
"command": "pnpr@HEAD",
"mean": 1.54994259382,
"stddev": 0.11492147706727408,
"median": 1.49594160262,
"user": 1.33106188,
"system": 1.5590351,
"min": 1.44869080862,
"max": 1.7756311016200002
},
{
"command": "pnpr@main",
"mean": 1.5723179612200002,
"stddev": 0.11961147890884766,
"median": 1.51883823512,
"user": 1.34410618,
"system": 1.6428698999999998,
"min": 1.45278645562,
"max": 1.7681337616200001
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.6052815597200001,
"stddev": 0.02199612294312429,
"median": 0.6040253062200001,
"user": 0.7908174599999999,
"system": 1.0605398199999998,
"min": 0.5757128867200001,
"max": 0.64575646072
},
{
"command": "pacquet@main",
"mean": 0.5897856625200001,
"stddev": 0.019538087464894556,
"median": 0.58698487322,
"user": 0.79298706,
"system": 1.02829222,
"min": 0.5601858207200001,
"max": 0.61824783672
},
{
"command": "pnpr@HEAD",
"mean": 0.34656493922,
"stddev": 0.010509678161931723,
"median": 0.34756295272000004,
"user": 0.30286695999999996,
"system": 0.74598642,
"min": 0.32526763872,
"max": 0.35977276472
},
{
"command": "pnpr@main",
"mean": 0.35719696142,
"stddev": 0.008012455819538867,
"median": 0.35316630072,
"user": 0.32383116,
"system": 0.7747502199999999,
"min": 0.35073240972,
"max": 0.37476093172
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.70167836796,
"stddev": 0.11225374375359888,
"median": 1.65766786596,
"user": 0.97751356,
"system": 0.96826636,
"min": 1.62435518396,
"max": 1.94929767796
},
{
"command": "pacquet@main",
"mean": 1.63002651766,
"stddev": 0.03209452491427181,
"median": 1.6282414309599997,
"user": 0.87185136,
"system": 0.7854130599999999,
"min": 1.57076349796,
"max": 1.6765276279599999
},
{
"command": "pnpr@HEAD",
"mean": 0.30870948156000005,
"stddev": 0.018612481775984662,
"median": 0.30533826646000006,
"user": 0.26993725999999996,
"system": 0.57935936,
"min": 0.28476457496,
"max": 0.35164460696000005
},
{
"command": "pnpr@main",
"mean": 0.33326695376000004,
"stddev": 0.030482409499348564,
"median": 0.34790309696000005,
"user": 0.28638956000000004,
"system": 0.6568280599999999,
"min": 0.28958362096,
"max": 0.37733133096000004
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.24945023332,
"stddev": 0.03218970790096994,
"median": 0.23663385732000003,
"user": 0.23822566000000003,
"system": 0.08992354,
"min": 0.21795555832000002,
"max": 0.32692803432
},
{
"command": "pacquet@main",
"mean": 0.32901392982000005,
"stddev": 0.012520577961982807,
"median": 0.33017215632,
"user": 0.31281106,
"system": 0.12327804,
"min": 0.30825340032000004,
"max": 0.34542484232000004
},
{
"command": "pnpr@HEAD",
"mean": 0.10960968871999999,
"stddev": 0.003036942364276033,
"median": 0.10843919032,
"user": 0.044767280000000007,
"system": 0.020716159999999997,
"min": 0.10431256632000001,
"max": 0.11599519932
},
{
"command": "pnpr@main",
"mean": 0.09738821176,
"stddev": 0.006057944546987279,
"median": 0.09648721232,
"user": 0.035824,
"system": 0.017536519999999996,
"min": 0.08911239332,
"max": 0.11328043532
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.8608816206066668,
"stddev": 0.12076053471209912,
"median": 0.85694302994,
"user": 0.886794928888889,
"system": 0.30407942,
"min": 0.59369479394,
"max": 1.0493422859400001
},
{
"command": "pacquet@main",
"mean": 0.8708609816066666,
"stddev": 0.12216918889089405,
"median": 0.90988145894,
"user": 0.8868594844444444,
"system": 0.2729045311111111,
"min": 0.5933077249400001,
"max": 0.9837544219400001
},
{
"command": "pnpm@HEAD",
"mean": 3.0650232216066673,
"stddev": 0.10976893700479977,
"median": 3.11484380994,
"user": 4.821854373333332,
"system": 0.21219997555555553,
"min": 2.92487101094,
"max": 3.22355485294
}
]
}Scenario: Isolated linker: linked-workspace resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.2097110909676923,
"stddev": 0.004879722192567123,
"median": 0.20957174766,
"user": 0.17598327692307691,
"system": 0.0730168076923077,
"min": 0.20105192666,
"max": 0.21698601166
},
{
"command": "pacquet@main",
"mean": 0.21830123066,
"stddev": 0.007475688534897828,
"median": 0.21736355466,
"user": 0.18355527692307694,
"system": 0.07694880769230769,
"min": 0.20768274366,
"max": 0.22977531766
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.49003438464,
"stddev": 0.17875573268279607,
"median": 4.453865710740001,
"user": 1.47769934,
"system": 1.4978767400000002,
"min": 4.27630825974,
"max": 4.85053565774
},
{
"command": "pacquet@main",
"mean": 4.48023503574,
"stddev": 0.15097620335650508,
"median": 4.47905598424,
"user": 1.44332464,
"system": 1.3571840399999997,
"min": 4.31443749574,
"max": 4.761673985740001
},
{
"command": "pnpr@HEAD",
"mean": 3.46825369324,
"stddev": 0.09067644847741259,
"median": 3.47832870274,
"user": 1.28002334,
"system": 1.3571721399999999,
"min": 3.3567795007399996,
"max": 3.6071403307399996
},
{
"command": "pnpr@main",
"mean": 3.4291017985399996,
"stddev": 0.05683509683473159,
"median": 3.4183047222400003,
"user": 1.32706604,
"system": 1.3180361399999998,
"min": 3.36317396474,
"max": 3.5314625127399997
}
]
}Scenario: GVS linker: fresh restore, hot cache + hot storeSame 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.
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.13135646879999996,
"stddev": 0.004970921494558769,
"median": 0.13026290540000002,
"user": 0.15858018000000002,
"system": 0.14719260999999995,
"min": 0.12532045590000002,
"max": 0.1442459099
},
{
"command": "pacquet@main",
"mean": 0.13357008221578948,
"stddev": 0.01179871819796059,
"median": 0.1323122099,
"user": 0.15904210105263158,
"system": 0.1450890231578947,
"min": 0.1132344089,
"max": 0.1601057969
},
{
"command": "pnpr@HEAD",
"mean": 0.13315021595,
"stddev": 0.00921413554915481,
"median": 0.1309019019,
"user": 0.15402138,
"system": 0.13110050999999998,
"min": 0.1221512909,
"max": 0.1543877429
},
{
"command": "pnpr@main",
"mean": 0.14719164001111112,
"stddev": 0.0026524790293542817,
"median": 0.14707893789999998,
"user": 0.1774185688888889,
"system": 0.14344992666666667,
"min": 0.1417723229,
"max": 0.1518413389
}
]
} |
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Congrats on merging your first pull request! 🎉🎉🎉 |
…#16254) 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]>
Summary
Restores the dot-directory pruning that #15262 dropped from the generic workspace walk. A
packageswildcard such as**no longer discovers projects inside.cacheand other hidden directories, and the walk no longer descends into a hidden directory that the pattern excludes.Closes #16250.
Closes #3811.
Rust-only: pnpm v11 already prunes dot directories, so no v11 change is needed.
manifest_walk_ignores()returns the dot-pruning template only when the managed-directory list is empty. Discovery from the CLI always passes managed directories (node_modules, the virtual store, and so on), so the else branch rebuilt the walk ignores fromIGNORE_PATTERNS, the positional dot ignores, and the managed ignores, andDOT_COMPONENT_IGNORE_PATTERNwas left out. The fix keeps that pattern in the union whenever the include pattern does not name a dot component itself, the same rule the template path applies.Testing
[email protected]and[email protected]: a workspace withpackages: ["**"],pkgs/a,pkgs/b, and.cache/hidden/package.json; 12.7.0 lists.cache/hiddeninpnpm -r list --depth -1, while 12.6.0 and 11.28.0 list onlypkgs/aandpkgs/b.skips_dot_directories_when_a_managed_directory_is_configuredfails on the unfixed tree and passes with the fix.pnpm test:rust -p pnpm-workspace: 114 tests passed.pnpm-cli: the fixture above lists onlypkgs/aandpkgs/b. With a malformed manifest under.cache,[email protected]fails discovery withERR_PNPM_PACKAGE_MANIFEST_SERIALIZATION_ERROR, while the fixed build and 12.6.0 succeed.Squash Commit Body
Checklist
pnpm changeset) if this PR changes any published package. Keep it short and written for pnpm users — it becomes a release note.Written by an agent (Kimi Code).
Summary by CodeRabbit
.cache, when using the**pattern. Regular projects and the workspace root continue to be discovered. This prevents hidden directories from being included in workspace results.