Repository navigation
fix(exec): revert script ordering change for pnpm run --sequential /regex/ - #13175
Conversation
|
💖 Thanks for opening this pull request! 💖 |
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? |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughRegex-selected scripts used with ChangesRegex script ordering
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
Possibly related PRs
Suggested labels: Suggested reviewers: ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. 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/5Safe to merge — the change is a one-line removal of a sort that was already flagged as a breaking regression, and the updated test covers the restored behaviour. The change is a targeted revert of a single No files require special attention. Reviews (4): Last reviewed commit: "fix(exec): revert script ordering change..." | Re-trigger Greptile |
There was a problem hiding this comment.
Pull request overview
Reverts the regex-selected script execution ordering so pnpm run --sequential /regex/ runs matched scripts in package.json insertion order (instead of lexicographical order), restoring pre-pnpm/pnpm#13074 behavior in the TypeScript CLI.
Changes:
- Removed
.sort()from regex script selection (getSpecifiedScripts) so selection preservespackage.jsonorder. - Updated the test to assert
package.jsonordering (and adjusted expected log output). - Added a changeset for the behavior change.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pnpm11/exec/commands/src/runRecursive.ts | Stops sorting regex-matched script names, preserving package.json key order. |
| pnpm11/exec/commands/test/index.ts | Updates the regression test to validate package.json ordering under --sequential. |
| .changeset/some-games-smash.md | Adds a release note entry for the ordering revert (needs pnpm package included). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
4247ce3 to
a613ea2
Compare
|
I don't think reverting is a good idea; we should implement validation that excludes the regex case. Besides, this should also be resolved in the pacquet, since at this point I doubt the same error even exists. |
@kairosci I'm not sure I understand what you're saying? This was a breaking change in behaviour introduced in a non-semver-major release, it needs to be reverted? I have updated the test case to match the behaviour prior to the change you made.
Yes, I have called that out in the description that this likely needs to also be addressed in the Rust implementation, though that is beyond my knowledge. |
a613ea2 to
2bfdf80
Compare
|
I understand your point, but since it's going to be fixed anyway, we might as well fix it directly without rolling it back. Moreover ci fails. |
I'm still not sure I understand. This PR is fixing it directly? The fix is to revert the behavior to how it was before?
Should be fixed now 👍 I would appreciate you helping by suggesting changes rather than just repeatedly telling me how this fix to a breaking change you made is wrong. |
2bfdf80 to
8b16905
Compare
Okay... what is a solution to you then? How do you intend to restore the behaviour that the package had before without restoring that behaviour? That sentence alone makes no sense. Again, could I ask that you actually try to help here instead of just pointing out in vague terms how you think this PR is wrong? |
|
Sorry for rushed and superficial messages. I've taken care of it in #13199 by adding a sort parameter to getSpecifiedScripts / specified_scripts: non-sequential runs sort alphabetically for deterministic parallelism, while --sequential preserves package.json insertion order. Same approach landed in the Rust pacquet port with /regexp/ selector support for parity. |
|
Ah okay, that makes more sense, though isn't the ordering from package.json also deterministic (I'm not sure I follow why parallel runs need different sorting)? Thanks for getting that PR up though to ensure the Rust implementation is equivalent, hopefully that lands soon to fix this and unblock us updating our pnpm usage 🙏 |
|
That’s a valid question; the order in The point is something else: in parallel mode, the user does not control the order in which child processes complete (the output is interleaved), so an arbitrary but stable order (alphabetical) makes the behavior predictable and comparable across CI runs, machines, and branches; regardless of how someone reorganizes the scripts in With |
|
The breaking change should be reverted. Sorry for not noticing this in the original PR. |
|
Congrats on merging your first pull request! 🎉🎉🎉 |
Summary
Reverts the lexicographical sorting of scripts introduced in #13074, as this was a breaking change in behaviour. When using
pnpm run --sequential /regex/, scripts will now be executed in the order they are listed inpackage.json, giving developers control over the order without needing odd script prefixes. Fixes #13174.I'm unfortunately not familiar enough with Rust to confidently port this to the new implementation (and didn't want to set an agent on it without being able to review what it did myself). This may be a case where the Rust version introduces a breaking change to this behaviour when released (though I would very much prefer to have it also match the
package.jsonorder so developers have more control).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.
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Summary by CodeRabbit
pnpm run --sequentialRegExp-based script selection to execute in the same order scripts appear inpackage.json, rather than alphabetical order.--sequentialcoverage to assert the new execution order, including corresponding expected output changes.