Repository navigation
fix(install): preserve hoisted prior groups and check transitive local deps under --filter - #17138
Conversation
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
PR Summary by QodoPreserve hoisted groups and validate local dependencies in filtered installs
AI Description
Diagram
High-Level Assessment
Files changed (29)
|
Code Review by Qodo
1.
|
PR Code Suggestions ✨Latest suggestions up to 9910b71 Warning
Previous suggestionsSuggestions up to commit 0ae65e6
Suggestions up to commit d9c5dd8
Suggestions up to commit 4e334ff
Suggestions up to commit a4ebc79
Suggestions
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Micro-Benchmark ResultsLinux |
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 and injected 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": 2.8173332682199996,
"stddev": 0.13754910681048368,
"median": 2.8130970587200004,
"user": 2.6617595999999994,
"system": 1.9872439399999997,
"min": 2.61301001722,
"max": 3.10039031222
},
{
"command": "pacquet@main",
"mean": 2.7654994413200003,
"stddev": 0.059841738297897386,
"median": 2.74144785072,
"user": 2.6980475999999998,
"system": 1.9169491399999998,
"min": 2.71530122822,
"max": 2.90451241722
},
{
"command": "pnpr@HEAD",
"mean": 1.5443710075200001,
"stddev": 0.12356151497754085,
"median": 1.47933908222,
"user": 2.1908323999999997,
"system": 1.70584744,
"min": 1.45375894122,
"max": 1.78602364222
},
{
"command": "pnpr@main",
"mean": 1.56350599732,
"stddev": 0.10545669572627549,
"median": 1.54083246772,
"user": 2.4558994999999992,
"system": 1.8587413399999995,
"min": 1.42742948022,
"max": 1.7314876032200002
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.35607357262,
"stddev": 0.08274498856341525,
"median": 0.32997530661999996,
"user": 0.40709928,
"system": 0.73607406,
"min": 0.28539608912000003,
"max": 0.53245191412
},
{
"command": "pacquet@main",
"mean": 0.34908952252000003,
"stddev": 0.03164475345815324,
"median": 0.34769795162,
"user": 0.41536777999999996,
"system": 0.7683666599999999,
"min": 0.30659984712,
"max": 0.40098387912
},
{
"command": "pnpr@HEAD",
"mean": 0.38100801652000005,
"stddev": 0.03978295375605648,
"median": 0.37737600112,
"user": 0.42606567999999995,
"system": 0.7583055599999999,
"min": 0.32454224312,
"max": 0.44027828512
},
{
"command": "pnpr@main",
"mean": 0.37449873362,
"stddev": 0.03165685510123672,
"median": 0.38022867212,
"user": 0.42346048,
"system": 0.7521069600000001,
"min": 0.32640224412,
"max": 0.42333920312
}
]
}Scenario: Isolated linker: repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.011626244868672572,
"stddev": 0.0012521401181031671,
"median": 0.01140247782,
"user": 0.0067542867256637175,
"system": 0.006022195221238943,
"min": 0.00940134032,
"max": 0.018104595320000003
},
{
"command": "pacquet@main",
"mean": 0.01217412732,
"stddev": 0.0016785003877083059,
"median": 0.01176314132,
"user": 0.007073140425531917,
"system": 0.006269019744680856,
"min": 0.00928237632,
"max": 0.02132367732
},
{
"command": "pnpr@HEAD",
"mean": 0.013949209720862074,
"stddev": 0.0028646940889332276,
"median": 0.01317583282,
"user": 0.007832989655172406,
"system": 0.007358209482758616,
"min": 0.00966051732,
"max": 0.024828197320000002
},
{
"command": "pnpr@main",
"mean": 0.015814951526250006,
"stddev": 0.0015347789942331107,
"median": 0.015647575820000002,
"user": 0.00873585,
"system": 0.008519133250000002,
"min": 0.01267099832,
"max": 0.020160090320000004
}
]
}Scenario: Isolated linker: repeat install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.013477064928070185,
"stddev": 0.001509057183359422,
"median": 0.013338396700000001,
"user": 0.007683750760233917,
"system": 0.007267122807017542,
"min": 0.010262743700000002,
"max": 0.0181163207
},
{
"command": "pacquet@main",
"mean": 0.014241470437864084,
"stddev": 0.0016283521301596756,
"median": 0.014273777700000002,
"user": 0.0077981343689320325,
"system": 0.007989861165048542,
"min": 0.010098683700000001,
"max": 0.0182318927
},
{
"command": "pnpr@HEAD",
"mean": 0.014110254298958342,
"stddev": 0.001192382567899571,
"median": 0.014041497700000002,
"user": 0.007094462291666666,
"system": 0.008577421875000003,
"min": 0.010944163700000002,
"max": 0.0177796607
},
{
"command": "pnpr@main",
"mean": 0.01326442914594595,
"stddev": 0.0021746151708075703,
"median": 0.0135298477,
"user": 0.007028124594594595,
"system": 0.007596210810810812,
"min": 0.008709961700000001,
"max": 0.0180124617
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 3.74702765612,
"stddev": 0.582290822144838,
"median": 3.5411730533199997,
"user": 4.5511713799999995,
"system": 3.0986822399999996,
"min": 3.07310586832,
"max": 4.97975582132
},
{
"command": "pacquet@main",
"mean": 4.383349313320001,
"stddev": 0.36483091270767437,
"median": 4.35690189832,
"user": 5.006183179999999,
"system": 3.4465125399999996,
"min": 3.78601567832,
"max": 5.02718923032
},
{
"command": "pnpr@HEAD",
"mean": 2.26979911022,
"stddev": 0.29029543790031065,
"median": 2.1477208498199998,
"user": 2.9534019799999998,
"system": 2.5754154399999996,
"min": 2.0342094723199997,
"max": 2.93915303732
},
{
"command": "pnpr@main",
"mean": 2.19799609992,
"stddev": 0.193206810823257,
"median": 2.2185756683199997,
"user": 2.9034322799999996,
"system": 2.4786012399999997,
"min": 1.88822068332,
"max": 2.56799242632
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.15336786102,
"stddev": 0.29696949977965426,
"median": 1.20123332042,
"user": 1.3990305600000001,
"system": 1.2958869199999998,
"min": 0.7290689234200001,
"max": 1.59070047242
},
{
"command": "pacquet@main",
"mean": 0.6805257004199998,
"stddev": 0.06487693452434977,
"median": 0.6562054044200001,
"user": 0.99411416,
"system": 0.9775062200000001,
"min": 0.60501331542,
"max": 0.7826863004200001
},
{
"command": "pnpr@HEAD",
"mean": 0.36824161592000004,
"stddev": 0.045151333281207906,
"median": 0.35257768242000004,
"user": 0.30334046,
"system": 0.6810896199999998,
"min": 0.31768863842000006,
"max": 0.44758993042000006
},
{
"command": "pnpr@main",
"mean": 0.37377092572000004,
"stddev": 0.029312025674764406,
"median": 0.37261640792000006,
"user": 0.33610936,
"system": 0.6810202200000001,
"min": 0.33531674442000003,
"max": 0.42268785242000007
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.2102395182200003,
"stddev": 0.12228492526129556,
"median": 2.20651400482,
"user": 1.8466484199999997,
"system": 1.4814891600000002,
"min": 2.03504730232,
"max": 2.4268963653199997
},
{
"command": "pacquet@main",
"mean": 2.22034140602,
"stddev": 0.2228682497795038,
"median": 2.23215886832,
"user": 1.8909732199999998,
"system": 1.5484805600000002,
"min": 1.9029107543200001,
"max": 2.51592980032
},
{
"command": "pnpr@HEAD",
"mean": 0.44061929052000004,
"stddev": 0.028822818247788675,
"median": 0.43645121732000003,
"user": 0.41656502,
"system": 0.7889882600000001,
"min": 0.39218482132000004,
"max": 0.48435863232000004
},
{
"command": "pnpr@main",
"mean": 0.4765964189200001,
"stddev": 0.04215277579227875,
"median": 0.47505680532000005,
"user": 0.4621438200000001,
"system": 0.82932356,
"min": 0.41380581032,
"max": 0.57312974432
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.38789880424,
"stddev": 0.0448338960650548,
"median": 0.38770851804,
"user": 0.3761905,
"system": 0.16432974,
"min": 0.32463232004,
"max": 0.44528189904
},
{
"command": "pacquet@main",
"mean": 0.35699295514,
"stddev": 0.02900944340983766,
"median": 0.35980786454,
"user": 0.3598528,
"system": 0.12857864,
"min": 0.30651889204,
"max": 0.39199176904
},
{
"command": "pnpr@HEAD",
"mean": 0.11589631378074074,
"stddev": 0.006282017575623161,
"median": 0.11509214304,
"user": 0.05329053333333333,
"system": 0.020776380740740744,
"min": 0.10587191104,
"max": 0.12947601404
},
{
"command": "pnpr@main",
"mean": 0.1192661909566667,
"stddev": 0.006486873735522727,
"median": 0.11851377804,
"user": 0.053771491666666664,
"system": 0.024795764999999994,
"min": 0.10737091204,
"max": 0.13139835004000003
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.31542935270444444,
"stddev": 0.040378121395404275,
"median": 0.30534989726,
"user": 0.3203231644444445,
"system": 0.06870454,
"min": 0.26431758026,
"max": 0.38599321926
},
{
"command": "pacquet@main",
"mean": 0.2921410985933333,
"stddev": 0.024632422353248806,
"median": 0.28884065526,
"user": 0.3087844977777778,
"system": 0.06362176222222221,
"min": 0.26478784026,
"max": 0.34354287726000005
},
{
"command": "pnpm@HEAD",
"mean": 6.791953970593334,
"stddev": 1.399513704130931,
"median": 6.59163152126,
"user": 10.167228386666666,
"system": 0.6869367622222221,
"min": 4.67267637426,
"max": 9.03727617626
}
]
}Scenario: Isolated linker: linked-workspace resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.29616218584,
"stddev": 0.020401459875213548,
"median": 0.2919006122400001,
"user": 0.24228196,
"system": 0.1127063,
"min": 0.26462195274000005,
"max": 0.32069605374000004
},
{
"command": "pacquet@main",
"mean": 0.30174966074000015,
"stddev": 0.030002229331268792,
"median": 0.30524987574000007,
"user": 0.24224286,
"system": 0.1189775,
"min": 0.25824791174000006,
"max": 0.35553065874000006
}
]
}Scenario: Isolated linker: injected workspace repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.11582503297517242,
"stddev": 0.013566404618583357,
"median": 0.11567319232,
"user": 0.04790035310344827,
"system": 0.07841247310344827,
"min": 0.09482188132000001,
"max": 0.14861220932000002
},
{
"command": "pacquet@main",
"mean": 0.11129983736000001,
"stddev": 0.01360937791117549,
"median": 0.10730750232000001,
"user": 0.04488152,
"system": 0.07588204,
"min": 0.09638950332,
"max": 0.15015739932000002
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 5.222220158439999,
"stddev": 0.268602080057771,
"median": 5.18662915094,
"user": 3.31829584,
"system": 2.6989113999999996,
"min": 4.81442120444,
"max": 5.83313229944
},
{
"command": "pacquet@main",
"mean": 5.16564573944,
"stddev": 0.3050150533344932,
"median": 5.06008852944,
"user": 3.36956104,
"system": 2.5333596,
"min": 4.958734246440001,
"max": 5.99302724944
},
{
"command": "pnpr@HEAD",
"mean": 3.8537071090399997,
"stddev": 0.10209678218312901,
"median": 3.8522706954400006,
"user": 2.73746264,
"system": 2.2381891,
"min": 3.70541488444,
"max": 4.04804781044
},
{
"command": "pnpr@main",
"mean": 4.083246181740001,
"stddev": 0.14739937968258077,
"median": 4.0550559359400005,
"user": 3.05365164,
"system": 2.4082611999999997,
"min": 3.8988298394400003,
"max": 4.3769200144400005
}
]
}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.24070414639666662,
"stddev": 0.02436622215116465,
"median": 0.23541369398,
"user": 0.28854004666666666,
"system": 0.24853228000000002,
"min": 0.21119064348,
"max": 0.28018090148
},
{
"command": "pacquet@main",
"mean": 0.23266975729818185,
"stddev": 0.0242535661594325,
"median": 0.22551633248,
"user": 0.2981832436363636,
"system": 0.20046446181818178,
"min": 0.20572008948,
"max": 0.29158696148
},
{
"command": "pnpr@HEAD",
"mean": 0.29073794648,
"stddev": 0.01696398197333264,
"median": 0.28904318448,
"user": 0.32955897999999995,
"system": 0.27635528000000004,
"min": 0.26008935148,
"max": 0.32328162848
},
{
"command": "pnpr@main",
"mean": 0.25592394468,
"stddev": 0.03555488663598997,
"median": 0.26539433798,
"user": 0.29848317999999996,
"system": 0.26115998,
"min": 0.19073538348,
"max": 0.28737729848
}
]
}Scenario: Store only: unlocked direct deps, cold cache + hot storeStore-only install (
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.79494888852,
"stddev": 0.16293331850329512,
"median": 1.76950071272,
"user": 1.2139343999999999,
"system": 0.48056735999999994,
"min": 1.61072558622,
"max": 2.12469907622
},
{
"command": "pacquet@main",
"mean": 2.18821148702,
"stddev": 0.13657237050180815,
"median": 2.2152204817200003,
"user": 1.3798476999999998,
"system": 0.6329840599999998,
"min": 1.94150290622,
"max": 2.37094329122
}
]
} |
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
Code review by qodo was updated up to the latest commit 4f5e98e |
PR Code Suggestions ✨Warning
|
|||||||||||
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
…l deps under --filter Unify filtered-install workspace scope, hoisted per-importer group preservation, and local/linked dependency freshness checks (Closes pnpm/tasks#164): 1. Preserve per-importer dependency groups in hoisted filtered installs: - Introduce `selected_materialization_closure`, which applies the CLI `GroupSelection` only to the selected importer closure and retains the dependency groups recorded in the prior current lockfile for unselected workspace projects. - Update frozen/fresh materialization, hoisted linking, workspace link creation, stale link pruning, and build-phase top-level bin linking to read retained per-importer groups from `scope.lockfile()`. 2. Keep `requested_importer_ids` whenever `--filter` was passed on the CLI: - In a sparse checkout where `--filter` matches every on-disk project while missing projects remain in `pnpm-lock.yaml`, `requested_importer_ids` still restricts materialization to the requested on-disk importers. 3. Check transitive local directory dependencies and importer `link:` ranges: - Recurse through `LockfileResolution::Directory` children in `check_directory_dependencies_freshness` (with cycle detection) so modifying a transitive injected/local package invalidates both `--frozen-lockfile` and the optimistic repeat-install fast path. - Verify importer-level `ImporterDepVersion::Link` entries against `workspace:` and `link:` specifiers in `check_single_dep_spec_directory_freshness`. - Fix `mark_importers_of_unproven_directory_deps` to handle `ImporterDepVersion::File` and `ImporterDepVersion::Link`, compare exact directory paths (or `publishConfig.directory`) rather than prefix-matching `"."`, and iterate to a fixpoint.
…fig.directory links Keep optional: true on retained snapshots from unselected hoisted importers when merging the filtered materialization closure under --no-optional, and pass GroupSelection::all() once the closure has narrowed each importer's groups. Also resolve publishConfig.directory link targets against their ancestor workspace project manifest during lockfile link freshness checks.
…e root - Allow loaded workspace projects declared via parent-relative patterns (such as ../libs/*) to pass link target freshness checks unless the project directory or its package.json escapes its own root via a symlink. - Reject transitive local dependencies that lack package metadata in check_child_directory_dep_freshness. - Remove transient skip entries when inserting a snapshot key into SkippedSnapshots::installability.
|
Code review by qodo was updated up to the latest commit a4ebc79 |
a4ebc79 to
4e334ff
Compare
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
Summary
Unifies filtered-install workspace scope, hoisted per-importer dependency group preservation, and local/linked dependency freshness checks.
Closes pnpm/tasks#164
Preserve per-importer dependency groups in hoisted filtered installs (
--prod/--dev/--no-optional):selected_materialization_idsunioned unselected prior importers into the selected importer ID set and passed one globalGroupSelectiontomaterialization_closure,install_frozen_lockfile, hoisted linking, and stale module pruning, stripping previously installeddevDependencies(ordependencies) of unselected workspace projects.selected_materialization_closure, which applies the CLIGroupSelectiononly to the selected importer closure and retains the dependency groups recorded in the prior current lockfile for unselected workspace projects.scope.lockfile().Keep
requested_importer_idswhenever--filterwas passed on the CLI:--filtermatches every on-disk project while missing projects remain inpnpm-lock.yaml,filtered_installisfalsefor on-disk projects, butrequested_importer_idsnow still restricts materialization to the requested on-disk importers so missing projects are not materialized.Check transitive local directory dependencies and importer
link:ranges during freshness and repeat-install checks:LockfileResolution::Directorychildren incheck_directory_dependencies_freshness(with cycle detection) so modifying a transitive injected/local package invalidates both--frozen-lockfileand the optimistic repeat-install fast path.ImporterDepVersion::Linkentries againstworkspace:andlink:specifiers incheck_single_dep_spec_directory_freshness.mark_importers_of_unproven_directory_depsin optimistic repeat install to handleImporterDepVersion::FileandImporterDepVersion::Link, compare exact directory paths (orpublishConfig.directory) instead of prefix-matching the workspace root".", and iterate to a fixpoint.Squash Commit Body
Checklist
already linked to it solves it.
are implemented in every affected version.
pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
Generated by Antigravity (Claude Opus 4.6)
Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit