Repository navigation
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
Walkthrough
✨ Finishing Touches
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 (25): Last reviewed commit: "fix(cli): use bound sequential variable ..." | Re-trigger Greptile |
6117814 to
63c0ec6
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #13199 +/- ##
=======================================
Coverage 92.64% 92.64%
=======================================
Files 1912 1912
Lines 249892 249898 +6
=======================================
+ Hits 231513 231520 +7
+ Misses 18379 18378 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Same-run regression checkHEAD and main are measured on the same runner. The tolerance is 5% of the main median or 2 ms, whichever is larger. A regression requires both the median slowdown and the gap between the fastest retained HEAD sample and slowest retained main sample to exceed this tolerance, after trimming up to 10% from each tail. Suspected regressions are rerun once with target order reversed and only fail if reproduced. This conservative noise guard is not a statistical confidence interval. Inconclusive rows do not fail the check. They remain visible for performance review. Bencher retains absolute minimum timings for historical tracking; historical alerts do not gate this PR. Sequential measurements can still be affected by runner drift.
Integrated-Benchmark Report (Linux)Commit: Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm; the linked, 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": 2.4375924728199996,
"stddev": 0.1166652268209935,
"median": 2.47372472522,
"user": 1.9922008999999998,
"system": 1.6151309799999995,
"min": 2.25262824072,
"max": 2.55043491472
},
{
"command": "pacquet@main",
"mean": 2.3634243057199997,
"stddev": 0.10887868551617447,
"median": 2.32785365322,
"user": 1.8919512,
"system": 1.4138503799999997,
"min": 2.23476503872,
"max": 2.56729938372
},
{
"command": "pnpr@HEAD",
"mean": 1.4300701307199999,
"stddev": 0.11910449553731937,
"median": 1.4034442297199998,
"user": 1.680162,
"system": 1.3111162799999998,
"min": 1.3147792857199998,
"max": 1.61354367272
},
{
"command": "pnpr@main",
"mean": 1.4166160911199999,
"stddev": 0.11129408301375054,
"median": 1.42530136322,
"user": 1.7490069000000001,
"system": 1.3607875799999998,
"min": 1.26615953372,
"max": 1.65505489272
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.28164053446,
"stddev": 0.03210944291842294,
"median": 0.28049331206,
"user": 0.30704177999999993,
"system": 0.66979784,
"min": 0.24188646256000002,
"max": 0.33817032156000004
},
{
"command": "pacquet@main",
"mean": 0.27572864846,
"stddev": 0.020756641528320453,
"median": 0.26836634456,
"user": 0.31227288,
"system": 0.6699591400000001,
"min": 0.25580113056000003,
"max": 0.31330600656
},
{
"command": "pnpr@HEAD",
"mean": 0.29014685786000005,
"stddev": 0.020838230725489616,
"median": 0.29349158606000003,
"user": 0.31415318000000003,
"system": 0.66339954,
"min": 0.25364324056,
"max": 0.32117658956
},
{
"command": "pnpr@main",
"mean": 0.30172164946,
"stddev": 0.03281537160135909,
"median": 0.30196134805999997,
"user": 0.33279008,
"system": 0.68286044,
"min": 0.25443185056,
"max": 0.36642993956000003
}
]
}Scenario: Isolated linker: repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.012370002747684732,
"stddev": 0.0018173483444934146,
"median": 0.01198835026,
"user": 0.007158436157635466,
"system": 0.0063498579310344834,
"min": 0.009477416260000001,
"max": 0.02002083026
},
{
"command": "pacquet@main",
"mean": 0.010038361548389517,
"stddev": 0.001628724859995533,
"median": 0.009678713260000001,
"user": 0.005827378501872663,
"system": 0.005144244494382022,
"min": 0.007836314260000001,
"max": 0.01721291826
},
{
"command": "pnpr@HEAD",
"mean": 0.00908808175637681,
"stddev": 0.000641128673994914,
"median": 0.00901788226,
"user": 0.005447297608695655,
"system": 0.00447391695652174,
"min": 0.00791139626,
"max": 0.01253243126
},
{
"command": "pnpr@main",
"mean": 0.012007951078181825,
"stddev": 0.002460376955975283,
"median": 0.011565109760000001,
"user": 0.007131889790209792,
"system": 0.005937668811188807,
"min": 0.00803274426,
"max": 0.01829527026
}
]
}Scenario: Isolated linker: repeat install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.008852993921269843,
"stddev": 0.00041348049709131275,
"median": 0.008773829580000002,
"user": 0.005087559999999998,
"system": 0.004513535714285716,
"min": 0.008084020580000002,
"max": 0.010160366580000002
},
{
"command": "pacquet@main",
"mean": 0.00873667632583334,
"stddev": 0.0010161406293518653,
"median": 0.00848407508,
"user": 0.004756868333333334,
"system": 0.004736470000000001,
"min": 0.0076922245799999995,
"max": 0.014802308580000001
},
{
"command": "pnpr@HEAD",
"mean": 0.008609989920659337,
"stddev": 0.0005684559569297681,
"median": 0.00850614258,
"user": 0.005454884175824176,
"system": 0.004030206593406592,
"min": 0.00776917958,
"max": 0.015183463580000002
},
{
"command": "pnpr@main",
"mean": 0.008877317167030723,
"stddev": 0.0012222605705020755,
"median": 0.008354096580000001,
"user": 0.005330793788395898,
"system": 0.004303141638225255,
"min": 0.0075907755799999995,
"max": 0.013555198580000002
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.60826059396,
"stddev": 0.03360389775940489,
"median": 2.60817024326,
"user": 2.59162604,
"system": 1.9576140600000003,
"min": 2.53599064926,
"max": 2.67077879126
},
{
"command": "pacquet@main",
"mean": 2.59017318146,
"stddev": 0.02690420943014548,
"median": 2.58723645826,
"user": 2.41563424,
"system": 1.9254250599999998,
"min": 2.55478713226,
"max": 2.63183750026
},
{
"command": "pnpr@HEAD",
"mean": 1.5924800709600002,
"stddev": 0.1086249553352099,
"median": 1.54603943676,
"user": 1.9896055400000001,
"system": 1.7331283599999998,
"min": 1.46581189526,
"max": 1.75025510026
},
{
"command": "pnpr@main",
"mean": 1.56189716576,
"stddev": 0.09740572706752826,
"median": 1.56292148626,
"user": 1.9443258399999999,
"system": 1.7877817599999997,
"min": 1.43823364926,
"max": 1.74481659526
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
Confirmation (reversed target order)
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.9377092513600003,
"stddev": 0.14028988628118944,
"median": 0.9537485726600001,
"user": 1.37312306,
"system": 2.0696971,
"min": 0.7126952816600001,
"max": 1.1584757906599998
},
{
"command": "pacquet@main",
"mean": 0.9935163044599999,
"stddev": 0.15926484705451874,
"median": 0.9706282936600001,
"user": 1.3447233600000001,
"system": 2.3329271,
"min": 0.72503330066,
"max": 1.33249806266
},
{
"command": "pnpr@HEAD",
"mean": 0.5068201249600001,
"stddev": 0.045131131915417774,
"median": 0.49461871016000003,
"user": 0.50545226,
"system": 0.9362810999999999,
"min": 0.45739534866000003,
"max": 0.5725184706600001
},
{
"command": "pnpr@main",
"mean": 0.39993582136000005,
"stddev": 0.028809062378996178,
"median": 0.39787870516,
"user": 0.36725025999999994,
"system": 0.8015471,
"min": 0.36573884066,
"max": 0.45679746066000004
}
],
"confirmation": {
"results": [
{
"command": "pnpr@main",
"mean": 0.35841205694,
"stddev": 0.01794978530885801,
"median": 0.35372540094000005,
"user": 0.30865669999999995,
"system": 0.7336780399999998,
"min": 0.33983757744000004,
"max": 0.39406774044000004
},
{
"command": "pnpr@HEAD",
"mean": 0.39584998844,
"stddev": 0.05534199280847524,
"median": 0.37679200644,
"user": 0.36326629999999993,
"system": 0.7945378399999999,
"min": 0.34854896044,
"max": 0.5054883424400001
},
{
"command": "pacquet@main",
"mean": 0.9422396305399999,
"stddev": 0.0874797578292505,
"median": 0.9553801069400001,
"user": 1.3319313,
"system": 2.0459548399999994,
"min": 0.7791632224400001,
"max": 1.11192667544
},
{
"command": "pacquet@HEAD",
"mean": 0.7692282475400002,
"stddev": 0.10254195543670287,
"median": 0.7798874884400001,
"user": 1.1257010999999997,
"system": 1.7332967399999997,
"min": 0.6393828944400001,
"max": 0.9266208054400001
}
]
}
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.6493999875,
"stddev": 0.03560669696919506,
"median": 1.6462270829,
"user": 0.90097632,
"system": 0.9762754000000001,
"min": 1.6103492289,
"max": 1.7139738069
},
{
"command": "pacquet@main",
"mean": 1.6575470461,
"stddev": 0.019325182384370292,
"median": 1.6542626329,
"user": 0.9290684199999999,
"system": 1.0466706000000001,
"min": 1.6357514029,
"max": 1.6943734539
},
{
"command": "pnpr@HEAD",
"mean": 0.29307888370000007,
"stddev": 0.010530426383568919,
"median": 0.2907866509,
"user": 0.24326602,
"system": 0.6029106,
"min": 0.2805493149,
"max": 0.31712512290000006
},
{
"command": "pnpr@main",
"mean": 0.29940316180000004,
"stddev": 0.0157020865252651,
"median": 0.29321289990000005,
"user": 0.25503681999999994,
"system": 0.6148234999999999,
"min": 0.2843369269,
"max": 0.33119109690000004
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.28207857336,
"stddev": 0.02356828699673992,
"median": 0.28354279066,
"user": 0.24771236000000002,
"system": 0.33400066,
"min": 0.25396412866,
"max": 0.31492150266
},
{
"command": "pacquet@main",
"mean": 0.27548570626,
"stddev": 0.016679991050545944,
"median": 0.27243160566,
"user": 0.23203156000000003,
"system": 0.34053895999999995,
"min": 0.24852697866000004,
"max": 0.29946104266
},
{
"command": "pnpr@HEAD",
"mean": 0.0947595349457143,
"stddev": 0.003474038366135733,
"median": 0.09375935916,
"user": 0.03329704571428572,
"system": 0.025430924285714283,
"min": 0.09010528666,
"max": 0.10257275166
},
{
"command": "pnpr@main",
"mean": 0.09644686366000002,
"stddev": 0.004496425821315583,
"median": 0.09568647416,
"user": 0.035934626666666664,
"system": 0.024806793333333337,
"min": 0.08884898766,
"max": 0.10515441066
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.23141401681333335,
"stddev": 0.01477030839230968,
"median": 0.22919933548000002,
"user": 0.24946741555555552,
"system": 0.07378916666666666,
"min": 0.21145582248,
"max": 0.26322523148000004
},
{
"command": "pacquet@main",
"mean": 0.22818409825777777,
"stddev": 0.009354460573049082,
"median": 0.22880224748,
"user": 0.24576008222222223,
"system": 0.07262716666666666,
"min": 0.21358344348,
"max": 0.24650141648
},
{
"command": "pnpm@HEAD",
"mean": 3.9496080385911108,
"stddev": 0.10256595842730487,
"median": 3.9266849884800004,
"user": 6.181421415555556,
"system": 0.3728378333333333,
"min": 3.82346702248,
"max": 4.10977028248
}
]
}Scenario: Isolated linker: linked-workspace resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.08982192183393939,
"stddev": 0.011804067329487987,
"median": 0.08538008944,
"user": 0.07964108848484851,
"system": 0.059281258787878786,
"min": 0.08021595244,
"max": 0.12370234344
},
{
"command": "pacquet@main",
"mean": 0.08518046047124998,
"stddev": 0.004119842048339378,
"median": 0.08342780944,
"user": 0.07767149000000002,
"system": 0.05407456749999999,
"min": 0.08049216944,
"max": 0.09672285144000001
}
]
}Scenario: Isolated linker: injected workspace repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.08801714533818185,
"stddev": 0.0027815734944976224,
"median": 0.08730988351999999,
"user": 0.028897084848484845,
"system": 0.06614121151515151,
"min": 0.08455086552,
"max": 0.10028430952
},
{
"command": "pacquet@main",
"mean": 0.08575347978470585,
"stddev": 0.0019072218064670587,
"median": 0.08526879602000001,
"user": 0.03144271764705882,
"system": 0.06106294235294116,
"min": 0.08334666252,
"max": 0.09106907252
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.602014945999999,
"stddev": 0.1980224605306331,
"median": 4.540204769799999,
"user": 2.2730508599999997,
"system": 1.8969695599999998,
"min": 4.3644633893,
"max": 4.9097856313
},
{
"command": "pacquet@main",
"mean": 4.7431079134,
"stddev": 0.1892709063899562,
"median": 4.7054758058,
"user": 2.40827396,
"system": 2.0996995600000004,
"min": 4.4922756613,
"max": 5.1497941893
},
{
"command": "pnpr@HEAD",
"mean": 3.7210056485000003,
"stddev": 0.20272220946116898,
"median": 3.7546597188,
"user": 2.17827486,
"system": 1.9136752600000002,
"min": 3.4553473023000003,
"max": 4.0233955193
},
{
"command": "pnpr@main",
"mean": 3.7043417965000005,
"stddev": 0.16534403432105804,
"median": 3.6870285183,
"user": 2.26395646,
"system": 1.9762232599999998,
"min": 3.5139456903000004,
"max": 4.0615636893
}
]
}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.15775695428470587,
"stddev": 0.015477898217856289,
"median": 0.15350594852000002,
"user": 0.17593930823529408,
"system": 0.19725477294117644,
"min": 0.13391384552000002,
"max": 0.18276602552000001
},
{
"command": "pacquet@main",
"mean": 0.13689970199368423,
"stddev": 0.014225762564863456,
"median": 0.13306138152000002,
"user": 0.15357072000000002,
"system": 0.17173542,
"min": 0.10803313552,
"max": 0.17413196252000002
},
{
"command": "pnpr@HEAD",
"mean": 0.1551839282075,
"stddev": 0.0085669000166845,
"median": 0.15383417852000003,
"user": 0.165547845,
"system": 0.163740545,
"min": 0.14320940852000003,
"max": 0.17516966052000002
},
{
"command": "pnpr@main",
"mean": 0.15207515487294118,
"stddev": 0.01437067322270318,
"median": 0.15646249652000002,
"user": 0.15613719058823528,
"system": 0.17661012588235292,
"min": 0.11640625952000001,
"max": 0.17240657052000002
}
]
}Scenario: Store only: unlocked direct deps, cold cache + hot storeStore-only install (
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.2582291433000001,
"stddev": 0.05807298210785099,
"median": 1.2927638344,
"user": 0.52491088,
"system": 0.25557308,
"min": 1.1731016483999999,
"max": 1.3135629093999999
},
{
"command": "pacquet@main",
"mean": 1.2308079403999999,
"stddev": 0.046410256540767164,
"median": 1.2146766729,
"user": 0.54313618,
"system": 0.25518448,
"min": 1.1801665504,
"max": 1.3012611154
}
]
}Scenario: Cargo: repeat install, hot cache + hot storeFrozen repeat install of a Cargo workspace (
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.03449460722142857,
"stddev": 0.002285202739721981,
"median": 0.0337381454,
"user": 0.025610739047619045,
"system": 0.020719810952380947,
"min": 0.032191428900000006,
"max": 0.04743719490000001
},
{
"command": "pacquet@main",
"mean": 0.035397423947058825,
"stddev": 0.0029219088968435144,
"median": 0.034224230900000006,
"user": 0.025089914117647057,
"system": 0.022615444705882354,
"min": 0.032105068900000006,
"max": 0.0498485779
}
]
} |
63c0ec6 to
14f67fe
Compare
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
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/run/recursive.rs (1)
96-97: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winRetain rationale for the non-obvious lifecycle guards.
The condensed comments remove useful explanations for:
- initializing lifecycle environment state once per recursive run;
- skipping the empty/args-less
only-allowscripts;- preventing recursive re-entry for the same lifecycle event and source directory;
- relying on caller validation before
run_stages;- exempting
testfrom the no-script error.Keep brief invariant/exception comments for these branches without narrating straightforward code.
As per path instructions, comments should explain non-obvious invariants, workarounds, deliberate exceptions, and contracts.
Also applies to: 117-126, 135-136, 170-171
🤖 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 96 - 97, Restore concise comments near the lifecycle guards in the recursive run flow: explain one-time environment initialization around init_cwd, skipping empty or args-less only-allow scripts, preventing re-entry for the same lifecycle event and source directory, relying on caller validation before run_stages, and exempting test from the no-script error. Keep comments focused on these invariants and exceptions without describing straightforward operations.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 `@pnpm/crates/cli/src/cli_args/run.rs`:
- Line 126: Update the execution flow around specified_scripts and the run
dispatch near lines 171-180 so --sequential runs scripts serially, while the
default mode executes all selected scripts concurrently and awaits their
completion. Preserve existing script selection and result/error handling, and
add a regression test that observes multiple matching scripts running
concurrently without --sequential.
- Around line 385-391: Update parse_regexp_selector to require a successful
rsplit_once('/') after the leading slash, rejecting "/" and selectors without a
closing delimiter instead of constructing an empty or unterminated pattern.
Preserve the existing no-flags validation, and add regression tests in
run/tests.rs covering both malformed selectors returning no matches.
In `@pnpm/crates/cli/src/cli_args/run/recursive.rs`:
- Line 22: Restore the documentation comment for the recursive-run error enum
near the “Errors surfaced by a recursive run” declaration to include a concise
reference to pnpm’s canonical error codes and messages/shared error-code
contract. Keep the change limited to contract documentation and ensure it
reflects the required user-facing error mapping.
- Line 2: Update the comments surrounding run_recursive and its related
filtering/selection logic to document the user-visible ordering contract: --sort
uses topological ordering, while the default preserves graph insertion order.
Also retain a concise comment that an empty filtered workspace is intentionally
a no-op, without changing the implementation.
In `@pnpm11/exec/commands/test/index.ts`:
- Around line 828-845: Update the RegExp script matching test to set
workspaceConcurrency to 1 while leaving sequential unset or false, ensuring
script completion follows alphabetical dispatch order. Then assert that
order.log contains exactly “amz” after run.handler completes.
---
Outside diff comments:
In `@pnpm/crates/cli/src/cli_args/run/recursive.rs`:
- Around line 96-97: Restore concise comments near the lifecycle guards in the
recursive run flow: explain one-time environment initialization around init_cwd,
skipping empty or args-less only-allow scripts, preventing re-entry for the same
lifecycle event and source directory, relying on caller validation before
run_stages, and exempting test from the no-script error. Keep comments focused
on these invariants and exceptions without describing straightforward
operations.
🪄 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: 40606c31-a8f3-44e7-8202-8328c976d858
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock,!Cargo.lock
📒 Files selected for processing (9)
.changeset/fix-regex-script-order.mdCargo.tomlpnpm/crates/cli/Cargo.tomlpnpm/crates/cli/src/cli_args/run.rspnpm/crates/cli/src/cli_args/run/recursive.rspnpm/crates/cli/src/cli_args/run/tests.rspnpm11/exec/commands/src/run.tspnpm11/exec/commands/src/runRecursive.tspnpm11/exec/commands/test/index.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- .changeset/fix-regex-script-order.md
- pnpm11/exec/commands/src/runRecursive.ts
There was a problem hiding this comment.
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/run.rs (1)
171-216: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winpnpm/crates/cli/src/cli_args/run.rs:171-216 — The non-sequential branch still runs scripts one at a time.
map(...).collect()is lazy, and each iteration joins the spawned thread before the next script is requested, so this remains sequential execution with extra thread overhead. Split spawning and joining into separate passes so all handles are created before any joins.🤖 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.rs` around lines 171 - 216, Update the non-sequential branch in the run command to separate thread creation from result collection: first iterate over the filtered scripts and collect all successfully spawned handles, then join those handles in a second pass. Preserve existing handling for skipped scripts, resolution errors, panics, and failed statuses while ensuring every eligible script starts before any join occurs.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.
Outside diff comments:
In `@pnpm/crates/cli/src/cli_args/run.rs`:
- Around line 171-216: Update the non-sequential branch in the run command to
separate thread creation from result collection: first iterate over the filtered
scripts and collect all successfully spawned handles, then join those handles in
a second pass. Preserve existing handling for skipped scripts, resolution
errors, panics, and failed statuses while ensuring every eligible script starts
before any join occurs.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 566337e5-1174-4025-8891-73fca695f12c
📒 Files selected for processing (2)
pnpm/crates/cli/src/cli_args/run.rspnpm/crates/cli/src/cli_args/run/recursive.rs
🚧 Files skipped from review as they are similar to previous changes (1)
- pnpm/crates/cli/src/cli_args/run/recursive.rs
5797061 to
06cb033
Compare
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
eb115b5 to
05d440a
Compare
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
@zkochan Could you take another look? I see it's approved but not merged; is anything missing to move forward? thanks! |
…tched scripts Non-sequential runs sort alphabetically for deterministic parallelism, while --sequential preserves package.json insertion order. Fixes pnpm#13174. Co-authored-by: MattIPv4 <[email protected]>
05d440a to
22092fc
Compare
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
Execution Profiles recorded for 1 job, triggered by
|
|
@zkochan I see there's an automerge tag, but when is it going to be merged? |
|
The referenced issue was fixed. This is a new feature that nobody asked for. |
Summary
Fixes the regression introduced in pnpm/pnpm#13074 where regex-matched scripts only executed in lexicographic order. The
getSpecifiedScriptsfunction now accepts a sort parameter: non-sequential (parallel) runs sort alphabetically for deterministic behavior, while--sequentialpreservespackage.jsoninsertion order as reported in pnpm/pnpm#13174. This gives both predictability in parallel mode and developer control over execution order in sequential mode.The Rust pacquet port now also supports
/regexp/script selectors with the same dual-ordering behavior for parity.Squash Commit Body
Checklist
pnpm/port, or the description notes what still needs porting.pnpm changeset) if this PR changes any published package. Keep it short and written for pnpm users — it becomes a release note.Summary by CodeRabbit
Bug Fixes
package.jsoninsertion order when running with--sequential.--sequential, regex-selected scripts now run in alphabetical/lexicographic order for deterministic parallel execution./pattern/regex selector support to the CLI, ignoring unsupported regex flags and invalid selector patterns.Tests