Repository navigation
Conversation
`approve-builds` declared `--global` without the `-g` short form its ten peers all carry, so `pnpm approve-builds -g` died in the argument parser instead of reaching pnpm's own ERR_PNPM_APPROVE_BUILDS_NOT_SUPPORTED_WITH_GLOBAL. pnpm accepts `-g` wherever it accepts `--global`. The `--workspace-root` conflict table now runs over both spellings, which is the property that was missing: it used the long form throughout precisely because this one command rejected the short one, so the gap it had surfaced went unasserted. Dropping the short form again fails the table, naming the subcommand and the spelling. Closes #13310 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
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 (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthrough
ChangesApprove builds global flag
Estimated code review effort: 2 (Simple) | ~10 minutes Assessment against linked issues
Possibly related PRs
Suggested labels: Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PR Summary by QodoFix approve-builds to accept -g short flag for --global
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (4): Last reviewed commit: "test(cli): assert the approve-builds --g..." | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/tests.rs`:
- Around line 661-679: The existing loop in the CLI argument tests only
validates the -w conflict path and does not directly verify approve-builds
global-option behavior. Add a focused test for approve-builds using both -g and
--global that asserts each produces the same canonical
ERR_PNPM_APPROVE_BUILDS_NOT_SUPPORTED_WITH_GLOBAL code and message, while
retaining the existing GLOBAL_SUBCOMMAND_ARGV conflict coverage.
🪄 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: 15d19f8f-26cd-4955-bda6-d4a31698537d
📒 Files selected for processing (3)
.changeset/pacquet-approve-builds-short-global.mdpnpm/crates/cli/src/cli_args/approve_builds.rspnpm/crates/cli/src/cli_args/tests.rs
Code Review by Qodo
Context used✅ Compliance rules (platform):
24 rules 1. Historical used to doc comment
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Micro-Benchmark ResultsLinux |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #13329 +/- ##
==========================================
- Coverage 87.05% 87.03% -0.02%
==========================================
Files 532 533 +1
Lines 91601 91682 +81
==========================================
+ Hits 79741 79795 +54
- Misses 11860 11887 +27 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The `--workspace-root` conflict table proves `-g` parses, not that it reaches the right error, so it would still pass if the flag later mapped somewhere else. The end-to-end rejection test already asserted the error code for `--global`; run it over both spellings instead of adding a parallel one. Dropping the short form fails it. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Fair — fixed in the latest commit. You're right that the Rather than add a parallel assertion, I ran the existing end-to-end rejection test over both spellings — for global in ["--global", "-g"] {
let assert = pacquet(&workspace).with_args(["approve-builds", global]).assert().failure();
assert!(stderr.contains("ERR_PNPM_APPROVE_BUILDS_NOT_SUPPORTED_WITH_GLOBAL"), "{global} stderr: {stderr}");
}Both layers of coverage are retained, as you asked: the conflict table still runs over both spellings for all twelve global-accepting subcommands, and this one pins the error itself. Verified both fail when the short form is removed again. 2222 tests pass, lint and dylint clean. Written by an agent (Claude Code, claude-opus-5). |
|
Code review by qodo was updated up to the latest commit 6d4d55d |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
pnpm/crates/cli/tests/approve_builds.rs (1)
348-350: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse a regular rationale comment and remove implementation history.
These lines document a private test, not a public API contract, and narrate removed parser behavior. Keep only the invariant this test protects in a regular
//comment.Proposed fix
-/// Both spellings reach the same rejection. `-g` used to stop in the -/// argument parser instead (pnpm/pnpm#13310), which the long form alone -/// could not have caught. +// Both spellings must reach the canonical unsupported-global rejection.As per coding guidelines, rustdoc comments are for public API contracts and regular comments are for implementation rationale. As per path instructions, comments must not describe removed implementation history.
🤖 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/tests/approve_builds.rs` around lines 348 - 350, Replace the rustdoc comment above the relevant test in approve_builds.rs with a regular // comment that states only the invariant: both short and long option spellings reach the same rejection. Remove the references to the private test’s history, prior parser behavior, and issue number.Sources: Coding guidelines, 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/tests/approve_builds.rs`:
- Around line 359-362: Update the regression assertions in the approve-builds
test to validate both the ERR_PNPM_APPROVE_BUILDS_NOT_SUPPORTED_WITH_GLOBAL code
and the canonical user-facing error message for each global-option spelling,
including -g and --global. Keep the existing stderr context while ensuring both
invocations assert the same expected message.
---
Nitpick comments:
In `@pnpm/crates/cli/tests/approve_builds.rs`:
- Around line 348-350: Replace the rustdoc comment above the relevant test in
approve_builds.rs with a regular // comment that states only the invariant: both
short and long option spellings reach the same rejection. Remove the references
to the private test’s history, prior parser behavior, and issue number.
🪄 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: 935d7697-5c41-4f6a-9f16-1bdf638181e9
📒 Files selected for processing (1)
pnpm/crates/cli/tests/approve_builds.rs
Running the table over both spellings turned one `dbg!` into 24 lines of output on a passing run. The failure diagnostic it provided now lives in the assertion message, which prints only when the assertion actually fails. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Code review by qodo was updated up to the latest commit 1bf15b6 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
The code alone would not catch the two spellings drifting to different user-facing text, which is the thing this PR is about. Assert the canonical message for each as well. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Code review by qodo was updated up to the latest commit 3fb9472 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
`approve-builds` declared `--global` without the `-g` short form its ten peers all carry, so `pnpm approve-builds -g` died in the argument parser instead of reaching pnpm's own ERR_PNPM_APPROVE_BUILDS_NOT_SUPPORTED_WITH_GLOBAL. pnpm accepts `-g` wherever it accepts `--global`. The `--workspace-root` conflict table now runs over both spellings, which is the property that was missing: it used the long form throughout precisely because this one command rejected the short one, so the gap it had surfaced went unasserted. Dropping the short form again fails the table, naming the subcommand and the spelling. Closes pnpm#13310
Summary
approve-buildsdeclared--globalwithout the-gshort form its ten peers all carry, so the short spelling failed in the argument parser instead of reaching pnpm's own error:pnpm accepts
-gwherever it accepts--global.approve-buildswas the only command out of eleven that did not.Test
The
--workspace-rootconflict table now runs over both spellings, which is the property that was actually missing. That table used the long form throughout precisely because this command rejected the short one — so the gap it had surfaced was never asserted. Dropping the short form again fails it, naming both the subcommand and the spelling:Verified against v11.17.0: both
-gand--globalnow produceERR_PNPM_APPROVE_BUILDS_NOT_SUPPORTED_WITH_GLOBALon both stacks.TypeScript CLI: no change needed — it is the reference.
Closes #13310
Squash Commit Body
Checklist
pnpm/port, or the description notes what still needs porting.Rust-only: the TypeScript CLI is the reference behavior being matched.
pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
The existing
--globalconflict table, extended to both spellings.Written by an agent (Claude Code, claude-opus-5).
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
Bug Fixes
-gshorthand forpnpm approve-builds.--globaland-g.--globaland-g.Tests
--globaland-gspellings.