Skip to content

fix: resolve symlink with nested node_modules - #125

Merged
JounQin merged 3 commits into
mainfrom
fix/symlink-with-nested-node_modules
May 29, 2025
Merged

JounQin merged 3 commits into
mainfrom
fix/symlink-with-nested-node_modules

Conversation

@JounQin

@JounQin JounQin commented May 29, 2025 •

Copy link
Copy Markdown
Member

Important

Improves module resolution to handle symlinks conditionally and adds a test for nested node_modules with symlinks.

  • Behavior:
    • Improved module resolution in src/lib.rs to handle symlinks conditionally based on ResolveOptions.
    • Added test symlink_with_nested_node_modules in src/tests/resolve.rs to verify resolution behavior with symlinks and nested node_modules.
  • Chores:
    • Updated formatting in examples/resolver.rs and src/tests/alias.rs by removing trailing commas.
    • Added .gitignore in fixtures/symlink-with-nested-node_modules to ensure node_modules is not ignored in test fixtures.

This description was created by Ellipsis for 5d96179. You can customize this summary. It will automatically update as commits are pushed.


Summary by CodeRabbit

  • New Features

    • Added a new test to verify module resolution behavior with symlinks and nested node_modules directories.
  • Chores

    • Updated formatting in test assertions by removing trailing commas.
    • Added a .gitignore file to ensure the node_modules directory is not ignored in test fixtures.
    • Improved module resolution to conditionally handle symlinks based on configuration.
    • Adjusted test setup to disable symlink resolution in specific cases.
    • Simplified error expectations in Windows path resolution tests for better accuracy.

@JounQin
JounQin requested a review from Copilot May 29, 2025 06:32
@JounQin JounQin self-assigned this May 29, 2025
@JounQin JounQin added the bug Something isn't working label May 29, 2025
@coderabbitai

coderabbitai Bot commented May 29, 2025 •

Copy link
Copy Markdown

Walkthrough

The changes include removal of trailing commas in assertion macros for formatting consistency, addition of a .gitignore file to exclude ignoring node_modules in a fixture, enhancement of the resolver to conditionally handle symlink resolution, and addition of a test verifying module resolution behavior with symlinks enabled and disabled. A Windows-specific test was updated to simplify expected error paths for DOS device paths.

Changes

File(s) Change Summary
examples/resolver.rs, src/tests/alias.rs, src/tests/resolve.rs Removed trailing commas from assertion macro calls for formatting consistency.
fixtures/symlink-with-nested-node_modules/.gitignore Added .gitignore with !node_modules to ensure node_modules is tracked in this fixture directory.
src/lib.rs Modified resolve_impl to conditionally resolve symlinks based on the symlinks option.
src/tests/resolve.rs Added test symlink_with_nested_node_modules to verify resolution behavior with symlinks enabled/disabled.
tests/resolve_test.rs Updated postcss test to disable symlink resolution by setting symlinks: false in ResolveOptions.
src/tests/symlink.rs Simplified Windows test test_unsupported_targets to expect error path as DOS device path directly.

Sequence Diagram(s)

sequenceDiagram
    participant Test as symlink_with_nested_node_modules()
    participant Resolver1 as Resolver (symlinks enabled)
    participant Resolver2 as Resolver (symlinks disabled)
    participant FileSystem

    Test->>Resolver1: resolve("dep", from "bar/node_modules/foo")
    Resolver1->>FileSystem: load real path (follow symlinks)
    FileSystem-->>Resolver1: real path resolved
    Resolver1->>FileSystem: require module at real path
    FileSystem-->>Resolver1: module resolved at foo/node_modules/dep/index.js
    Resolver1-->>Test: returns resolved path

    Test->>Resolver2: resolve("dep", from "bar/node_modules/foo")
    Resolver2->>FileSystem: do not load real path (no symlinks)
    Resolver2->>FileSystem: require module at cached path
    FileSystem-->>Resolver2: module not found
    Resolver2-->>Test: returns NotFound error
Loading

Possibly related PRs

  • test: add case for #65 #100: Adds Windows-specific tests and utilities for DOS device path symlinks and clarifies symlink option documentation, related to symlink resolution but focusing on platform-specific edge cases.

Poem

A comma here, a comma gone,
Test code tidied, moving on.
A symlink twist in nested land,
Resolvers check as planned.
Node modules kept in sight,
With .gitignore just right—
The rabbit hops with code delight! 🐇


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e69f9b9 and 5d96179.

