Repository navigation
Conversation
|
Warning Review limit reached
Next review available in: 8 seconds You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds ChangesFilesystem link handling
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant pnpm as pnpm clean/deploy
participant remove_dirent
participant FS as Filesystem
pnpm->>remove_dirent: remove path
remove_dirent->>FS: inspect entry without following links
FS-->>remove_dirent: entry type
remove_dirent->>FS: unlink link or remove directory
remove_dirent-->>pnpm: success or not-found
sequenceDiagram
participant symlink_dir
participant WindowsAPI
participant Junction
symlink_dir->>WindowsAPI: create symlink
WindowsAPI-->>symlink_dir: error 1314
symlink_dir->>Junction: create NTFS junction
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 Windows symlink privilege fallback and safe removal of dir-shaped links
AI Description
Diagram
High-Level Assessment
Files changed (10)
|
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (4): Last reviewed commit: "test(cli): require NotFound for the .pnp..." | Re-trigger Greptile |
Micro-Benchmark ResultsLinux |
Code Review by Qodo
1. Clean test order assumption
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13707 +/- ##
=======================================
Coverage 88.19% 88.20%
=======================================
Files 615 616 +1
Lines 99955 99951 -4
=======================================
+ Hits 88157 88160 +3
+ Misses 11798 11791 -7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Responses to the Qodo review findings: 1. Reparse deletion bypass (deploy) — not applicable. Every redirecting reparse point (symlink or junction/mount point) carries the name-surrogate bit, so 2. 3. Changeset missing Written by an agent (Claude Code, claude-fable-5). |
|
Code review by qodo was updated up to the latest commit 1b539e9 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
… on Windows Two Windows failures from #13694: 1. The junction fallback in symlink_dir only matched PermissionDenied, but Rust std maps ERROR_PRIVILEGE_NOT_HELD (os error 1314) to Uncategorized, so installs failed outright for users without Developer Mode or elevation instead of falling back to junctions. Match the raw os error too. 2. Removal sites dispatched on is_dir(), which is false on Windows for junctions, directory symlinks (name-surrogate reparse points), and dangling links, routing them to DeleteFileW, which fails on directory-shaped entries with ERROR_ACCESS_DENIED (os error 5). Add pacquet_fs::remove_dirent, which unlinks directory-shaped links with RemoveDirectoryW without following them, and use it in clean, deploy, and the virtual-store pruner. The TypeScript CLI is unaffected: it removes with rimraf and links via the symlink-dir package, both of which already handle junctions. Closes #13694 Co-Authored-By: Claude Fable 5 <[email protected]>
A permission or I/O error inspecting the link would have satisfied is_err() while the entry still existed. Co-Authored-By: Claude Fable 5 <[email protected]>
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/tests/suite/clean.rs`:
- Line 63: Replace the .pnpm Path::exists() assertion with fs::symlink_metadata
and assert that it returns an ErrorKind::NotFound error, matching the existing
package-link removal assertion and ensuring other metadata failures cause the
test to fail.
🪄 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: Pro Plus
Run ID: 86929f2b-e502-4db0-b69a-700a16792b51
📒 Files selected for processing (1)
pnpm/crates/cli/tests/suite/clean.rs
Co-Authored-By: Claude Fable 5 <[email protected]>
|
Code review by qodo was updated up to the latest commit 4daf2b7 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
Code review by qodo was updated up to the latest commit ff8e38a |
Summary
Fixes two Windows failures in the Rust CLI reported in #13694 (Closes #13694):
os error 1314during install. The junction fallback inpacquet_fs::symlink_dironly matchedio::ErrorKind::PermissionDenied, but Rust std mapsERROR_PRIVILEGE_NOT_HELD(1314) toUncategorized. On a machine without Developer Mode or elevation,CreateSymbolicLinkWfails with 1314, so the fallback never fired and the install aborted. The fallback now also matches the raw os error. (pnpm v11 worked because thesymlink-dirnpm package falls back to junctions.)os error 5frompnpm clean(andpnpm deploy --force). Removal sites dispatched onis_dir(), which on Windows isfalsefor junctions, directory symlinks (name-surrogate reparse points), and dangling links, so directory-shaped links were routed toDeleteFileW, which fails on them withERROR_ACCESS_DENIED.cleanalways hits this:.pnpmsorts before the package names, so every top-level package link dangles by the time it is removed. Addedpacquet_fs::remove_dirent, which removes any dirent without following links (dir-shaped links are unlinked viaRemoveDirectoryW), and switchedclean,deploy, and the virtual-store pruner to it.The TypeScript CLI is unaffected — it links via the
symlink-dirpackage and removes with rimraf, both junction-safe — so this is a Rust-only fix with apacquet-only changeset.Behavioral note on
deploy: a deploy target that is a non-name-surrogate reparse directory (e.g. a dedup-enabled folder) was previously removed with a bareRemoveDirectoryW, which fails on a non-empty directory; it now goes throughremove_dir_all, whose traversal is already link-safe.Squash Commit Body
Checklist
already linked to it solves it.
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 (Claude Code, claude-fable-5).
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
pnpm cleanandpnpm deploy --force.