Repository navigation
Conversation
|
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 (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis change adds merge-conflict detection to optimistic repeat installs and generalizes workspace-state drift handling. It also expands CLI, resolver, lockfile-verification, regression, known-failure, release, and test-porting coverage. ChangesPacquet behavior and test coverage
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant Install as pacquet install
participant Repeat as optimistic repeat-install check
participant Lockfiles as workspace and project lockfiles
Install->>Repeat: evaluate fast-path decision
Repeat->>Lockfiles: scan modified lockfiles for conflict markers
Lockfiles-->>Repeat: safe or conflict-marked status
Repeat-->>Install: UpToDate or Skipped decision
Possibly related 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 QodoStage 10 test ports + safer optimistic repeat installs (ignored settings, conflict locks)
AI Description
Diagram
High-Level Assessment
Files changed (20)
|
Port the remaining Stage 10 lockfile verification and optimistic repeat install coverage. Add catalog, peer, optional dependency, install-state, and hoisting tests. Record known-failure boundaries for features that are not implemented yet. Related to #13146.
Code Review by Qodo
1.
|
Micro-Benchmark ResultsLinux |
PR Code Suggestions ✨Latest suggestions up to 26ec0aa Warning
Previous suggestionsSuggestions up to commit dae0c57
Suggestions up to commit 99bc970
|
||||||||||||||||||||||||||||||||
Confidence Score: 5/5Safe to merge — the change is test-only except for the conflict-marker scan and the settings-drift API refactor, both of which are internally consistent, well-tested, and conservative. The conflict-marker scan is correctly implemented with proper symlink rejection, TOCTOU guards, boundary-spanning detection, and size limits. The settings-drift refactor preserves all previously tested behaviour. Tests follow all project conventions. No files require special attention. Reviews (4): Last reviewed commit: "test(pacquet): improve optimistic instal..." | Re-trigger Greptile |
|
Code review by qodo was updated up to the latest commit 628809d |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13161 +/- ##
==========================================
+ Coverage 85.85% 86.44% +0.58%
==========================================
Files 505 508 +3
Lines 84029 85078 +1049
==========================================
+ Hits 72147 73542 +1395
+ Misses 11882 11536 -346 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
pnpm/crates/package-manager/src/optimistic_repeat_install.rs (1)
1573-1606: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
check_deps_status_before_runlacks the merge-conflict lockfile guard added to its near-twin.
check_optimistic_repeat_install_ignoringnow skips the fast path when a lockfile has merge-conflict markers, butcheck_deps_status_before_run— which mirrors the same fast-path logic for thepnpm runpre-flight check — has no equivalent call tohas_conflicted_lockfile. A conflicted lockfile could still be reported as "up to date" (or fall through without the new diagnosability) forrun, which is inconsistent with the install path's new safeguard.🤖 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/package-manager/src/optimistic_repeat_install.rs` around lines 1573 - 1606, Add the same has_conflicted_lockfile guard used by check_optimistic_repeat_install_ignoring to check_deps_status_before_run, before its fast-path status checks. Ensure conflicted lockfiles return the appropriate outdated status with the existing install arguments and diagnostic behavior, while preserving the current PnP and setting-drift handling.
🤖 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/package-manager/src/optimistic_repeat_install.rs`:
- Around line 151-154: Move the has_conflicted_lockfile(check) guard to after
the cheap load_workspace_state workspace-state check in the repeat-install
decision flow. Preserve the existing Decision::Skipped result and reason, while
ensuring missing or unchanged workspace state returns before scanning lockfiles.
---
Outside diff comments:
In `@pnpm/crates/package-manager/src/optimistic_repeat_install.rs`:
- Around line 1573-1606: Add the same has_conflicted_lockfile guard used by
check_optimistic_repeat_install_ignoring to check_deps_status_before_run, before
its fast-path status checks. Ensure conflicted lockfiles return the appropriate
outdated status with the existing install arguments and diagnostic behavior,
while preserving the current PnP and setting-drift handling.
🪄 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: cbc08245-542d-4632-a144-42611ede3fc3
📒 Files selected for processing (20)
.changeset/calm-jars-smile.mdpnpm/crates/cli/tests/add.rspnpm/crates/cli/tests/catalog.rspnpm/crates/cli/tests/hoist.rspnpm/crates/cli/tests/install_state.rspnpm/crates/cli/tests/lifecycle_scripts.rspnpm/crates/cli/tests/lockfile_verification.rspnpm/crates/cli/tests/optional_dependencies.rspnpm/crates/cli/tests/peer_resolution.rspnpm/crates/lockfile-verification/src/cache/tests.rspnpm/crates/lockfile-verification/src/record_lockfile_verified.rspnpm/crates/lockfile-verification/src/record_lockfile_verified/tests.rspnpm/crates/lockfile-verification/src/verify_lockfile_resolutions/tests.rspnpm/crates/package-manager/src/optimistic_repeat_install.rspnpm/crates/package-manager/src/optimistic_repeat_install/tests.rspnpm/crates/resolving-deps-resolver/src/resolve_peers/tests.rspnpm/crates/resolving-deps-resolver/src/tests.rspnpm/crates/resolving-npm-resolver/src/create_npm_resolution_verifier/tests.rspnpm/crates/resolving-npm-resolver/src/pick_package/tests.rspnpm/plans/TEST_PORTING.md
There was a problem hiding this comment.
🧹 Nitpick comments (1)
pnpm/crates/package-manager/src/optimistic_repeat_install/tests.rs (1)
1970-1973: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueAdd
dbg!(&decision)before non-trivial assertions and clean up formatting.As per path instructions in
pnpm/CODE_STYLE_GUIDE.md, non-trivial assertions should log their inputs (e.g., usingdbg!) so that test failures provide actionable context, sincematches!hides the actual enum value on failure. Additionally, the trailing,);inside theassert!macro can be cleaned up.
pnpm/crates/package-manager/src/optimistic_repeat_install/tests.rs#L1970-L1973: Log the decision and remove the trailing comma.pnpm/crates/package-manager/src/optimistic_repeat_install/tests.rs#L1994-L1997: Log the decision and remove the trailing comma.pnpm/crates/package-manager/src/optimistic_repeat_install/tests.rs#L2019-L2022: Log the decision and remove the trailing comma.♻️ Proposed refactor (apply to all sites)
+ dbg!(&decision); - assert!(matches!( - decision, - Decision::Skipped { reason } if reason.contains("cannot be checked"), - ),); + assert!(matches!( + decision, + Decision::Skipped { reason } if reason.contains("cannot be checked") + ));🤖 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/package-manager/src/optimistic_repeat_install/tests.rs` around lines 1970 - 1973, Update the three assertions matching Decision::Skipped in pnpm/crates/package-manager/src/optimistic_repeat_install/tests.rs at lines 1970-1973, 1994-1997, and 2019-2022: add dbg!(&decision) immediately before each non-trivial assert and remove the trailing comma after each assert! macro invocation.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.
Nitpick comments:
In `@pnpm/crates/package-manager/src/optimistic_repeat_install/tests.rs`:
- Around line 1970-1973: Update the three assertions matching Decision::Skipped
in pnpm/crates/package-manager/src/optimistic_repeat_install/tests.rs at lines
1970-1973, 1994-1997, and 2019-2022: add dbg!(&decision) immediately before each
non-trivial assert and remove the trailing comma after each assert! macro
invocation.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 39bf589f-9f9c-4d84-bbfc-97a0b6a1862e
📒 Files selected for processing (2)
pnpm/crates/package-manager/src/optimistic_repeat_install.rspnpm/crates/package-manager/src/optimistic_repeat_install/tests.rs
🚧 Files skipped from review as they are similar to previous changes (1)
- pnpm/crates/package-manager/src/optimistic_repeat_install.rs
|
Code review by qodo was updated up to the latest commit c2a686c |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Summary
Completes Stage 10 of #13146 by porting the remaining long-tail pacquet suites for lockfile verification, optimistic repeat installs, catalogs, peer resolution, optional dependencies, install state, and hoisting.
Adds the missing optimistic repeat-install parity for ignored workspace-state settings and conflicted lockfiles. Features that are not implemented yet are represented by explicit known-failure boundaries in the port tracker.
This is Rust-only test/parity work. The corresponding TypeScript behavior is the upstream source coverage being ported.
Squash Commit Body
Checklist
pnpm/port, or the description notes what still needs porting.pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
Written by an agent (Codex, GPT-5).
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Summary by CodeRabbit
devDependencieswhen appropriate).