📒 Files selected for processing (1)
  • src/tests/symlink.rs (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Benchmark
  • GitHub Check: Test (windows-latest)
🔇 Additional comments (1)
src/tests/symlink.rs (1)

199-199:

Details

✅ Verification successful

LGTM! Simplified error expectation aligns with updated resolver behavior.

The change simplifies the expected error to directly reference the DOS device path itself, which appears to align with the updated symlink resolution logic mentioned in the PR objectives.

To ensure this change is correct, let's verify that the actual resolver implementation produces this specific error:


🏁 Script executed:

#!/bin/bash
# Description: Verify the resolver implementation produces PathNotSupported error for DOS device paths
# Expected: Find ResolveError::PathNotSupported usage and DOS device path handling logic

# Search for PathNotSupported error variant definition and usage
ast-grep --pattern 'PathNotSupported($_)'

# Search for DOS device path handling logic
rg -A 5 -B 5 "dos_device|DOS.*device" --type rust

# Search for error handling in resolver when dealing with unsupported paths
rg -A 10 "PathNotSupported" src/lib.rs src/

Length of output: 15038


Approved: Test expectation correctly reflects DOS device path handling

The assertion

Err(ResolveError::PathNotSupported(dos_device_temp_path))

in src/tests/symlink.rs’s test_unsupported_targets matches the resolver’s implementation in windows.rs (which returns PathNotSupported(path) for unsupported DOS device paths) and aligns with the Error::PathNotSupported definition. No further changes needed.

✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes issues with resolving symlink paths in nested node_modules and cleans up several formatting issues in tests.

  • Adjusts assertion formatting in tests
  • Adds a new test case for handling symlink resolution with nested node_modules
  • Removes extraneous trailing commas in assertions

Reviewed Changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.

File Description
src/tests/resolve.rs Added new test for nested symlink resolution and updated assertions formatting
src/tests/alias.rs Removed extraneous comma in error case assertion
examples/resolver.rs Removed extraneous trailing comma from assert macro
Files not reviewed (1)
  • fixtures/symlink-with-nested-node_modules/.gitignore: Language not supported

Comment thread src/tests/resolve.rs Resolved

@ellipsis-dev ellipsis-dev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Looks good to me! 👍

Reviewed everything up to f7b01b5 in 1 minute and 29 seconds. Click for details.
  • Reviewed 94 lines of code in 8 files
  • Skipped 0 files when reviewing.
  • Skipped posting 7 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. examples/resolver.rs:11
  • Draft comment:
    Removed extraneous trailing comma in assert! call. Formatting change only.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
2. fixtures/symlink-with-nested-node_modules/.gitignore:1
  • Draft comment:
    New .gitignore file added to ensure node_modules is not ignored. This looks fine.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
3. fixtures/symlink-with-nested-node_modules/bar/node_modules/foo:1
  • Draft comment:
    Symlink file with target '../../foo' looks correct for testing nested node_modules.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
4. src/tests/alias.rs:257
  • Draft comment:
    Removed trailing comma in the expected error value for MatchedAliasNotFound. Pure formatting fix.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
5. src/tests/resolve.rs:158
  • Draft comment:
    New test 'symlink_with_nested_node_modules' added to verify symlink resolution. Consider confirming that the extension string '.js:' (used on lines 159 and 168) is intentional and not a typo ('.js' may be expected). Also, remove debugging print statements if not needed.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% The comment is asking for confirmation about intentions rather than pointing out clear issues. The ".js:" extension appears in multiple tests and is likely intentional given the test passes. Debug prints could be removed but this is a test file where prints can be useful for debugging failures. None of these points identify clear problems that need fixing. I could be wrong about the ".js:" extension - it does look unusual and could be a legitimate typo. The debug prints do add noise to test output. Even if ".js:" is unusual, asking for confirmation violates our rules. If it was wrong, the test would fail. Debug prints in tests are acceptable. The comment should be deleted as it primarily asks for confirmation rather than identifying clear issues, and makes suggestions about debug prints which are acceptable in test code.
6. src/tests/resolve.rs:159
  • Draft comment:
    Typo: The extension string ".js:" in the options might contain an unintended colon. Did you mean ".js"?
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% The test is specifically about symlink behavior and passes with .js:. The fact that it's used consistently in both resolver configurations within the same test and the test passes suggests this is intentional. Without access to the actual resolver implementation or documentation, I can't be certain if the colon serves a special purpose, but the evidence suggests it's not a typo. I could be wrong if this is actually a bug that happens to work. The test passing doesn't necessarily mean the colon is correct. While true, we should assume the author knows what they're doing unless we have strong evidence otherwise. The consistent usage and passing tests suggest this is intentional. The comment should be removed as we don't have strong evidence that .js: is a typo, and the test passes with this configuration.
7. src/tests/resolve.rs:168
  • Draft comment:
    Typo: The extension string ".js:" here might contain an extra colon. Please verify if this is intended or should be ".js".
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% The extension string appears in a test file and is used consistently in both test cases. The test is passing with this extension string. Since this is test code and the tests pass, the extension string is likely intentional. Even if it was a typo, it's not causing any issues. The comment is asking for verification rather than pointing out a clear problem. I could be wrong about the extension string being intentional - maybe it really is a typo that happens to work. The test passing doesn't necessarily mean the code is correct. Even if it is a typo, the comment violates our rules by asking for verification ("Please verify if...") rather than making a clear assertion. We should not keep comments that ask the author to check things. Delete the comment because it asks for verification rather than pointing out a clear issue, and the extension string appears to be working as intended in the tests.

Workflow ID: wflow_R06gcbOX3tmLzw0i

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 68b35f5 and f7b01b5.

⛔ Files ignored due to path filters (2)
  • fixtures/symlink-with-nested-node_modules/bar/node_modules/foo is excluded by !**/node_modules/**
  • fixtures/symlink-with-nested-node_modules/foo/node_modules/dep/index.js is excluded by !**/node_modules/**
📒 Files selected for processing (4)
  • examples/resolver.rs (1 hunks)
  • fixtures/symlink-with-nested-node_modules/.gitignore (1 hunks)
  • src/tests/alias.rs (1 hunks)
  • src/tests/resolve.rs (2 hunks)
🧰 Additional context used
🪛 GitHub Actions: Code Coverage
src/tests/resolve.rs

[error] 165-165: Test failure in 'tests::resolve::symlink_with_nested_node_modules': assertion left == right failed. Expected Ok path but got Err(NotFound("dep")).

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Test (windows-latest)
🔇 Additional comments (4)
examples/resolver.rs (1)

11-11: LGTM! Clean formatting improvement.

The trailing comma removal improves consistency with similar assertion statements across the codebase.

fixtures/symlink-with-nested-node_modules/.gitignore (1)

1-1: Good addition for test fixture integrity.

The negation pattern !node_modules ensures that the node_modules directory structure is preserved in the repository for testing symlink resolution behavior, which is essential for the new test case.

src/tests/alias.rs (1)

257-257: LGTM! Consistent formatting improvement.

The trailing comma removal aligns with the formatting cleanup being applied across the test files.

src/tests/resolve.rs (1)

71-71: LGTM! Consistent formatting improvement.

The trailing comma removal aligns with the formatting cleanup applied across other test files.

Comment thread src/tests/resolve.rs Resolved
Comment thread src/tests/resolve.rs Resolved
Comment thread src/tests/resolve.rs Resolved
@JounQin
JounQin force-pushed the fix/symlink-with-nested-node_modules branch 2 times, most recently from 1fe0ae5 to 0273940 Compare May 29, 2025 06:55

@ellipsis-dev ellipsis-dev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Looks good to me! 👍

Reviewed 1fe0ae5 in 53 seconds. Click for details.
  • Reviewed 85 lines of code in 5 files
  • Skipped 0 files when reviewing.
  • Skipped posting 6 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. examples/resolver.rs:11
  • Draft comment:
    Removed trailing comma from assert! call for consistent formatting.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
2. fixtures/symlink-with-nested-node_modules/.gitignore:1
  • Draft comment:
    Added .gitignore entry to ensure the node_modules directory in test fixtures is not ignored.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
3. fixtures/symlink-with-nested-node_modules/bar/node_modules/foo:1
  • Draft comment:
    Consider adding a trailing newline at the end of the file for POSIX compliance.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
4. src/tests/alias.rs:257
  • Draft comment:
    Removed extraneous trailing comma in the Err variant assert_eq! for consistency.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
5. src/tests/resolve.rs:70
  • Draft comment:
    Removed unnecessary trailing comma in assert_eq! call in issue238_resolve test.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
6. src/tests/resolve.rs:155
  • Draft comment:
    Added new test 'symlink_with_nested_node_modules' to verify resolution behavior with symlinked directories containing nested node_modules.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None

Workflow ID: wflow_ZBEc4xx8YaIr6UMP

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@ellipsis-dev ellipsis-dev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Looks good to me! 👍

Reviewed 0273940 in 56 seconds. Click for details.
  • Reviewed 81 lines of code in 5 files
  • Skipped 0 files when reviewing.
  • Skipped posting 5 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. examples/resolver.rs:11
  • Draft comment:
    Removed trailing comma in the assert! macro for cleaner syntax.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
2. fixtures/symlink-with-nested-node_modules/bar/node_modules/foo:1
  • Draft comment:
    File is missing a trailing newline; consider adding one for POSIX compliance.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
3. src/tests/alias.rs:256
  • Draft comment:
    Removed an extraneous trailing comma from the expected error in assert_eq! for consistency.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
4. src/tests/resolve.rs:70
  • Draft comment:
    Removed an unnecessary trailing comma from the assert_eq! call for resolving config file.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
5. src/tests/resolve.rs:155
  • Draft comment:
    Added a new test to verify symlink resolution with nested node_modules. Consider removing debug print statements if they are no longer needed.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None

Workflow ID: wflow_OfDeWjNs8juPH3Or

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@JounQin
JounQin force-pushed the fix/symlink-with-nested-node_modules branch from 39a7bcf to 3be0788 Compare May 29, 2025 06:57

@ellipsis-dev ellipsis-dev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Looks good to me! 👍

Reviewed 3be0788 in 42 seconds. Click for details.
  • Reviewed 79 lines of code in 5 files
  • Skipped 0 files when reviewing.
  • Skipped posting 6 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. examples/resolver.rs:11
  • Draft comment:
    Removed an unnecessary trailing comma in the assert! call. This improves code formatting.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
2. fixtures/symlink-with-nested-node_modules/.gitignore:1
  • Draft comment:
    The .gitignore file now explicitly includes node_modules. This ensures the fixture’s node_modules directory is tracked.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
3. fixtures/symlink-with-nested-node_modules/bar/node_modules/foo:1
  • Draft comment:
    File added without a trailing newline. Consider adding a newline at the end for POSIX compliance.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
4. src/tests/alias.rs:257
  • Draft comment:
    Removed the extra trailing comma in the assert_eq! macro. This cleanup is in line with Rust’s formatting best practices.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
5. src/tests/resolve.rs:68
  • Draft comment:
    Removed an extra trailing comma in the assert_eq! call. This minor formatting update ensures consistency.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
6. src/tests/resolve.rs:151
  • Draft comment:
    Added a new test 'symlink_with_nested_node_modules' to verify module resolution behavior when dealing with symlinked nested node_modules. The test correctly distinguishes behavior when symlink resolution is enabled versus disabled.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None

Workflow ID: wflow_U42H5efQt6Fmx7wb

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Comment thread src/tests/resolve.rs Resolved
@JounQin
JounQin force-pushed the fix/symlink-with-nested-node_modules branch from f507b01 to 86d2aff Compare May 29, 2025 07:47
@codecov

codecov Bot commented May 29, 2025 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.40%. Comparing base (68b35f5) to head (5d96179).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #125      +/-   ##
==========================================
- Coverage   93.43%   93.40%   -0.03%     
==========================================
  Files          13       13              
  Lines        2892     2897       +5     
==========================================
+ Hits         2702     2706       +4     
- Misses        190      191       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ellipsis-dev ellipsis-dev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Looks good to me! 👍

Reviewed 86d2aff in 1 minute and 16 seconds. Click for details.
  • Reviewed 59 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 6 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. src/tests/resolve.rs:155
  • Draft comment:
    Great test covering symlink resolution in nested node_modules. Consider adding an inline comment describing why the expected resolution here is to 'foo/node_modules/dep/index.js' when symlinks are enabled.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
2. src/tests/resolve.rs:163
  • Draft comment:
    When testing error cases (e.g. symlinks disabled), consider matching on the error variant rather than asserting full equality to avoid brittleness if error messages change.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.
3. tests/resolve_test.rs:10
  • Draft comment:
    Good coverage for handling Unicode paths. The 'chinese' test ensures non-ASCII file names are resolved correctly.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
4. tests/resolve_test.rs:195
  • Draft comment:
    The 'nested_symlinks' test effectively verifies the fix for symlink resolution in nested structures. This is crucial for the PR and appears well‐structured.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
5. tests/resolve_test.rs:220
  • Draft comment:
    The 'windows_symlinked_longfilename' test is a nice addition ensuring that very long Windows paths are handled properly. Documentation in the comments is helpful.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
6. tests/resolve_test.rs:252
  • Draft comment:
    The 'dual_condition_names' test shows coverage for multiple condition names. This is useful for ensuring compatibility with both ESM and CJS environments.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.

Workflow ID: wflow_pcBi4jvnnVMJR4M6

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@codspeed

codspeed Bot commented May 29, 2025 •

Copy link
Copy Markdown

CodSpeed Performance Report

Merging #125 will not alter performance

Comparing fix/symlink-with-nested-node_modules (5d96179) with main (68b35f5)

Summary

✅ 3 untouched benchmarks

@JounQin
JounQin force-pushed the fix/symlink-with-nested-node_modules branch from 86d2aff to e69f9b9 Compare May 29, 2025 07:55

@ellipsis-dev ellipsis-dev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Looks good to me! 👍

Reviewed e69f9b9 in 51 seconds. Click for details.
  • Reviewed 59 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 9 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. src/tests/resolve.rs:155
  • Draft comment:
    Good test for symlink resolution: it clearly distinguishes behavior when symlinks are enabled vs disabled. Consider adding a brief inline comment explaining why the disabled case should return NotFound.
  • Reason this comment was not posted:
    Confidence changes required: 30% <= threshold 50% None
2. src/tests/resolve.rs:172
  • Draft comment:
    The Windows normalization test is well written; it would be helpful to note that the expected path separator normalization is platform‐specific.
  • Reason this comment was not posted:
    Confidence changes required: 20% <= threshold 50% None
3. tests/resolve_test.rs:10
  • Draft comment:
    The 'chinese' test effectively validates Unicode file paths. No changes needed.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
4. tests/resolve_test.rs:20
  • Draft comment:
    The 'styled_components' test covers both CJS and ESM resolution paths; the use of alias_fields and main_fields is clear.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
5. tests/resolve_test.rs:119
  • Draft comment:
    Tests for 'ipaddr_js', 'decimal_js' and related modules nicely cover extension alias and condition scenarios. Inline comments might clarify the rationale for different resolver configurations.
  • Reason this comment was not posted:
    Confidence changes required: 20% <= threshold 50% None
6. tests/resolve_test.rs:194
  • Draft comment:
    The 'nested_symlinks' test effectively validates nested node_modules resolution via symlinks. A brief inline note on the mapping (e.g. from 'apps/web/nm/@repo/typescript-config' to 'nm/index.js') would aid clarity.
  • Reason this comment was not posted:
    Confidence changes required: 30% <= threshold 50% None
7. tests/resolve_test.rs:218
  • Draft comment:
    The Windows long filename symlink test is comprehensive. Consider a comment noting that the test ensures mitigation of OS path length quirks.
  • Reason this comment was not posted:
    Confidence changes required: 20% <= threshold 50% None
8. tests/resolve_test.rs:241
  • Draft comment:
    The 'package_json_with_bom' test covers an important edge case. The test is clear and concise.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
9. tests/resolve_test.rs:252
  • Draft comment:
    The 'dual_condition_names' test is a well-structured verification of multiple condition names. No changes required.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None

Workflow ID: wflow_lZ0u1rXNvSTUnsl7

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@sonarqubecloud

Copy link
Copy Markdown

@ellipsis-dev ellipsis-dev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Looks good to me! 👍

Reviewed 5d96179 in 40 seconds. Click for details.
  • Reviewed 15 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. src/tests/symlink.rs:196
  • Draft comment:
    Updated expected error value: using dos_device_temp_path directly now, instead of its parent's parent's path. Ensure this change aligns with the intended error reporting behavior.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 30% <= threshold 50% The comment is asking the PR author to ensure that the change aligns with the intended behavior, which violates the rule against asking the author to confirm their intention or ensure behavior. However, it does point out a specific change in the code, which could be useful if rephrased to focus on the change itself rather than asking for confirmation.

Workflow ID: wflow_WWUDJ6ayVha33EJe

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Comment thread src/tests/symlink.rs
Err(ResolveError::PathNotSupported(
dos_device_temp_path.parent().unwrap().parent().unwrap().to_path_buf()
))
Err(ResolveError::PathNotSupported(dos_device_temp_path))

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JounQin
JounQin merged commit d3f52a2 into main May 29, 2025
@JounQin
JounQin deleted the fix/symlink-with-nested-node_modules branch May 29, 2025 08:16
@JounQin JounQin mentioned this pull request May 29, 2025
hanzo-dev pushed a commit to hanzoai/unrs-resolver that referenced this pull request Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants