Repository navigation
Revert "perf: do not canonicalize the entry path (#848)" - #204
Conversation
This reverts commit ea425f6.
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR implements conditional realpath normalization in the module resolver based on a ChangesSymlink Resolution with Conditional Realpath Normalization
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #204 +/- ##
=======================================
Coverage 93.11% 93.11%
=======================================
Files 21 21
Lines 4082 4083 +1
=======================================
+ Hits 3801 3802 +1
Misses 281 281 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@fixtures/symlink-with-nested-node_modules/.gitignore`:
- Line 1: Replace the negated gitignore pattern "!node_modules" with an
excluding pattern "node_modules/" in the .gitignore (replace the literal string
'!node_modules' in fixtures/symlink-with-nested-node_modules/.gitignore with
'node_modules/') so that fixture dependency directories are properly ignored
rather than being unignored.
In `@src/lib.rs`:
- Around line 332-336: The current else branch returns cached_path.to_path_buf()
which skips self.load_realpath and therefore misses Windows separator
normalization; change the logic so that even when self.options.symlinks is false
you still pass cached_path through self.load_realpath (e.g., call
self.load_realpath(&cached_path)? for the final path used to populate
Resolution.path) to preserve cross-platform path separator normalization while
keeping the symlink behavior consistent.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 36c4780e-0fc7-4175-98fb-3fee59ebef6e
⛔ Files ignored due to path filters (3)
fixtures/symlink-with-nested-node_modules/bar/node_modules/foois excluded by!**/node_modules/**fixtures/symlink-with-nested-node_modules/foo/node_modules/dep/index.jsis excluded by!**/node_modules/**fixtures/symlink-with-nested-node_modules/foo/node_modules/foo/index.jsis excluded by!**/node_modules/**
📒 Files selected for processing (5)
fixtures/pnp/index.test.mjsfixtures/symlink-with-nested-node_modules/.gitignoresrc/lib.rssrc/tests/resolve.rssrc/tests/symlink.rs
💤 Files with no reviewable changes (1)
- fixtures/pnp/index.test.mjs
There was a problem hiding this comment.
Pull request overview
Reverts the earlier performance change that avoided canonicalizing the entry path, restoring realpath/canonicalization behavior for symlink resolution and adjusting/adding tests and fixtures to cover nested node_modules behavior under symlinks.
Changes:
- Restore entry-path canonicalization when
ResolveOptions::symlinksis enabled, and adjust returned resolution path behavior accordingly. - Update Windows-specific symlink test expectations around unsupported DOS device paths.
- Add an integration test + fixture for resolving dependencies from a symlinked package with nested
node_modules; remove stray logging from the PnP fixture test.
Reviewed changes
Copilot reviewed 4 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/lib.rs | Reintroduces canonicalization/realpath handling for the entry directory and resolved path. |
| src/tests/symlink.rs | Updates Windows unsupported-path test to match the reverted canonicalization behavior. |
| src/tests/resolve.rs | Adds coverage for symlinked package resolution with nested node_modules. |
| fixtures/symlink-with-nested-node_modules/.gitignore | Ensures the fixture’s node_modules contents are not ignored. |
| fixtures/symlink-with-nested-node_modules/foo/node_modules/foo/index.js | Fixture content for nested node_modules symlink scenario. |
| fixtures/symlink-with-nested-node_modules/foo/node_modules/dep/index.js | Fixture content for nested node_modules symlink scenario. |
| fixtures/pnp/index.test.mjs | Removes debug console.log from fixture test. |
Files not reviewed (1)
- fixtures/symlink-with-nested-node_modules/.gitignore: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merging this PR will not alter performance
Comparing Footnotes
|
dd1a926 to
4a0224a
Compare
|



This reverts commit ea425f6.
Summary by CodeRabbit
Bug Fixes
Tests
Chores