Repository navigation
Conversation
|
Warning Review limit reached
Next review available in: 10 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (34)
📝 WalkthroughWalkthroughThis PR restores package import method logging in pnpm 11 and adds Rust-engine support for workspace scope reporting, cached lockfile verification ages, automatic ChangesPackage import reporting
Rust-engine behavior updates
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant CLI
participant InstallPipeline
participant DefaultReporter
CLI->>DefaultReporter: configure scope reporting
InstallPipeline->>DefaultReporter: emit selected and total project counts
DefaultReporter-->>CLI: render Scope line when applicable
sequenceDiagram
participant DependencyLinker
participant CoreLogger
participant DefaultReporter
DependencyLinker->>CoreLogger: report imported package and method
CoreLogger->>DefaultReporter: emit progress and import-method events
DefaultReporter-->>DependencyLinker: render store import message
Possibly related issues
Possibly related PRs
Suggested labels: Suggested reviewers: ✨ 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 |
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (5): Last reviewed commit: "test(cli): compare the scope prefix agai..." | Re-trigger Greptile |
PR Summary by QodoFix pnpm 12 parity gaps: scope reporting, allowBuilds scaffolds, config-mismatch errors
AI Description
Diagram
High-Level Assessment
Files changed (45)
|
Micro-Benchmark ResultsLinux |
Code Review by Qodo
Context used✅ Compliance rules (platform):
24 rules 1.
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
There was a problem hiding this comment.
Actionable comments posted: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
pnpm/crates/cli/src/cli_args/dispatch.rs (1)
193-194: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winPreserve reporter setup for direct
CliArgs::runcallers.
run_clinow callsargs.configure_reporter(), butCliArgs::runremains public and no longer sets the process-global default-reporter state. Direct in-process callers are also skipped through the completion server, so add an idempotent setup call at the start ofCliArgs::runor make the entrypoint-only contract explicit and verify no direct callers remain.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/src/cli_args/dispatch.rs` around lines 193 - 194, Ensure the public CliArgs::run method performs idempotent reporter configuration at its start, preserving the process-global default reporter for direct in-process callers. Reuse the existing configure_reporter setup used by run_cli, and avoid changing the remaining run flow.
🧹 Nitpick comments (2)
pnpm/crates/lockfile/src/freshness/tests.rs (1)
1707-1734: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winCover every
changed_settingbranch.This test exercises only four of the 13
StalenessReasonvariants. Add table-driven assertions for every configuration-drift key and each remainingNonecase so mapping changes cannot silently regress the frozen-install error code.Based on path instructions,
REVIEW_GUIDE.mdrequires regression tests for changed behavior.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/lockfile/src/freshness/tests.rs` around lines 1707 - 1734, Expand settings_drift_names_the_setting_that_changed to table-driven assertions covering all 13 StalenessReason variants: verify the expected configuration key for every changed_setting Some result and None for every remaining non-configuration drift case. Construct representative values for each variant and preserve the existing mappings, ensuring future mapping changes are detected.Source: Path instructions
pnpm/crates/cli/src/cli_args/run/recursive.rs (1)
98-108: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd regression coverage for the emitted
ScopeLog.Please add or point to a recording-emitter test covering filtered counts, empty selections,
workspace_prefix, and emission before script execution. This event is the basis for the newScope:output, so selector changes should not be able to alter its payload silently.As per path instructions,
REVIEW_GUIDE.mdrequires regression tests for changed observable behavior.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/src/cli_args/run/recursive.rs` around lines 98 - 108, Add regression coverage for the ScopeLog emission in the recursive run flow around emit and script execution. Use a recording emitter to verify filtered selections, empty selections, the workspace_prefix value, and that the event is emitted before the script runs; preserve the exact selected and total counts in each case.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.changeset/restore-package-import-method-log.md:
- Line 16: Update the changeset text to remove the internal worker-thread and
logger implementation details, retaining only a concise description of the
user-visible restoration of the package import method event or block.
- Line 10: Specify the Markdown fence language in
restore-package-import-method-log.md by changing the unfenced code block marker
to ```text, satisfying MD040 while leaving the block contents unchanged.
In `@pnpm/crates/cli/src/cli_args/pipelines.rs`:
- Around line 68-77: The pipeline must preserve the already-reported filtered
scope when launching PerProject children: update the pipeline in
pnpm/crates/cli/src/cli_args/pipelines.rs lines 68-77 to carry that state into
child execution, and update Install::run in
pnpm/crates/package-manager/src/install.rs lines 906-920 to skip the
full-workspace scope event for those children. Add recording-reporter coverage
for a filtered dedicated-lockfile workspace, asserting exactly one scope event
with the filtered selected and total counts.
In `@pnpm/crates/cli/src/cli_args/pre_command.rs`:
- Around line 152-153: Guard the warn_ignored_pnpm_manifest_fields call in the
pre-command argument flow with !input.global so global commands skip
project-scoped manifest warnings, and add a focused regression test covering
pnpm --global behavior.
In `@pnpm/crates/workspace-manifest-writer/src/edit.rs`:
- Around line 1137-1156: Update inline_comment to ignore escaped bytes while
scanning double-quoted scalars, so an escaped double quote does not end the
quoted state before detecting comments. Preserve existing single-quote handling
and comment-boundary behavior, and add a regression test covering a value such
as `"x\" # text"` to ensure scalar content is not rewritten as a comment.
---
Outside diff comments:
In `@pnpm/crates/cli/src/cli_args/dispatch.rs`:
- Around line 193-194: Ensure the public CliArgs::run method performs idempotent
reporter configuration at its start, preserving the process-global default
reporter for direct in-process callers. Reuse the existing configure_reporter
setup used by run_cli, and avoid changing the remaining run flow.
---
Nitpick comments:
In `@pnpm/crates/cli/src/cli_args/run/recursive.rs`:
- Around line 98-108: Add regression coverage for the ScopeLog emission in the
recursive run flow around emit and script execution. Use a recording emitter to
verify filtered selections, empty selections, the workspace_prefix value, and
that the event is emitted before the script runs; preserve the exact selected
and total counts in each case.
In `@pnpm/crates/lockfile/src/freshness/tests.rs`:
- Around line 1707-1734: Expand settings_drift_names_the_setting_that_changed to
table-driven assertions covering all 13 StalenessReason variants: verify the
expected configuration key for every changed_setting Some result and None for
every remaining non-configuration drift case. Construct representative values
for each variant and preserve the existing mappings, ensuring future mapping
changes are detected.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 3aba7235-557d-4bf4-934b-de0ad336d230
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock,!Cargo.lock
📒 Files selected for processing (44)
.changeset/restore-package-import-method-log.md.changeset/rust-engine-dates-cached-verification.md.changeset/rust-engine-lockfile-config-mismatch.md.changeset/rust-engine-reports-scope.md.changeset/rust-engine-scaffolds-allow-builds.md.changeset/rust-engine-warns-about-ignored-pnpm-field.mdpnpm/crates/cli/src/cli_args.rspnpm/crates/cli/src/cli_args/cli_command.rspnpm/crates/cli/src/cli_args/dispatch.rspnpm/crates/cli/src/cli_args/dispatch_install.rspnpm/crates/cli/src/cli_args/dispatch_script.rspnpm/crates/cli/src/cli_args/global.rspnpm/crates/cli/src/cli_args/pipelines.rspnpm/crates/cli/src/cli_args/pre_command.rspnpm/crates/cli/src/cli_args/reporter.rspnpm/crates/cli/src/cli_args/run.rspnpm/crates/cli/src/cli_args/run/recursive.rspnpm/crates/cli/src/lib.rspnpm/crates/cli/tests/approve_builds.rspnpm/crates/cli/tests/frozen_config_mismatch.rspnpm/crates/cli/tests/scope_report.rspnpm/crates/config/src/lib.rspnpm/crates/config/src/workspace_yaml.rspnpm/crates/config/src/workspace_yaml/tests.rspnpm/crates/default-reporter/Cargo.tomlpnpm/crates/default-reporter/src/format.rspnpm/crates/default-reporter/src/lib.rspnpm/crates/default-reporter/src/state.rspnpm/crates/default-reporter/src/state/tests.rspnpm/crates/default-reporter/tests/render.rspnpm/crates/lockfile/src/freshness.rspnpm/crates/lockfile/src/freshness/tests.rspnpm/crates/package-manager/src/install.rspnpm/crates/package-manager/src/install/tests.rspnpm/crates/reporter/src/lib.rspnpm/crates/workspace-manifest-writer/src/edit.rspnpm/crates/workspace-manifest-writer/src/lib.rspnpm/crates/workspace-manifest-writer/src/tests.rspnpm11/cli/default-reporter/test/reportingContext.tspnpm11/core/core-loggers/src/all.tspnpm11/core/core-loggers/src/reportPackageImported.tspnpm11/installing/deps-installer/src/install/link.tspnpm11/installing/deps-restorer/src/index.tspnpm11/installing/deps-restorer/src/linkHoistedModules.ts
Integrated-Benchmark Report (Linux)Commit: Each scenario reports direct installs and pnpr installs. 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.5175179969400006,
"stddev": 0.1601964498623898,
"median": 2.4754876238400003,
"user": 1.5617219,
"system": 1.30451454,
"min": 2.3525417868400003,
"max": 2.78405967084,
"times": [
2.78405967084,
2.54530965684,
2.7333195748400003,
2.3525417868400003,
2.52512468484,
2.3733635788400003,
2.39961569484,
2.6632886778400002,
2.37270608084,
2.4258505628400004
]
},
{
"command": "pacquet@main",
"mean": 2.55155715114,
"stddev": 0.17999602200941658,
"median": 2.48540889584,
"user": 1.557845,
"system": 1.30917134,
"min": 2.37389075284,
"max": 2.80203870784,
"times": [
2.6060366738400003,
2.7892188408400003,
2.37389075284,
2.54348899284,
2.3876163958400003,
2.80203870784,
2.4069213728400003,
2.40023510584,
2.42732879884,
2.77879586984
]
},
{
"command": "pnpr@HEAD",
"mean": 1.5186580369400002,
"stddev": 0.13399140856276404,
"median": 1.4782686058399999,
"user": 1.0612331,
"system": 1.1519906400000002,
"min": 1.38085195584,
"max": 1.74473242784,
"times": [
1.73256253484,
1.38573305284,
1.3908150288399999,
1.74473242784,
1.55875964284,
1.49107450184,
1.46546270984,
1.38085195584,
1.46121486584,
1.57537364884
]
},
{
"command": "pnpr@main",
"mean": 1.60923771134,
"stddev": 0.1350874848921284,
"median": 1.60847965184,
"user": 1.0772575,
"system": 1.15655444,
"min": 1.35410109484,
"max": 1.75788080684,
"times": [
1.75788080684,
1.62231440084,
1.49800665084,
1.5366573448399998,
1.75229568484,
1.51517595884,
1.59464490284,
1.7199534998400001,
1.35410109484,
1.74134676884
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.26290828818,
"stddev": 0.006178956223718749,
"median": 0.26230991857999997,
"user": 0.20876211999999997,
"system": 0.55573394,
"min": 0.25465353308,
"max": 0.27337242208,
"times": [
0.25761943308,
0.25465353308,
0.25750654108,
0.26720728308,
0.25838362408,
0.26484546208,
0.27337242208,
0.26595529408,
0.26976491408000003,
0.25977437508
]
},
{
"command": "pacquet@main",
"mean": 0.26191397898,
"stddev": 0.0040125624780293434,
"median": 0.26315397858,
"user": 0.20831581999999998,
"system": 0.5451387400000001,
"min": 0.25581174608,
"max": 0.26820716808,
"times": [
0.26313128108,
0.26360027508,
0.26820716808,
0.25825416008,
0.25828123108,
0.25854608908,
0.26317667608,
0.26653962508,
0.26359153808,
0.25581174608
]
},
{
"command": "pnpr@HEAD",
"mean": 0.27869372457999997,
"stddev": 0.007769589223722794,
"median": 0.27700241408,
"user": 0.23154392000000001,
"system": 0.5385467399999999,
"min": 0.26999222208,
"max": 0.29540745108,
"times": [
0.29540745108,
0.26999222208,
0.27826544408,
0.27656621208,
0.27410639608,
0.28882835208,
0.27949889908000003,
0.27245377108,
0.27743861608,
0.27437988208
]
},
{
"command": "pnpr@main",
"mean": 0.28142154378,
"stddev": 0.005767606003865325,
"median": 0.28090977358,
"user": 0.22126131999999998,
"system": 0.54915534,
"min": 0.26897179908,
"max": 0.28990295708,
"times": [
0.27978111108,
0.28718697808,
0.27988420508,
0.28549521008,
0.28339210708,
0.28990295708,
0.27892758308,
0.28193534208,
0.27873814508,
0.26897179908
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.79196975292,
"stddev": 0.02109644824759546,
"median": 2.78994690462,
"user": 1.7571783200000002,
"system": 1.32824602,
"min": 2.76293455262,
"max": 2.83398008762,
"times": [
2.79829181762,
2.81250546762,
2.76293455262,
2.7766670846199997,
2.78650204762,
2.80071680062,
2.78659568562,
2.79329812362,
2.76820586162,
2.83398008762
]
},
{
"command": "pacquet@main",
"mean": 2.79091674092,
"stddev": 0.023820542238421442,
"median": 2.79068426362,
"user": 1.7178785199999997,
"system": 1.36727882,
"min": 2.76174842562,
"max": 2.82846746562,
"times": [
2.81506458262,
2.7645249116199997,
2.8118446116199998,
2.80310313962,
2.76174842562,
2.80020159762,
2.78116692962,
2.76671278362,
2.82846746562,
2.7763329616199997
]
},
{
"command": "pnpr@HEAD",
"mean": 1.5723351437200002,
"stddev": 0.11931514686404855,
"median": 1.52868009662,
"user": 1.03758302,
"system": 1.20513642,
"min": 1.43200526362,
"max": 1.8410539966200001,
"times": [
1.53545158062,
1.8410539966200001,
1.4985378556200002,
1.52190861262,
1.67060007262,
1.43200526362,
1.60877900662,
1.4766461166200002,
1.51124926762,
1.6271196646200001
]
},
{
"command": "pnpr@main",
"mean": 1.5763034049200002,
"stddev": 0.12416049792830285,
"median": 1.5672433636200003,
"user": 1.04835382,
"system": 1.1795427200000002,
"min": 1.43602408662,
"max": 1.7808031906200001,
"times": [
1.4473306596200002,
1.5532614986200002,
1.4485564796200001,
1.7808031906200001,
1.7793477476200001,
1.5812252286200001,
1.54153983262,
1.58326301862,
1.43602408662,
1.6116823066200001
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.61420527766,
"stddev": 0.013077302333270698,
"median": 0.61606982886,
"user": 0.7469183399999999,
"system": 0.68949302,
"min": 0.59231471886,
"max": 0.6397233678600001,
"times": [
0.59231471886,
0.6046604008600001,
0.61461979686,
0.60762066886,
0.62356702586,
0.60320358586,
0.61977243486,
0.6397233678600001,
0.61751986086,
0.61905091586
]
},
{
"command": "pacquet@main",
"mean": 0.59717354846,
"stddev": 0.010989623661870316,
"median": 0.59480744486,
"user": 0.7322971399999999,
"system": 0.67767082,
"min": 0.58262183486,
"max": 0.61384821286,
"times": [
0.59510323186,
0.58262183486,
0.60240677386,
0.60692559886,
0.59290366786,
0.59451165786,
0.61076139686,
0.61384821286,
0.58278306786,
0.58987004186
]
},
{
"command": "pnpr@HEAD",
"mean": 0.30963574856000003,
"stddev": 0.006004837862447073,
"median": 0.30996676236,
"user": 0.19085504000000003,
"system": 0.5596882199999998,
"min": 0.30156361386,
"max": 0.31797610886,
"times": [
0.31797610886,
0.30490108186,
0.30326535086,
0.31423071186,
0.31373216286,
0.30620136186,
0.30156361386,
0.31401023586,
0.30488815786,
0.31558869986
]
},
{
"command": "pnpr@main",
"mean": 0.30959338326,
"stddev": 0.005847118147403758,
"median": 0.30935640136,
"user": 0.20163314,
"system": 0.5537812200000001,
"min": 0.29891473286,
"max": 0.32082618786,
"times": [
0.31401420386,
0.30933915386,
0.30937364886,
0.31203086586,
0.31176663786000003,
0.30405361486,
0.30758360686,
0.32082618786,
0.30803117986,
0.29891473286
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.9582324961200004,
"stddev": 0.01723568462659477,
"median": 1.95232260372,
"user": 0.96739532,
"system": 0.8572909799999999,
"min": 1.9363083002200001,
"max": 1.9940208952200003,
"times": [
1.9940208952200003,
1.94447612022,
1.94943313022,
1.94490345522,
1.96678357322,
1.9363083002200001,
1.9708127752200002,
1.95391203922,
1.9709415042200003,
1.9507331682200002
]
},
{
"command": "pacquet@main",
"mean": 1.9252795009199999,
"stddev": 0.007335032150918328,
"median": 1.92271381772,
"user": 0.9803761199999999,
"system": 0.7587614799999999,
"min": 1.9175743982200002,
"max": 1.93735549122,
"times": [
1.9175918812200001,
1.93735549122,
1.9347325782200002,
1.92078774322,
1.91971166622,
1.92463989222,
1.93153922222,
1.9175743982200002,
1.9200517762200002,
1.92881036022
]
},
{
"command": "pnpr@HEAD",
"mean": 0.30909155272000005,
"stddev": 0.00574353727924193,
"median": 0.31009130872,
"user": 0.20117722,
"system": 0.54012338,
"min": 0.29882281122000004,
"max": 0.31516176722,
"times": [
0.31434275422,
0.30788876322000003,
0.31491461122000003,
0.30862719522000004,
0.29882281122000004,
0.30071571722,
0.31155542222000004,
0.31218015022,
0.31516176722,
0.30670633522
]
},
{
"command": "pnpr@main",
"mean": 0.31232346042000003,
"stddev": 0.008314659862318835,
"median": 0.31386430272,
"user": 0.20642131999999994,
"system": 0.54807878,
"min": 0.29984890422,
"max": 0.32444252422000003,
"times": [
0.30806268122,
0.32047825622000004,
0.29984890422,
0.30034110122,
0.31376070822,
0.32444252422000003,
0.31527090322,
0.31396789722,
0.31965908122000003,
0.30740254722000004
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.37094969534,
"stddev": 0.010841551615996283,
"median": 0.37518016474000004,
"user": 0.36155046,
"system": 0.05922247999999999,
"min": 0.34965014424,
"max": 0.38535704524,
"times": [
0.37611296824,
0.36614613624,
0.37567859924,
0.38535704524,
0.37741287724,
0.37468173024,
0.34965014424,
0.35977147523999997,
0.36397703024,
0.38070894724
]
},
{
"command": "pacquet@main",
"mean": 0.36812902054,
"stddev": 0.016886681528050857,
"median": 0.36307701323999997,
"user": 0.36156886,
"system": 0.05669928,
"min": 0.35293647624,
"max": 0.40606641724,
"times": [
0.35293647624,
0.36723267324,
0.35626487724,
0.37185498324,
0.35697279124,
0.35367379524,
0.40606641724,
0.35892135324,
0.37161412924,
0.38575270924
]
},
{
"command": "pnpr@HEAD",
"mean": 0.08733282454303032,
"stddev": 0.0014795766421988228,
"median": 0.08702841724,
"user": 0.020308605454545443,
"system": 0.009412164848484849,
"min": 0.08454291324,
"max": 0.09054801824000001,
"times": [
0.08611937424,
0.08778848824,
0.08697770124000001,
0.08681547524000001,
0.08693992024000001,
0.08980075124,
0.08594797124,
0.08643319524000001,
0.08830770624,
0.08761604324000001,
0.09054801824000001,
0.08454291324,
0.08669157224000001,
0.08935400924,
0.08833722224000001,
0.08532446524000001,
0.08747706224000001,
0.08634412724000001,
0.09019572524000001,
0.08563355924,
0.08885959724,
0.08512313524000001,
0.08767376224000001,
0.08679587824000001,
0.08673781924000001,
0.08813494224000001,
0.08630286024,
0.08878506624,
0.08782697124000001,
0.08527763824000001,
0.08702841724,
0.08868918624000001,
0.08755263524000001
]
},
{
"command": "pnpr@main",
"mean": 0.08683257596727273,
"stddev": 0.0017071254693723863,
"median": 0.08725301024000001,
"user": 0.019797363030303026,
"system": 0.009581507878787879,
"min": 0.08294493124,
"max": 0.08973370424,
"times": [
0.08451960024,
0.08742854124,
0.08790849524000001,
0.08725301024000001,
0.08917600324000001,
0.08540480824,
0.08625707324000001,
0.08849457924000001,
0.08552405224000001,
0.08368831424,
0.08783973524000001,
0.08570245824,
0.08956965424,
0.08833593024000001,
0.08549857324000001,
0.08693148424000001,
0.08973370424,
0.08779489224,
0.08329492224000001,
0.08294493124,
0.08820216824,
0.08741519624,
0.08687175124,
0.08779188524,
0.08693732424,
0.08506394524000001,
0.08642908824000001,
0.08778302824,
0.08840478024000001,
0.08527226724,
0.08743616524,
0.08757659924000001,
0.08699004524000001
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.520924663120001,
"stddev": 0.11353246826352836,
"median": 4.45576415562,
"user": 1.67332374,
"system": 1.4599068,
"min": 4.43294469212,
"max": 4.73419088612,
"times": [
4.49602755612,
4.43811052512,
4.43294469212,
4.44480048012,
4.45761249212,
4.64831531512,
4.44467416412,
4.73419088612,
4.65865470112,
4.45391581912
]
},
{
"command": "pacquet@main",
"mean": 4.59832599402,
"stddev": 0.1375742753119083,
"median": 4.56280550312,
"user": 1.7437906399999998,
"system": 1.3659831999999998,
"min": 4.46738979812,
"max": 4.84676311812,
"times": [
4.52719101712,
4.79322821412,
4.47073533112,
4.66468317512,
4.84676311812,
4.46738979812,
4.50022032812,
4.64321124712,
4.59841998912,
4.47141772212
]
},
{
"command": "pnpr@HEAD",
"mean": 3.56154931992,
"stddev": 0.14942824838357396,
"median": 3.51300362862,
"user": 1.18891974,
"system": 1.2432366999999998,
"min": 3.44084491512,
"max": 3.85696045112,
"times": [
3.4483980881200003,
3.54607472212,
3.47993253512,
3.56617401412,
3.57258603612,
3.85696045112,
3.46469968312,
3.79751015312,
3.44084491512,
3.4423126011200003
]
},
{
"command": "pnpr@main",
"mean": 3.51930733962,
"stddev": 0.11539082841056954,
"median": 3.47462425962,
"user": 1.1956240399999998,
"system": 1.2515694,
"min": 3.45089324012,
"max": 3.8226807001200003,
"times": [
3.45089324012,
3.45765746412,
3.8226807001200003,
3.48898118512,
3.59380729012,
3.45336287212,
3.50005665712,
3.51399832912,
3.45136832412,
3.46026733412
]
}
]
} |
|
| Project | pnpm's project |
| Branch | pr/13376 |
| 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) |
|---|---|---|
| isolated-linker.fresh-install.cold-cache.cold-store | 📈 view plot | 1,432.01 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 298.82 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 301.56 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 84.54 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,380.85 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,440.84 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 269.99 ms |
|
Rebased onto The PR shrank. Three of the six items landed on Review outcomes:
Written by an agent (Claude Code, claude-opus-5). |
| Reporter::emit(&LogEvent::Scope(ScopeLog { | ||
| level: LogLevel::Debug, | ||
| selected: selection.selected_dirs.len(), | ||
| total: Some(selection.projects.len()), | ||
| workspace_prefix: Some(selection.workspace_root.to_string_lossy().into_owned()), | ||
| })); |
There was a problem hiding this comment.
3. Scope events bypass gating 🐞 Bug ≡ Correctness
select_install_family_plan emits pnpm:scope for any recursive/filter selection, but the command gate (reports_scope) is only applied inside the default reporter’s rendering logic. As a result, --reporter=ndjson will still output pnpm:scope records for commands pnpm doesn’t report scope for (e.g. add), which can break consumers relying on pnpm-compatible ndjson event sets.
Agent Prompt
### Issue description
`LogEvent::Scope` is emitted unconditionally for any recursive/filter workspace selection, while the pnpm command gate (which commands "report scope") is enforced only by the default reporter via `reports_scope`. Other reporters (notably ndjson) will serialize all events, so they can expose scope records for commands that should not report scope.
### Issue Context
- `CliCommand::reports_scope(...)` defines which commands should report scope.
- `NdjsonReporter` writes every `LogEvent` it receives.
### Fix Focus Areas
- pnpm/crates/cli/src/cli_args/pipelines.rs[63-87]
- pnpm/crates/cli/src/cli_args/cli_command.rs[615-634]
- pnpm/crates/cli/src/cli_args/dispatch.rs[66-73]
- pnpm/crates/cli/src/cli_args/reporter.rs[23-31]
### Suggested fix
Option A (preferred): Gate emission at the source.
- Thread a `reports_scope: bool` into `select_install_family_plan(...)` (or into its callers) and only `emit(LogEvent::Scope(...))` when true.
Option B: Gate at the emitter wrapper for all reporters.
- Extend `reporter_emit(...)` (or add a new helper) to return an `emit` fn that drops `LogEvent::Scope` when `!reports_scope`.
Add a regression test:
- Run a non-reporting command (e.g. `pnpm -r add ... --reporter=ndjson`) and assert there is **no** `"name":"pnpm:scope"` record.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
There was a problem hiding this comment.
Not fixing this as described — the premise is inverted — but it led to a real bug next to it, fixed in d5014df05b.
pnpm emits pnpm:scope for every command. scopeLogger.debug is called unconditionally in pnpm/src/main.ts; COMMANDS_THAT_REPORT_SCOPE lives in reportScope.ts and gates rendering, not emission. Against pnpm 11.17.0:
$ pnpm -r add is-even --reporter=ndjson
{"name":"pnpm:scope","selected":2,"total":3,"workspacePrefix":"…"}
$ pnpm add is-even --reporter=ndjson
{"name":"pnpm:scope","selected":1,"workspacePrefix":"…"}
So gating emission would make the engine emit fewer records than pnpm, which is the opposite of a pnpm-compatible ndjson event set. The reporter-side gate is the faithful placement.
What was actually wrong is the payload, not the gating. For a partial install the engine reported selected: N where pnpm reports selected: 1 with no total — the numbers were wrong for exactly the commands you named. The payload now follows the install's own is_full_install, which is pnpm's mutation: "install" versus "installSome" distinction, so add now emits {selected: 1, workspacePrefix} byte-for-byte as above. a_partial_install_reports_the_single_project_shape covers it.
Chasing it also turned up a gap: the repeat-install short-circuit emitted nothing, so an up-to-date pnpm install printed no Scope: line where pnpm prints one. It already loads the workspace projects to reach its verdict, so it now reports from there.
Written by an agent (Claude Code, claude-opus-5).
|
Code review by qodo was updated up to the latest commit cbf633b |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
pnpm/crates/workspace-manifest-writer/src/tests.rs (1)
379-386: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick winMake the idempotency test observe the no-write guarantee.
The helper creates a fresh directory and calls
scaffold_allow_buildsonly once, then compares file contents. This still passes if an already-scaffolded entry is rewritten atomically, so it does not verify the comment’s “must not rewrite” contract. Reuse one temporary path for two calls and assert the second call leaves metadata unchanged, or instrument the write boundary in a portable test.Based on the review guide, regression tests should prove the changed behavior rather than only its resulting bytes.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/workspace-manifest-writer/src/tests.rs` around lines 379 - 386, Update scaffold_allow_builds_no_op_when_already_scaffolded_keeps_file to reuse the same temporary file across two scaffold_allow_builds calls, then capture its metadata (including modification time) after the first call and assert it is unchanged after the second call. Keep the existing content assertion while ensuring the second invocation proves no write occurred.pnpm/crates/workspace-manifest-writer/src/lib.rs (1)
325-353: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExtract the shared manifest update pipeline.
scaffold_allow_buildsduplicatesset_allow_builds’s file loading, parsing, error mapping, change tracking, and write/no-op handling. Extracting that common flow will prevent the two APIs from drifting around missing files, validation, or write semantics.As per coding guidelines, “Before writing non-trivial code, search for existing functionality and reuse or extract shared utilities.”
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/workspace-manifest-writer/src/lib.rs` around lines 325 - 353, Extract the duplicated manifest update pipeline from scaffold_allow_builds and set_allow_builds into a shared helper, covering file loading, Manifest::parse error mapping, change tracking, and write_or_remove_manifest/no-op handling. Keep each API’s operation-specific validation and edit function (including add_undecided_allow_build and has_control_char) in its existing flow while delegating common persistence behavior to the helper.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pnpm/crates/cli/tests/scope_report.rs`:
- Around line 161-165: Replace the substring-based assertions in the scope
report test with parsing of the sole NDJSON record and an exact assertion of its
canonical wire payload, including name, level, selected, total, and
workspacePrefix fields. Keep the existing uniqueness check for the pnpm:scope
record and ensure the expected values match the test workspace.
In `@pnpm/crates/reporter/src/lib.rs`:
- Around line 793-798: Update the `pnpm:scope` payload documentation to state
that `total` is present for workspace commands, including filtered commands
selecting a single project; it is absent only for non-workspace or
single-project payloads. Keep the existing distinction for `workspace_prefix`
and the reporter’s “projects” versus “workspace projects” rendering.
---
Nitpick comments:
In `@pnpm/crates/workspace-manifest-writer/src/lib.rs`:
- Around line 325-353: Extract the duplicated manifest update pipeline from
scaffold_allow_builds and set_allow_builds into a shared helper, covering file
loading, Manifest::parse error mapping, change tracking, and
write_or_remove_manifest/no-op handling. Keep each API’s operation-specific
validation and edit function (including add_undecided_allow_build and
has_control_char) in its existing flow while delegating common persistence
behavior to the helper.
In `@pnpm/crates/workspace-manifest-writer/src/tests.rs`:
- Around line 379-386: Update
scaffold_allow_builds_no_op_when_already_scaffolded_keeps_file to reuse the same
temporary file across two scaffold_allow_builds calls, then capture its metadata
(including modification time) after the first call and assert it is unchanged
after the second call. Keep the existing content assertion while ensuring the
second invocation proves no write occurred.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 5abdae6c-69f7-42d6-9e71-9a67cf9ce187
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock,!Cargo.lock
📒 Files selected for processing (32)
.changeset/restore-package-import-method-log.md.changeset/rust-engine-dates-cached-verification.md.changeset/rust-engine-reports-scope.md.changeset/rust-engine-scaffolds-allow-builds.mdpnpm/crates/cli/src/cli_args/cli_command.rspnpm/crates/cli/src/cli_args/dispatch.rspnpm/crates/cli/src/cli_args/dispatch_install.rspnpm/crates/cli/src/cli_args/dispatch_script.rspnpm/crates/cli/src/cli_args/pipelines.rspnpm/crates/cli/src/cli_args/reporter.rspnpm/crates/cli/src/cli_args/run.rspnpm/crates/cli/src/cli_args/run/recursive.rspnpm/crates/cli/src/lib.rspnpm/crates/cli/tests/approve_builds.rspnpm/crates/cli/tests/scope_report.rspnpm/crates/default-reporter/Cargo.tomlpnpm/crates/default-reporter/src/format.rspnpm/crates/default-reporter/src/lib.rspnpm/crates/default-reporter/src/state.rspnpm/crates/default-reporter/src/state/tests.rspnpm/crates/default-reporter/tests/render.rspnpm/crates/package-manager/src/install.rspnpm/crates/reporter/src/lib.rspnpm/crates/workspace-manifest-writer/src/edit.rspnpm/crates/workspace-manifest-writer/src/lib.rspnpm/crates/workspace-manifest-writer/src/tests.rspnpm11/cli/default-reporter/test/reportingContext.tspnpm11/core/core-loggers/src/all.tspnpm11/core/core-loggers/src/reportPackageImported.tspnpm11/installing/deps-installer/src/install/link.tspnpm11/installing/deps-restorer/src/index.tspnpm11/installing/deps-restorer/src/linkHoistedModules.ts
🚧 Files skipped from review as they are similar to previous changes (23)
- pnpm11/core/core-loggers/src/all.ts
- .changeset/rust-engine-scaffolds-allow-builds.md
- pnpm/crates/default-reporter/src/state/tests.rs
- .changeset/rust-engine-reports-scope.md
- pnpm11/core/core-loggers/src/reportPackageImported.ts
- pnpm/crates/cli/src/cli_args/run.rs
- pnpm/crates/workspace-manifest-writer/src/edit.rs
- pnpm/crates/cli/src/cli_args/reporter.rs
- pnpm/crates/cli/src/cli_args/dispatch_install.rs
- pnpm/crates/default-reporter/src/format.rs
- pnpm11/installing/deps-installer/src/install/link.ts
- pnpm/crates/cli/src/lib.rs
- .changeset/rust-engine-dates-cached-verification.md
- pnpm/crates/default-reporter/src/lib.rs
- pnpm/crates/cli/src/cli_args/run/recursive.rs
- pnpm/crates/cli/src/cli_args/dispatch_script.rs
- pnpm11/installing/deps-restorer/src/index.ts
- pnpm/crates/default-reporter/tests/render.rs
- pnpm/crates/cli/src/cli_args/dispatch.rs
- pnpm/crates/cli/src/cli_args/pipelines.rs
- pnpm/crates/cli/tests/approve_builds.rs
- pnpm/crates/package-manager/src/install.rs
- pnpm/crates/default-reporter/src/state.rs
|
Second review round addressed in
The payload bug. For a partial install ( And a gap it uncovered. The repeat-install short-circuit reported nothing, so an up-to-date Full suite green (7208 passed). One Written by an agent (Claude Code, claude-opus-5). |
|
Code review by qodo was updated up to the latest commit d5014df |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Close the four CLI-surface differences left over from #13315 after #13359 and #13375 landed the other two. Three land in the Rust engine. The `Scope:` line arrives via a new `pnpm:scope` channel and a port of `reportScope.ts`; pnpm gates it on the command being one that reports scope *and* the run being workspace-wide, and since the engine's recursive-by-default set is narrower than pnpm's, that conjunction is computed at dispatch and seeded into the reporter. The event is emitted where the counts already exist — the `--filter` resolution and the installer's workspace walk — so no install pays for a second directory walk. A `sharedWorkspaceLockfile: false` plan reports once for the whole selection rather than once per child install, which would otherwise overwrite the filtered count with the workspace total. The second is the `allowBuilds` placeholder an install writes for a build it blocked, which #13375 taught the engine to read but not yet to write. The third is the elapsed time on a cache-satisfied lockfile verdict. The fourth goes the other way. The store block a first install prints is unreachable in the TypeScript CLI: `reportContext` needs `pnpm:package-import-method`, which only `@pnpm/fs.indexed-pkg-importer` emits, and that runs inside a `@pnpm/worker` thread whose logger never reaches the reporter. The main process already receives the import method back from the worker, so it is reported from there instead. Reporter globals are now seeded before the pre-command checks. They are `OnceLock`s and the pre-command checks emit, so whatever fired first was locking in unset values. Closes #13315
… shape A partial install (`add`, `update`, `remove`, …) targets the project it was run in, but the engine was reporting the whole workspace for it: `pnpm:scope` carried `selected: N` where pnpm carries `selected: 1` and no `total`. The rendered output agreed either way — both stacks suppress the line for a single selected project — but the record on the wire did not, and that record is the contract. The payload now follows the install's own `is_full_install`, which is pnpm's `mutation: "install"` versus `"installSome"` distinction. The repeat-install short-circuit reported nothing at all, so the most common invocation of all — an up-to-date `pnpm install` — printed no `Scope:` line where pnpm prints one. It already loads the workspace projects to reach its verdict, so it now returns the count alongside the root and reports the same scope the full path would. Also correct the `total` contract on `ScopeLog`: it accompanies a workspace-wide run including a `--filter` that narrowed it to a single project, and is absent only from the single-project shape.
|
Code review by qodo was updated up to the latest commit efab61f |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
The CLI canonicalizes `--dir` before anything is emitted, so the `workspacePrefix` it reports is the resolved path. On macOS `/var` is a symlink to `/private/var`, so comparing it against the raw `TempDir` path failed there while passing on Linux, where the temp path is already canonical. Reproduced on Linux by pointing `TMPDIR` at a symlink: the same two tests fail without this and pass with it.
|
macOS test failure fixed in The CLI canonicalizes The expected prefix now goes through Reproduced the failure on Linux by pointing Written by an agent (Claude Code, claude-opus-5). |
|
Code review by qodo was updated up to the latest commit 54857d8 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
…3376) Close the four CLI-surface differences left over from pnpm#13315 after pnpm#13359 and pnpm#13375 landed the other two. Three land in the Rust engine. The `Scope:` line arrives via a new `pnpm:scope` channel and a port of `reportScope.ts`; pnpm gates it on the command being one that reports scope *and* the run being workspace-wide, and since the engine's recursive-by-default set is narrower than pnpm's, that conjunction is computed at dispatch and seeded into the reporter. The event is emitted where the counts already exist — the `--filter` resolution and the installer's workspace walk — so no install pays for a second directory walk. A `sharedWorkspaceLockfile: false` plan reports once for the whole selection rather than once per child install, which would otherwise overwrite the filtered count with the workspace total. The second is the `allowBuilds` placeholder an install writes for a build it blocked, which pnpm#13375 taught the engine to read but not yet to write. The third is the elapsed time on a cache-satisfied lockfile verdict. The fourth goes the other way. The store block a first install prints is unreachable in the TypeScript CLI: `reportContext` needs `pnpm:package-import-method`, which only `@pnpm/fs.indexed-pkg-importer` emits, and that runs inside a `@pnpm/worker` thread whose logger never reaches the reporter. The main process already receives the import method back from the worker, so it is reported from there instead. Reporter globals are now seeded before the pre-command checks. They are `OnceLock`s and the pre-command checks emit, so whatever fired first was locking in unset values. Closes pnpm#13315
Summary
Closes #13315.
The issue listed six CLI-surface differences between pnpm 12 (pacquet) and pnpm 11 on the same install. Three landed on
mainwhile this was in review — the ignored-package.json#pnpmwarning in #13359, and the parsableallowBuildsplaceholder plusERR_PNPM_LOCKFILE_CONFIG_MISMATCHin #13375 — so this PR is rebased down to the four that remain.1.
Scope:is never reported (Rust engine). Newpnpm:scopechannel (ScopeLog { selected, total?, workspacePrefix? }, matching pnpm'sScopeMessagewire shape) plus a port ofreportScope.tsin the default reporter. pnpm gates the line on two things at once — the command must be inCOMMANDS_THAT_REPORT_SCOPE, and the run must be workspace-wide (-r/--filter, orinstall, which pnpm makes recursive by default). pacquet'srecursive_by_defaultset is deliberately narrower than pnpm's, so that conjunction is computed at dispatch (CliCommand::reports_scope) and seeded into the reporter, leaving the event itself command-agnostic.It is emitted from the two places that already know the counts — the
--filterresolution and the installer's workspace walk — so no extra directory walk is added to any install.select_install_family_planreports once for every plan shape, which matters forsharedWorkspaceLockfile: false: that plan installs each selected project separately, and a child reporting the whole workspace would both duplicate the record and overwrite the filtered count.a_dedicated_lockfile_install_reports_its_scope_oncepins that (and fails without the guard).Seeding the reporter globals also moved ahead of the pre-command checks. They are
OnceLocks and the pre-command checks emit — the ignored-pnpm-field warning is the first thing many installs print — so whatever fired first was locking in unset values. That was visible as a missingScope:line, and latent forcwdandsummary_scope.CliArgs::runand the install fast path call it again so a direct in-process caller is configured too; the repeat calls are no-ops.2.
ERR_PNPM_IGNORED_BUILDSdoes not scaffoldallowBuildsentries (Rust engine). #13375 made a scaffolded placeholder loadable; this writes it. MirrorshandleIgnoredBuilds: an install that blocks a build appends<pkg>: set this to true or falseunderallowBuilds:, keyed byallow_build_key_from_ignored_buildso the key matches whatpnpm approve-buildswrites. Existing entries are never overwritten, and a global install is exempt — its root is a throwaway per-group directory, and its approval prompt already records decisions against the stable global packages dir.3. The store block on a first install (TypeScript CLI). This one goes the other way: it is a lost log event in pnpm 11, not a pnpm 12 addition.
reportContextneedspnpm:package-import-method, which is only emitted by@pnpm/fs.indexed-pkg-importer— and that now runs inside a@pnpm/workerthread whose logger never reaches the reporter. Confirmed with--reporter=ndjson: pnpm 11 emitspnpm:contextand neverpnpm:package-import-method, so the block is unreachable. The main process already receivesimportMethodback from the worker and logs it as a progress event, so the two emissions are now onereportPackageImportedhelper, replacing three copies of the same block.4. Elapsed time in the verification line (Rust engine).
✓ Lockfile passes supply-chain policies (verified 253ms ago)instead of the timeless(previously verified). TheverifiedAttimestamp was already on the wire; only the renderer ignored it.Every item was checked against pnpm 11.17.0 on the issue's fixtures, not just against the source.
Squash Commit Body
Checklist
pnpm/port, or the description notes what still needs porting.pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
Written by an agent (Claude Code, claude-opus-5).
Summary by CodeRabbit
New Features
allowBuildsplaceholders without overwriting existing decisions.Bug Fixes
allowBuildssettings are preserved safely.