Repository navigation
refactor(package-manager): bring the fresh install's submodules under the bindings cap - #14748
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe fresh-lockfile installer now groups manifest hooks and resolve-pass inputs into dedicated structures. It centralizes rewrite-context and resolver-option construction. Dependency groups are passed by reference, and resolver lifetime declarations are adjusted. ChangesFresh-lockfile resolution refactor
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Refactor Merge Risk: ⚪ Minimal · up to The fresh-install resolution path is reorganized while retaining its existing behavior; no concrete merge-blocking correctness, security, or runtime risk remains identified. Suggested labels: ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
PR Summary by QodoRefactor fresh installs into binding-capped phases
AI Description
Diagram
High-Level Assessment
Files changed (5)
|
Code Review by Qodo
1.
|
c20c1f0 to
0f38f85
Compare
PR Code Suggestions ✨Latest suggestions up to 510a76e Warning
Previous suggestionsSuggestions up to commit 2f89b50
✅ Suggestions up to commit da5a760
Suggestions up to commit 0f38f85
✅ Suggestions up to commit c20c1f0
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
|
Code review by qodo was updated up to the latest commit 0f38f85 |
Micro-Benchmark ResultsLinux |
0f38f85 to
da5a760
Compare
|
Code review by qodo was updated up to the latest commit da5a760 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #14748 +/- ##
==========================================
- Coverage 90.29% 90.28% -0.01%
==========================================
Files 795 795
Lines 153301 153333 +32
==========================================
+ Hits 138423 138444 +21
- Misses 14878 14889 +11 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Qodo's three findings are addressed in 2f89b50.
The red Written by an agent (Claude Code, claude-fable-5-1). |
|
Code review by qodo was updated up to the latest commit 2f89b50 |
2f89b50 to
510a76e
Compare
|
Code review by qodo was updated up to the latest commit 510a76e |
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. Bencher consumes pacquet@HEAD and pnpr@HEAD. The tables below show mean ± σ; Bencher thresholds on the minimum latency, which is far less perturbed by shared-runner contention (noise only adds time). Scenario: Isolated linker: fresh restore, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.4937462722800006,
"stddev": 0.1193643436814172,
"median": 2.49997278368,
"user": 1.7296744599999996,
"system": 1.8008345399999999,
"min": 2.32609373018,
"max": 2.71389987118
},
{
"command": "pacquet@main",
"mean": 2.45779815018,
"stddev": 0.06207091885751189,
"median": 2.44544549668,
"user": 1.8949288599999996,
"system": 1.86773504,
"min": 2.34329620518,
"max": 2.56549203318
},
{
"command": "pnpr@HEAD",
"mean": 1.5062104199800002,
"stddev": 0.08307908196071842,
"median": 1.50888114918,
"user": 1.8043126600000001,
"system": 1.9406343399999997,
"min": 1.39486111518,
"max": 1.67381358618
},
{
"command": "pnpr@main",
"mean": 1.4971418342800002,
"stddev": 0.0933396992332286,
"median": 1.48965310018,
"user": 1.42932256,
"system": 1.5386674399999998,
"min": 1.3587923721800002,
"max": 1.6618128521800002
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.25669607273999995,
"stddev": 0.034788192893968686,
"median": 0.25449904684,
"user": 0.25011079999999997,
"system": 0.56790038,
"min": 0.21805582834000004,
"max": 0.31970274434
},
{
"command": "pacquet@main",
"mean": 0.29258913974000006,
"stddev": 0.032535298083327606,
"median": 0.29853503584,
"user": 0.2941412,
"system": 0.6519463799999998,
"min": 0.23712255834000004,
"max": 0.32437560434
},
{
"command": "pnpr@HEAD",
"mean": 0.29115580014,
"stddev": 0.027794369644147575,
"median": 0.27998199684,
"user": 0.27115969999999995,
"system": 0.6251186799999999,
"min": 0.26087830134,
"max": 0.34214071434
},
{
"command": "pnpr@main",
"mean": 0.27480896684,
"stddev": 0.024892716348267098,
"median": 0.27022951434,
"user": 0.2556885,
"system": 0.59205018,
"min": 0.23953961134,
"max": 0.32619805734
}
]
}Scenario: Isolated linker: repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.010776886128187921,
"stddev": 0.0018792482950923555,
"median": 0.0105496079,
"user": 0.005963321610738254,
"system": 0.005479972550335568,
"min": 0.0074777174,
"max": 0.0203127804
},
{
"command": "pacquet@main",
"mean": 0.011808981487499998,
"stddev": 0.002103168718738916,
"median": 0.011342431900000002,
"user": 0.006287036249999996,
"system": 0.006259851875,
"min": 0.0080263804,
"max": 0.020576527400000003
},
{
"command": "pnpr@HEAD",
"mean": 0.011427524519815666,
"stddev": 0.001563265845853978,
"median": 0.0113560324,
"user": 0.006153710967741933,
"system": 0.005962261935483868,
"min": 0.0084355904,
"max": 0.016810745400000004
},
{
"command": "pnpr@main",
"mean": 0.011768628245528464,
"stddev": 0.0026508825088790433,
"median": 0.0110639519,
"user": 0.006326665040650404,
"system": 0.00609696308943089,
"min": 0.0074218614,
"max": 0.020753962400000003
}
]
}Scenario: Isolated linker: repeat install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.010073743991250009,
"stddev": 0.0012926856273313596,
"median": 0.010021104460000001,
"user": 0.005861676249999999,
"system": 0.004781514821428574,
"min": 0.007349481960000001,
"max": 0.015098106960000003
},
{
"command": "pacquet@main",
"mean": 0.01146212660976959,
"stddev": 0.002892795879356101,
"median": 0.01076328296,
"user": 0.0058840595391705065,
"system": 0.006231351336405529,
"min": 0.007066118960000001,
"max": 0.020937614960000003
},
{
"command": "pnpr@HEAD",
"mean": 0.011653876090434782,
"stddev": 0.0023287327199422174,
"median": 0.011318907960000001,
"user": 0.0068261078260869554,
"system": 0.005462903105590066,
"min": 0.00798899796,
"max": 0.02494708596
},
{
"command": "pnpr@main",
"mean": 0.010847454030484588,
"stddev": 0.0015711495561335444,
"median": 0.01080899796,
"user": 0.006442527577092511,
"system": 0.0050528,
"min": 0.007170745960000001,
"max": 0.016061560960000002
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.7404757586999997,
"stddev": 0.12623927412408878,
"median": 2.6973019065,
"user": 2.51206172,
"system": 2.1172048200000004,
"min": 2.620731009,
"max": 3.0155545519999998
},
{
"command": "pacquet@main",
"mean": 2.8842679469000005,
"stddev": 0.1454862596810982,
"median": 2.8410972675,
"user": 2.89049122,
"system": 2.4137328199999994,
"min": 2.711583368,
"max": 3.119361149
},
{
"command": "pnpr@HEAD",
"mean": 1.5694010992999998,
"stddev": 0.08320832858103902,
"median": 1.530929212,
"user": 1.48427172,
"system": 1.7351719199999998,
"min": 1.499467441,
"max": 1.755528661
},
{
"command": "pnpr@main",
"mean": 1.7142962399000001,
"stddev": 0.1376953546533109,
"median": 1.6650015025,
"user": 1.7304965200000002,
"system": 2.01014832,
"min": 1.567481677,
"max": 1.946108831
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.5317605005400001,
"stddev": 0.041278827216936195,
"median": 0.52167684504,
"user": 0.8015293400000001,
"system": 1.04714788,
"min": 0.47825078654000003,
"max": 0.6059109225400001
},
{
"command": "pacquet@main",
"mean": 0.48092160484000007,
"stddev": 0.021599532918669843,
"median": 0.48375400654,
"user": 0.72336384,
"system": 1.00856338,
"min": 0.43320173654,
"max": 0.5097934195400001
},
{
"command": "pnpr@HEAD",
"mean": 0.3601733529400001,
"stddev": 0.035679037204794505,
"median": 0.35081355704,
"user": 0.27905964,
"system": 0.62804238,
"min": 0.33521931954,
"max": 0.45704038254
},
{
"command": "pnpr@main",
"mean": 0.34664101524,
"stddev": 0.014871620257084633,
"median": 0.34970743754,
"user": 0.27726303999999996,
"system": 0.60379458,
"min": 0.31345798754,
"max": 0.36435184054
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.7822847124000003,
"stddev": 0.10963516755142058,
"median": 1.7341531284,
"user": 1.2620652199999998,
"system": 1.18625656,
"min": 1.6778020329,
"max": 1.9826138339000001
},
{
"command": "pacquet@main",
"mean": 1.6816557968,
"stddev": 0.0826601394743861,
"median": 1.6396904639,
"user": 1.09528662,
"system": 1.02886286,
"min": 1.5885837289000002,
"max": 1.8180033779000002
},
{
"command": "pnpr@HEAD",
"mean": 0.3233902397,
"stddev": 0.02053214101603496,
"median": 0.32933896440000004,
"user": 0.23932402000000003,
"system": 0.58551306,
"min": 0.2817702509,
"max": 0.34418036290000004
},
{
"command": "pnpr@main",
"mean": 0.33710831730000007,
"stddev": 0.0133781753399339,
"median": 0.33568905390000003,
"user": 0.25536711999999995,
"system": 0.59629786,
"min": 0.3171222609,
"max": 0.36419560590000005
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.2797217512709091,
"stddev": 0.024433336400099898,
"median": 0.27137229518,
"user": 0.31314951818181824,
"system": 0.0911974418181818,
"min": 0.24453919518,
"max": 0.32066118418
},
{
"command": "pacquet@main",
"mean": 0.28015514963454546,
"stddev": 0.032559627755461056,
"median": 0.26359115318000004,
"user": 0.30926133636363634,
"system": 0.09543707818181818,
"min": 0.24902312418,
"max": 0.34472265018000003
},
{
"command": "pnpr@HEAD",
"mean": 0.11423546165826086,
"stddev": 0.012386832014924954,
"median": 0.10975388518,
"user": 0.04976400434782609,
"system": 0.02246317304347825,
"min": 0.10294704018,
"max": 0.15028309018
},
{
"command": "pnpr@main",
"mean": 0.11197634522000001,
"stddev": 0.00818118070980486,
"median": 0.11062992618,
"user": 0.04781054,
"system": 0.02184058,
"min": 0.10190710118,
"max": 0.13064056018
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.8912379881755557,
"stddev": 0.12420523863189532,
"median": 0.88863810062,
"user": 0.8985090133333333,
"system": 0.23255253111111113,
"min": 0.73565353862,
"max": 1.1367847546199998
},
{
"command": "pacquet@main",
"mean": 0.88461716662,
"stddev": 0.1441903361032443,
"median": 0.84611609062,
"user": 0.9045732355555555,
"system": 0.22297686444444442,
"min": 0.69932942762,
"max": 1.16190452462
},
{
"command": "pnpm@HEAD",
"mean": 4.570685959731112,
"stddev": 0.35399422441616124,
"median": 4.69001237162,
"user": 6.98671168,
"system": 0.3824417533333333,
"min": 4.05820296662,
"max": 4.916249774620001
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.68527798544,
"stddev": 0.22142950728927133,
"median": 4.73859124284,
"user": 2.0553693599999994,
"system": 1.9377169600000002,
"min": 4.35332506234,
"max": 5.02495162634
},
{
"command": "pacquet@main",
"mean": 4.41778244604,
"stddev": 0.08981491903184612,
"median": 4.37741722134,
"user": 1.6481785599999998,
"system": 1.62482966,
"min": 4.34080838734,
"max": 4.612048607339999
},
{
"command": "pnpr@HEAD",
"mean": 3.5469178127400007,
"stddev": 0.10091109254557096,
"median": 3.59228204484,
"user": 1.6857460599999996,
"system": 1.7359911599999998,
"min": 3.38758084134,
"max": 3.7056640933400002
},
{
"command": "pnpr@main",
"mean": 3.48684167074,
"stddev": 0.13311977874181855,
"median": 3.42170213834,
"user": 1.45195346,
"system": 1.4929588599999999,
"min": 3.3745432863400002,
"max": 3.79314772834
}
]
}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. Comparable to that scenario head-to-head.
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.1973411532988235,
"stddev": 0.03568488315355807,
"median": 0.19235215424000002,
"user": 0.27005698588235294,
"system": 0.18546428823529407,
"min": 0.14989412524,
"max": 0.26435892924000004
},
{
"command": "pacquet@main",
"mean": 0.23487492044000002,
"stddev": 0.043882528453083276,
"median": 0.24837054874000003,
"user": 0.29910238,
"system": 0.2318698,
"min": 0.15527085624000003,
"max": 0.28975972924000004
},
{
"command": "pnpr@HEAD",
"mean": 0.1890360399323077,
"stddev": 0.023314653647214058,
"median": 0.19151277224000002,
"user": 0.23595781846153846,
"system": 0.20170116153846152,
"min": 0.15100138124,
"max": 0.23094940924000001
},
{
"command": "pnpr@main",
"mean": 0.191446845365,
"stddev": 0.032562990943989775,
"median": 0.18451827374000002,
"user": 0.23184952999999997,
"system": 0.19456382499999997,
"min": 0.15839485124000002,
"max": 0.28827616424
}
]
} |
|
| Project | pnpm's project |
| Branch | pr/14748 |
| Testbed | pnpr |
⚠️ WARNING: No Threshold found!Without a Threshold, no Alerts will ever be generated.
Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the--ci-only-thresholdsflag.
Click to view all benchmark results
| Benchmark | Latency | milliseconds (ms) |
|---|---|---|
| gvs-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 151.00 ms |
| isolated-linker.fresh-install.cold-cache.cold-store | 📈 view plot | 1,499.47 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 281.77 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 335.22 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 102.95 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,394.86 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,387.58 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 260.88 ms |
| isolated-linker.repeat-install.cold-cache.hot-store | 📈 view plot | 7.99 ms |
| isolated-linker.repeat-install.hot-cache.hot-store | 📈 view plot | 8.44 ms |
…ds them The workspace walk consumes the hooks and the reuse policy as a whole, and every importer's resolve reads the config, the seeds and the manifest hooks alongside; the pass inputs carry the two halves as WorkspaceWalk and ImporterInputs, each building its own options, instead of one struct the pass took apart into twenty-seven names. The reuse seed reads its inputs in place and builds its two rewrite contexts from one method. Related to #14562. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_019kR4Ev797PFQ6iaC3AtzRw
…solve hooks ImporterTransforms owns the extenders, the overrider and the ignored- optionals matcher it applies, drops an empty overrider at construction where two sinks each filtered it, applies itself to every importer, and turns into the three read-package hooks the resolver runs. The manifest transforms carry those hooks as one ManifestHooks value. Related to #14562. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_019kR4Ev797PFQ6iaC3AtzRw
…m its inputs The chain inputs construct the npm, git, tarball, node and named- registry resolvers as methods sharing one retry-options and packument- caches source, assemble the chain in its order, and build the prefetch context; loading the pnpmfile with its custom resolvers and fetchers is a step of its own. With this, the fresh install's submodules have no function over the twelve-name cap. Related to #14562. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_019kR4Ev797PFQ6iaC3AtzRw
…efetch context its own lifetime Two helper comments that restated their names are gone; the prefetch context borrows for the call rather than for the inputs' lifetime, which is what the borrow of the pnpmfile load's session needs read literally, even though variance let the previous signature compile. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_019kR4Ev797PFQ6iaC3AtzRw
510a76e to
7b97a73
Compare
|
Code review by qodo was updated up to the latest commit 7b97a73 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
… the bindings cap (pnpm#14748) Bring the fresh install's submodules under the twelve-name cap. Split the resolve pass's inputs into the WorkspaceWalk the walk consumes whole and the ImporterInputs every importer reads, each building its own options. Read the reuse seed's inputs in place and build its rewrite contexts from one method. Let ImporterTransforms own the extenders, the overrider and the matcher it applies, drop an empty overrider at construction, and produce the read-package hooks as one ManifestHooks value. Build each resolver of the chain from the chain inputs by a method of its own, and load the pnpmfile with its custom resolvers and fetchers as a step of its own. Related to pnpm#14562.
Summary
Rebased onto main after #14746 merged; the four commits are this PR. Fourth installment of adopting
perfectionist::too_many_local_bindingsatmax_bindings = 12. Related to #14562.Brings the fresh install's submodules under the cap —
resolver_setup.rs(build_resolver_chain, 44 names),resolve.rs(run_resolve_pass38,lockfile_reuse_seed25) andmanifest_transforms.rs(build_manifest_transforms, 25) — soinstall_with_fresh_lockfile/has no site left:WorkspaceWalkis whatresolve_workspaceconsumes whole (the hooks it takes ownership of, the reuse policy, the registries);ImporterInputsis what every importer's resolve reads alongside. Each builds its own options (WorkspaceWalk::into_options,ImporterInputs::resolve_importer_options), where one struct was taken apart into twenty-seven names and rebuilt into two.RewriteContexts from one method instead of two identical literals.ImporterTransformsowns what it applies (the extenders, the overrider, the ignored-optionals matcher), drops an empty overrider at construction where two sinks each filtered it, applies itself to every importer, and turns into the three read-package hooks the resolver runs, carried as oneManifestHooksvalue.chain()is the order,prefetch_context()the wrapper's inputs, and loading the pnpmfile with its custom resolvers and fetchers is a step of its own (load_pnpmfile).No user-visible behavior changes; no changeset. Nothing is cloned or allocated that was not before: the split inputs are the same borrows and moves, the hooks clone the same
Arcs, and the chain'sVecis sized for its ten built-in resolvers (it was sized for nine).Squash Commit Body
Checklist
already linked to it solves it.
Written by an agent (Claude Code, claude-fable-5-1).
🤖 Generated with Claude Code
https://claude.ai/code/session_019kR4Ev797PFQ6iaC3AtzRw