Repository navigation
test(catalogs): cover catalog inheritance of injected workspace packages - #17295
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
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, injected, and Cargo workspace scenarios compare 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": 3.2951742304200002,
"stddev": 0.3567389196681488,
"median": 3.37184678192,
"user": 3.4375944599999997,
"system": 2.52836996,
"min": 2.83397121642,
"max": 3.8959179064200002
},
{
"command": "pacquet@main",
"mean": 3.13256087942,
"stddev": 0.2733418803892817,
"median": 3.17110150342,
"user": 3.48464896,
"system": 2.4988969599999997,
"min": 2.78406679442,
"max": 3.59181020942
},
{
"command": "pnpr@HEAD",
"mean": 2.0256548416199998,
"stddev": 0.22129664236668803,
"median": 2.00073166692,
"user": 3.05780576,
"system": 2.53381396,
"min": 1.71537966242,
"max": 2.3614046604200003
},
{
"command": "pnpr@main",
"mean": 2.1136491741200003,
"stddev": 0.19650705712531896,
"median": 2.2003896439200004,
"user": 3.1988221599999997,
"system": 2.6430212600000003,
"min": 1.79117842142,
"max": 2.36446831742
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.4385690136,
"stddev": 0.03692517974670612,
"median": 0.4403257608,
"user": 0.5394196599999999,
"system": 0.94327326,
"min": 0.37802033030000004,
"max": 0.5139582833
},
{
"command": "pacquet@main",
"mean": 0.39859509340000004,
"stddev": 0.019652253267982662,
"median": 0.4008555373,
"user": 0.48786845999999995,
"system": 0.8981155599999999,
"min": 0.37115720430000004,
"max": 0.4334693593
},
{
"command": "pnpr@HEAD",
"mean": 0.48237714470000004,
"stddev": 0.04174403679734478,
"median": 0.46576078880000005,
"user": 0.54840316,
"system": 1.0018381599999997,
"min": 0.4407103893,
"max": 0.5722934203000001
},
{
"command": "pnpr@main",
"mean": 0.4379279689000001,
"stddev": 0.030619011441894488,
"median": 0.4407619838,
"user": 0.48138696000000003,
"system": 0.91557586,
"min": 0.3972772103,
"max": 0.4705856223
}
]
}Scenario: Isolated linker: repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.019847677605909088,
"stddev": 0.004366980676455497,
"median": 0.019592550640000005,
"user": 0.010367257272727273,
"system": 0.011149601136363636,
"min": 0.012986930640000002,
"max": 0.03377230264
},
{
"command": "pacquet@main",
"mean": 0.019455082963076926,
"stddev": 0.003691751300792604,
"median": 0.019080578640000005,
"user": 0.010179203076923072,
"system": 0.010879032153846148,
"min": 0.01218460464,
"max": 0.027817709640000004
},
{
"command": "pnpr@HEAD",
"mean": 0.0196824743369697,
"stddev": 0.0036516525797490773,
"median": 0.020278111640000002,
"user": 0.010113290101010104,
"system": 0.011123211919191911,
"min": 0.012699362640000001,
"max": 0.028036762640000004
},
{
"command": "pnpr@main",
"mean": 0.02006469887076924,
"stddev": 0.0032830895252461945,
"median": 0.02003578564,
"user": 0.009880895384615385,
"system": 0.011794223076923077,
"min": 0.013948501640000001,
"max": 0.027507293640000003
}
]
}Scenario: Isolated linker: repeat install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.009809012070769224,
"stddev": 0.0011136989508921072,
"median": 0.00959750824,
"user": 0.00589428,
"system": 0.004765019,
"min": 0.00798958824,
"max": 0.01297505524
},
{
"command": "pacquet@main",
"mean": 0.010464297711482889,
"stddev": 0.001791730212930965,
"median": 0.01008395724,
"user": 0.006383035893536117,
"system": 0.004964861977186311,
"min": 0.00787741824,
"max": 0.019568034240000004
},
{
"command": "pnpr@HEAD",
"mean": 0.016102010150931174,
"stddev": 0.0030720772580534886,
"median": 0.016030361240000002,
"user": 0.009011333441295536,
"system": 0.008459753684210527,
"min": 0.00925340624,
"max": 0.024373341240000002
},
{
"command": "pnpr@main",
"mean": 0.014245007054606738,
"stddev": 0.0026383710300342585,
"median": 0.01351687474,
"user": 0.0081807395505618,
"system": 0.007201136629213484,
"min": 0.01069626924,
"max": 0.02289890824
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.9888040950200003,
"stddev": 0.09088299745483289,
"median": 2.97823837102,
"user": 4.12257774,
"system": 2.66414392,
"min": 2.87989834152,
"max": 3.20146986952
},
{
"command": "pacquet@main",
"mean": 3.0492105280200006,
"stddev": 0.08291309315516095,
"median": 3.04993270752,
"user": 4.300797740000001,
"system": 2.6644249199999996,
"min": 2.92615632952,
"max": 3.16353866852
},
{
"command": "pnpr@HEAD",
"mean": 1.75631486332,
"stddev": 0.09098159449417281,
"median": 1.72344779152,
"user": 3.12728964,
"system": 2.24823902,
"min": 1.6553589185200002,
"max": 1.9028250125200001
},
{
"command": "pnpr@main",
"mean": 1.7536132499200001,
"stddev": 0.06883819406657037,
"median": 1.75215367402,
"user": 3.0008795399999997,
"system": 2.19786302,
"min": 1.63200867852,
"max": 1.86347140652
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.04069181824,
"stddev": 0.17653498866331246,
"median": 0.99648181124,
"user": 1.48324786,
"system": 1.35295396,
"min": 0.86095116724,
"max": 1.4223272042400001
},
{
"command": "pacquet@main",
"mean": 1.2547898161400002,
"stddev": 0.2219711013228713,
"median": 1.2169803157400003,
"user": 1.6022490600000001,
"system": 1.4390441600000001,
"min": 1.0148144082400001,
"max": 1.7254210572400002
},
{
"command": "pnpr@HEAD",
"mean": 0.52660798384,
"stddev": 0.08741902386863747,
"median": 0.49552518324,
"user": 0.49916675999999993,
"system": 0.9175961599999999,
"min": 0.41942839024,
"max": 0.6751690112400001
},
{
"command": "pnpr@main",
"mean": 0.43477302654,
"stddev": 0.030113140954023475,
"median": 0.43728078124,
"user": 0.43486046,
"system": 0.80291856,
"min": 0.38600289124,
"max": 0.47957441624
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.8734319769199999,
"stddev": 0.12657494644515097,
"median": 1.8522930237200002,
"user": 1.34533448,
"system": 1.197068,
"min": 1.7128131717200001,
"max": 2.09182233672
},
{
"command": "pacquet@main",
"mean": 1.9900153482199996,
"stddev": 0.1775224233341118,
"median": 1.9667452242199999,
"user": 1.54166688,
"system": 1.2796615999999998,
"min": 1.75268120072,
"max": 2.2760981117199997
},
{
"command": "pnpr@HEAD",
"mean": 0.44747691032,
"stddev": 0.029702410462735543,
"median": 0.45090399872000003,
"user": 0.42540737999999995,
"system": 0.8284146,
"min": 0.39704996172,
"max": 0.49994337272000006
},
{
"command": "pnpr@main",
"mean": 0.41233568462000003,
"stddev": 0.03752292483700905,
"median": 0.41756865722000003,
"user": 0.40666138000000007,
"system": 0.7774091999999999,
"min": 0.36583411872000005,
"max": 0.47277434772000004
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.35012338362000006,
"stddev": 0.05239880286949417,
"median": 0.33059628782000006,
"user": 0.35016433999999996,
"system": 0.15383693999999998,
"min": 0.31060338732000004,
"max": 0.49029734632000005
},
{
"command": "pacquet@main",
"mean": 0.31575886552000004,
"stddev": 0.013137566601114679,
"median": 0.31213817582000003,
"user": 0.31827194,
"system": 0.12831343999999997,
"min": 0.29887752932,
"max": 0.33462133032
},
{
"command": "pnpr@HEAD",
"mean": 0.11164924062769234,
"stddev": 0.005998479724305591,
"median": 0.11033165132,
"user": 0.04698635538461538,
"system": 0.02171435538461538,
"min": 0.09844207432,
"max": 0.12347395132000001
},
{
"command": "pnpr@main",
"mean": 0.10453240560000002,
"stddev": 0.005426319383070761,
"median": 0.10639560732000002,
"user": 0.043433780000000005,
"system": 0.018479480000000003,
"min": 0.09525028732000002,
"max": 0.11222607132000001
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.28885886866,
"stddev": 0.02450063881075662,
"median": 0.28492166666,
"user": 0.28980643333333334,
"system": 0.07812683555555555,
"min": 0.25280834366,
"max": 0.32786193166
},
{
"command": "pacquet@main",
"mean": 0.26525868799333335,
"stddev": 0.022134406124391322,
"median": 0.25898818466,
"user": 0.27992165555555554,
"system": 0.060499279999999996,
"min": 0.24143471766000002,
"max": 0.31411803166
},
{
"command": "pnpm@HEAD",
"mean": 5.549572879326667,
"stddev": 0.823162727444264,
"median": 5.396026060660001,
"user": 8.803031988888888,
"system": 0.5339923911111111,
"min": 4.46505048866,
"max": 6.98472477566
}
]
}Scenario: Isolated linker: linked-workspace resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.1515874161955556,
"stddev": 0.02416137163593078,
"median": 0.14806975064,
"user": 0.13634329333333334,
"system": 0.07569000444444444,
"min": 0.11803783314,
"max": 0.20916885114000003
},
{
"command": "pacquet@main",
"mean": 0.1670758644316667,
"stddev": 0.030401226149308423,
"median": 0.16036240564,
"user": 0.14407941833333332,
"system": 0.08588414333333333,
"min": 0.11913662514000001,
"max": 0.22387759614000002
}
]
}Scenario: Isolated linker: injected workspace repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.12602991054333335,
"stddev": 0.00686705038635747,
"median": 0.12600562896,
"user": 0.054706078333333324,
"system": 0.08182991166666666,
"min": 0.11499169046,
"max": 0.13915969246
},
{
"command": "pacquet@main",
"mean": 0.1509366129863158,
"stddev": 0.015025503925308189,
"median": 0.15144649446,
"user": 0.06656675157894737,
"system": 0.09688712,
"min": 0.12913929146,
"max": 0.18039562746
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 5.31098934552,
"stddev": 0.2419776076495823,
"median": 5.31279309562,
"user": 3.5370676800000007,
"system": 2.60741642,
"min": 4.90267701162,
"max": 5.60273659262
},
{
"command": "pacquet@main",
"mean": 5.40849154802,
"stddev": 0.5192863748630484,
"median": 5.16793297062,
"user": 3.5238746799999996,
"system": 2.60655272,
"min": 4.97899164562,
"max": 6.43078667562
},
{
"command": "pnpr@HEAD",
"mean": 4.16212768572,
"stddev": 0.2628633071695536,
"median": 4.12051013612,
"user": 3.02857758,
"system": 2.34975222,
"min": 3.7330110436200004,
"max": 4.49125119462
},
{
"command": "pnpr@main",
"mean": 4.08841108412,
"stddev": 0.21307623004758072,
"median": 4.1245275366200005,
"user": 2.9493082799999994,
"system": 2.26291382,
"min": 3.69978074562,
"max": 4.43118966662
}
]
}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.20368091926333334,
"stddev": 0.014051879313882456,
"median": 0.20746667818,
"user": 0.23403791,
"system": 0.19084676666666664,
"min": 0.17655175518,
"max": 0.21927475818
},
{
"command": "pacquet@main",
"mean": 0.2077407682709091,
"stddev": 0.014911338553735914,
"median": 0.20733761818000002,
"user": 0.2568349781818182,
"system": 0.1795872818181818,
"min": 0.17510192118,
"max": 0.22648233018
},
{
"command": "pnpr@HEAD",
"mean": 0.2315042972709091,
"stddev": 0.02090564833657838,
"median": 0.23334613118,
"user": 0.25838597818181824,
"system": 0.21016837272727276,
"min": 0.20453468718,
"max": 0.25884893118
},
{
"command": "pnpr@main",
"mean": 0.2512270718163636,
"stddev": 0.06269762024689461,
"median": 0.23112255218,
"user": 0.29043634181818184,
"system": 0.21619473636363634,
"min": 0.20387338818,
"max": 0.41677420618
}
]
}Scenario: Store only: unlocked direct deps, cold cache + hot storeStore-only install (
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.5739962223200001,
"stddev": 0.0566018372545303,
"median": 1.57570872702,
"user": 1.1471778999999998,
"system": 0.40089828,
"min": 1.4718278175200001,
"max": 1.6558148535200001
},
{
"command": "pacquet@main",
"mean": 1.5407323799200001,
"stddev": 0.08150427968755405,
"median": 1.52580462802,
"user": 1.0736884999999998,
"system": 0.3671762799999999,
"min": 1.4313217305200001,
"max": 1.68286865252
}
]
}Scenario: Cargo: repeat install, hot cache + hot storeFrozen repeat install of a Cargo workspace (
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.05201881873310346,
"stddev": 0.005965595122528254,
"median": 0.051276874439999995,
"user": 0.03784849517241378,
"system": 0.027274513793103444,
"min": 0.042963394440000004,
"max": 0.06685406344
},
{
"command": "pacquet@main",
"mean": 0.04948131019000002,
"stddev": 0.0062273273620800824,
"median": 0.04826106544,
"user": 0.035172640000000005,
"system": 0.02702193333333334,
"min": 0.04024732944,
"max": 0.06619327944
}
]
} |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #17295 +/- ##
=======================================
Coverage 93.11% 93.11%
=======================================
Files 2193 2193
Lines 278356 278356
=======================================
+ Hits 259184 259201 +17
+ Misses 19172 19155 -17 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Nothing new recorded1 job recorded · compared with the last 10 runs on TS CI / Test / ubuntu (24.0.0, 2) / Node 24 / chunk 2/3
|
The resolver fix for pnpm#17280 landed in pnpm#17297, which tags a workspace: specifier "workspace" in the local resolver. This keeps the extra coverage: relative workspace: paths with default and named catalogs, injection through injectWorkspacePackages and through dependenciesMeta, and the rejection of catalog: references in ordinary file: dependencies, in both CLIs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
7abd13a to
c52a64b
Compare
|
Rebased onto main and reworked. Status:
Nothing else is left to do on this PR. Written by an agent (Claude Code, claude-opus-5-5). |
PR Summary by QodoTest catalog inheritance for injected workspace packages in v11 and v12
AI Description
Merge Risk
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can add REVIEW.md to your repo root and Qodo follows it on every PR
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
[Low impact] This test-only PR appears safe to merge. Reviews (2) · Last reviewed commit: "test(catalogs): cover catalog inheritanc..." · Reviewed by Greptile |
…18290) The resolver passed the child specifiers of every file: directory package through the importer's catalogs, however the package was declared. An ordinary file: dependency outside the workspace therefore resolved its catalog: specifiers instead of failing with ERR_PNPM_UNSUPPORTED_PROTOCOL, which pnpm v11 reports. The test added in #17295 has failed on main since it landed. Catalogs now apply to a directory package's children only when it was resolved through a workspace: specifier, as in pnpm v11, or when its directory is a workspace project. The second case keeps the v12 behavior for a workspace project injected by a file: or bare path, which the injected freshness matrix covers and pnpm v11 does not support.
Summary
Adds regression coverage for catalog resolution in injected workspace packages, in pnpm v11 and v12. Refs #17280.
The resolver fix for #17280 landed in #17297 while this PR was open: the local resolver now tags a
workspace:specifierresolvedVia: "workspace", so the existing catalog gate covers relative paths. The resolver changes this PR originally made became dead code after rebasing, so they and the changeset were removed. The tests remain because they cover cases the merged fix does not:workspace:paths with the default catalog and a named catalog,dependenciesMeta.<name>.injectedas well asinjectWorkspacePackages,file:dependency still rejectingcatalog:references (ERR_PNPM_UNSUPPORTED_PROTOCOL), injected or not.Squash Commit Body
Checklist
Validation
cargo nextest run -p pnpm-cli -E 'test(/inject_workspace_packages::catalogs/)': 7 passed.jest test/catalogs.ts -t 'injected|inject-workspace|file dependencies|relative'in@pnpm/installing.deps-installer: 9 passed.pnpm run ci:rust-fmtand the pre-push checks (clippy, typos, taplo, dylint) passed.Original change written by an agent (Codex, GPT-6). Rebased onto main and reduced to test coverage by an agent (Claude Code, claude-opus-5-5).
Summary by CodeRabbit