Skip to content

fix: suppress auth warning when PNPM_CONFIG_NPMRC_AUTH_FILE points at project .npmrc - #12679

Merged
zkochan merged 6 commits into
pnpm:mainfrom
bro-ankit:fix/npmrc-auth-file-warning-12480
Jul 4, 2026
Merged

zkochan merged 6 commits into
pnpm:mainfrom
bro-ankit:fix/npmrc-auth-file-warning-12480

Conversation

@bro-ankit

@bro-ankit bro-ankit commented Jun 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

When PNPM_CONFIG_NPMRC_AUTH_FILE is set to the project .npmrc, pnpm still fires the "Ignored project-level auth setting" warning even though the user explicitly opted in to trusting that file. The point of PNPM_CONFIG_NPMRC_AUTH_FILE is to declare trust — the warning is wrong in this case.

Closes #12480

Squash Commit Body

When npmrcAuthFile resolves to the same path as the project .npmrc, the user
has explicitly opted in to trusting that file for auth. Before this fix, the
warning was unconditionally fired for any auth env var in the project .npmrc,
even when PNPM_CONFIG_NPMRC_AUTH_FILE pointed at it.

Fix: compare the resolved npmrcAuthFile path against the workspace .npmrc path.
If they match, allow env var expansion and skip the warning.

Closes #12480

Checklist

  • The change is implemented in both the TypeScript CLI and the Rust
    pacquet/ port, or the description notes what still needs porting.
  • Added a changeset (pnpm changeset) if this PR changes any published
    package. Keep it short and written for pnpm users — it becomes a release note.
  • Added or updated tests.
  • Updated the documentation if needed.

Summary by CodeRabbit

  • Bug Fixes
    • Suppressed the “ignored project-level auth setting” warning when the project’s .npmrc is explicitly used as the auth source (via PNPM_CONFIG_NPMRC_AUTH_FILE), including relative-path scenarios.
    • Improved .npmrc env placeholder handling for _authToken, expanding values only for trusted auth sources and avoiding incorrect “project-level” treatment.
    • Updated workspace .npmrc processing so env placeholder expansion behavior matches whether the project .npmrc was explicitly selected.
  • Tests
    • Added regression tests covering warning suppression and _authToken placeholder expansion.
  • Documentation
    • Refined configuration comments around cwd-based resolution.

@bro-ankit
bro-ankit requested a review from zkochan as a code owner June 26, 2026 07:37
@coderabbitai

coderabbitai Bot commented Jun 26, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Project .npmrc auth handling now depends on whether the configured auth file matches the project file. The change updates env expansion and warning behavior, adds regression tests, and records the patch release entry.

Changes

Trusted project .npmrc auth handling

Layer / File(s) Summary
Trusted project .npmrc parsing
pacquet/crates/config/src/api.rs, pacquet/crates/config/src/lib.rs, pnpm11/config/reader/src/loadNpmrcFiles.ts, .changeset/rare-mice-peel.md
Config::current and loadNpmrcConfig compare the configured auth file with the project .npmrc and switch to trusted parsing and env expansion when they match. The changeset records the patch release note.
Auth parsing regression tests
pacquet/crates/config/src/tests.rs, pacquet/crates/config/src/npmrc_auth/tests.rs, pnpm11/config/reader/test/index.ts
capture_warnings, cwd test fakes, and regression tests cover warning emission and auth placeholder expansion for trusted and untrusted project .npmrc paths.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Assessment against linked issues

Objective Addressed Explanation
[#12480] Suppress the ignored-auth warning when the project .npmrc is trusted ✅

Possibly related PRs

  • pnpm/pnpm#11526: Both PRs adjust how pnpm handles ${VAR} placeholders inside .npmrc auth values.
  • pnpm/pnpm#12333: Both PRs modify .npmrc loading and warning behavior around env placeholders for project-level auth values.

Suggested labels: product: pacquet

Suggested reviewers: zkochan

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands.

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Suppress auth warning when npmrcAuthFile targets the project .npmrc
🐞 Bug fix 🧪 Tests 🕐 20-40 Minutes

Grey Divider

Description

• Treat the workspace .npmrc as trusted when PNPM_CONFIG_NPMRC_AUTH_FILE points to it.
• Allow auth env var expansion in that trusted case and suppress the misleading warning.
• Add TS and Rust regression tests covering warning behavior and env expansion.
Diagram

graph TD
  E{{"PNPM_CONFIG_NPMRC_AUTH_FILE"}} --> R["Resolve & compare paths"] --> D{"Same as project .npmrc?"}
  F["Project .npmrc"] --> R
  D -->|"yes"| T["Trusted parse (from_ini)"] --> O1["Expand env; no warning"]
  D -->|"no"| U["Untrusted parse (from_project_ini)"] --> O2["Warn; ignore env auth"]

  subgraph Legend
    direction LR
    _env{{"Env var"}} ~~~ _proc["Process"] ~~~ _file["File"] ~~~ _dec{"Decision"}
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Canonicalize/realpath in TS comparison
  • ➕ Handles symlinks and path normalization consistently with Rust canonicalize()
  • ➕ Avoids false negatives when PNPM_CONFIG_NPMRC_AUTH_FILE uses an equivalent but different-looking path
  • ➖ Adds fs.realpath/IO and error handling to TS config load path
  • ➖ Potential behavior changes on platforms with case-insensitive filesystems if not carefully handled
2. Introduce an explicit 'trust workspace npmrc auth' flag
  • ➕ Avoids relying on path equality as the trust signal
  • ➕ More explicit user intent; easier to document
  • ➖ Expands configuration surface area
  • ➖ Requires additional precedence rules and migration considerations

Recommendation: The current approach (treat workspace .npmrc as trusted only when npmrcAuthFile resolves to that same file) is a good minimal change aligned with the env var’s intent. Consider a follow-up to use realpath/canonicalization on the TypeScript side as well to match the Rust behavior in symlinked/worktree setups; otherwise the fix may be path-string-sensitive in TS.

Files changed (6) +160 / -3

Bug fix (2) +22 / -3
lib.rsTrust project .npmrc when selected as npmrcAuthFile (Rust) +13/-1

Trust project .npmrc when selected as npmrcAuthFile (Rust)

• Computes whether the user-selected npmrcAuthFile canonicalizes to the workspace .npmrc path. If so, parses the project .npmrc via from_ini (trusted) instead of from_project_ini to allow auth env expansion and suppress the warning.

pacquet/crates/config/src/lib.rs

loadNpmrcFiles.tsSkip auth warning and enable env expansion when auth file is workspace .npmrc +9/-2

Skip auth warning and enable env expansion when auth file is workspace .npmrc

• Resolves the workspace .npmrc path and compares it to the normalized npmrcAuthFile path. When they match, enables expandAuthValueEnv and expandRequestDestinationEnv for the workspace .npmrc read, preventing the misleading warning and allowing env placeholders to resolve.

pnpm11/config/reader/src/loadNpmrcFiles.ts

Tests (3) +133 / -0
tests.rsAdd unit coverage for trusted vs untrusted auth env placeholders +45/-0

Add unit coverage for trusted vs untrusted auth env placeholders

• Adds regression tests asserting from_project_ini warns and drops ${ENV} auth tokens, while from_ini expands the token without warning. Captures the intended semantic difference used by the new trust check.

pacquet/crates/config/src/npmrc_auth/tests.rs

tests.rsAdd integration-style test capturing WARN logs for auth warning suppression +59/-0

Add integration-style test capturing WARN logs for auth warning suppression

• Introduces a small tracing subscriber layer to capture WARN messages during config load. Adds a regression test ensuring no "Ignored project-level auth setting" warning is emitted when PNPM_CONFIG_NPMRC_AUTH_FILE points at the project .npmrc.

pacquet/crates/config/src/tests.rs

index.tsAdd TS regression test for PNPM_CONFIG_NPMRC_AUTH_FILE == project .npmrc +29/-0

Add TS regression test for PNPM_CONFIG_NPMRC_AUTH_FILE == project .npmrc

• Adds a test that writes an auth token with an env placeholder into the project .npmrc, sets PNPM_CONFIG_NPMRC_AUTH_FILE to that file’s absolute path, and asserts no "Ignored project-level auth setting" warning is returned.

pnpm11/config/reader/test/index.ts

Documentation (1) +5 / -0
rare-mice-peel.mdAdd patch changeset documenting warning suppression +5/-0

Add patch changeset documenting warning suppression

• Adds a patch changeset for @pnpm/config.reader describing that the auth warning is no longer emitted when PNPM_CONFIG_NPMRC_AUTH_FILE targets the project .npmrc.

.changeset/rare-mice-peel.md

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Jun 26, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Relative npmrcAuthFile not trusted ✓ Resolved 📎 Requirement gap ≡ Correctness
Description
In pacquet, project_is_trusted_auth_file compares the raw
PNPM_CONFIG_NPMRC_AUTH_FILE/--userconfig path (captured as user_npmrc_path without
normalization) against an absolute project_npmrc_path, so a relative value like .npmrc will not
match and the project .npmrc is still treated as untrusted (warning + no auth env expansion). This
breaks the requirement that explicitly trusting the project .npmrc via
PNPM_CONFIG_NPMRC_AUTH_FILE suppresses the ignored-auth warning and expands auth environment
placeholders.
Code

pacquet/crates/config/src/lib.rs[R1947-1951]

+        let project_npmrc_path = project_npmrc_dir.join(".npmrc");
+        // When npmrcAuthFile explicitly points at the project .npmrc, the user has
+        // opted in to trusting it — allow auth env expansion and suppress the warning.
+        let project_is_trusted_auth_file =
+            user_npmrc_path.as_deref().is_some_and(|user| user == project_npmrc_path);
Evidence
Compliance ID 1 requires that when PNPM_CONFIG_NPMRC_AUTH_FILE points at the project
.npmrc—including the common relative form PNPM_CONFIG_NPMRC_AUTH_FILE=.npmrc—pnpm must not emit
the "Ignored project-level auth setting" warning and must expand auth env vars. The cited code path
implements a trust check by directly comparing user_npmrc_path (an unresolved string-to-PathBuf
taken verbatim from env/config) to project_npmrc_dir.join(".npmrc") (effectively an absolute
project path), so relative inputs won’t be equal even if they refer to the same file at runtime.
When that comparison fails, pacquet proceeds with NpmrcAuth::from_project_ini (which disables env
expansion) rather than from_ini (which enables it), so the mismatch directly causes the
warning/env-expansion behavior divergence.

Do not warn about ignored project-level auth settings when project .npmrc is explicitly trusted via PNPM_CONFIG_NPMRC_AUTH_FILE
pacquet/crates/config/src/lib.rs[1947-1951]
pacquet/crates/config/src/lib.rs[1917-1935]
pacquet/crates/config/src/lib.rs[1945-1957]
pacquet/crates/config/src/npmrc_auth.rs[174-181]
pacquet/crates/config/src/npmrc_auth.rs[304-310]
pnpm11/config/reader/src/loadNpmrcFiles.ts[88-96]
pnpm11/config/reader/src/loadNpmrcFiles.ts[595-601]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
pacquet currently treats the project `.npmrc` as trusted only when `user_npmrc_path == project_npmrc_path`, but `user_npmrc_path` is taken directly from `PNPM_CONFIG_NPMRC_AUTH_FILE` / `--userconfig` / etc. without resolving or normalizing the path. As a result, `PNPM_CONFIG_NPMRC_AUTH_FILE=.npmrc` (a documented/common usage) does not match the absolute project `.npmrc` path, so the project file remains treated as untrusted, leading to the "Ignored project-level auth setting" warning and preventing auth env placeholders from expanding.
## Issue Context
In the TypeScript pnpm implementation, `npmrcAuthFile` is normalized with `path.resolve(...)` before comparison, so `.npmrc` becomes an absolute path and correctly trusts the project `.npmrc`. pacquet should apply equivalent normalization (at least resolve relative user-supplied auth-file paths against the working/start directory used for config loading) for the trust comparison, and consider using the same resolved path consistently for reading the user npmrc to avoid behavior divergence.
## Fix Focus Areas
- pacquet/crates/config/src/lib.rs[1917-1957]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Fake cwd leaks across tests 🐞 Bug ☼ Reliability
Description
The new FAKE_CWD thread-local in pacquet tests is never reset to None, so any test that calls
set_fake_cwd() can affect later tests that run on the same reused worker thread. This can cause
flaky behavior in tests that use FakeEnv::current_dir() without explicitly setting/clearing the
fake cwd.
Code

pacquet/crates/config/src/tests.rs[R239-248]

+thread_local! {
+    /// Per-thread fake cwd for [`FakeEnv`], set via [`set_fake_cwd`].
+    /// `None` (the default) falls through to the real process cwd.
+    static FAKE_CWD: std::cell::RefCell<Option<PathBuf>> =
+        const { std::cell::RefCell::new(None) };
+}
+
+fn set_fake_cwd(dir: &Path) {
+    FAKE_CWD.with(|cwd| *cwd.borrow_mut() = Some(dir.to_path_buf()));
+}
Evidence
FAKE_CWD is introduced as a persistent thread-local and set_fake_cwd() only sets it, while
FakeEnv::current_dir() preferentially uses it, so the override persists for the lifetime of the
test thread unless explicitly cleared.

pacquet/crates/config/src/tests.rs[229-248]
pacquet/crates/config/src/tests.rs[272-275]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`FAKE_CWD` is a thread-local override used by `FakeEnv::current_dir()`, but it is only ever set to `Some(...)` and never cleared. Since Rust’s test harness reuses worker threads, state can leak between tests executed on the same thread.
### Issue Context
`set_fake_env()` clears the fake env map every time, but there is no equivalent reset for fake cwd. Any later test using `FakeEnv` may unexpectedly run with a stale fake cwd.
### Fix Focus Areas
- pacquet/crates/config/src/tests.rs[229-248]
- pacquet/crates/config/src/tests.rs[272-275]
### Suggested fix
- Add a `clear_fake_cwd()` helper that sets `FAKE_CWD` back to `None`, and call it from `set_fake_env()` (so every test that sets env also clears cwd).
- Alternatively, make `set_fake_cwd` accept `Option<&Path>` and pass `None` for reset.
- Or use an RAII guard that resets `FAKE_CWD` in `Drop`.
- Update the new tests that set fake cwd to ensure they reset it after assertions if you don’t centralize the reset.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Unneeded canonicalize IO ✓ Resolved 🐞 Bug ➹ Performance
Description
In pacquet config loading, project_npmrc_path.canonicalize() is evaluated unconditionally as the
argument to Option::zip, adding an extra filesystem operation even when no npmrcAuthFile is
configured. This can regress startup/config-load performance on slow or networked filesystems and is
avoidable by only canonicalizing the project path after a user path is present/canonicalized.
Code

pacquet/crates/config/src/lib.rs[R1950-1954]

+        let project_is_trusted_auth_file = user_npmrc_path
+            .as_deref()
+            .and_then(|p| p.canonicalize().ok())
+            .zip(project_npmrc_path.canonicalize().ok())
+            .is_some_and(|(user, project)| user == project);
Evidence
The PR introduces a zip(project_npmrc_path.canonicalize().ok()) call; because Rust evaluates
method arguments eagerly, the project canonicalize runs regardless of whether the left Option is
None. The cited block shows this exact structure on the config-load path.

pacquet/crates/config/src/lib.rs[1917-1963]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`project_npmrc_path.canonicalize()` is executed even when `user_npmrc_path` is `None` because it is evaluated as a call argument to `zip(...)`. This introduces an unnecessary filesystem canonicalization on every config load.
### Issue Context
This code runs on the config-load path; even small extra filesystem calls can matter, especially on CI/network mounts.
### Fix Focus Areas
- pacquet/crates/config/src/lib.rs[1945-1960]
### Suggested fix
Restructure the comparison to only canonicalize the project `.npmrc` path when a user path exists and has already been canonicalized, e.g.:

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


4. Path equality misses symlinks 🐞 Bug ⚙ Maintainability
Description
The TypeScript CLI treats the workspace .npmrc as trusted only when `userConfigPath ===
workspaceNpmrcPath, but both values are just path.resolve(...)` strings, not canonicalized file
identities. If PNPM_CONFIG_NPMRC_AUTH_FILE points at the same .npmrc via a symlink or
casing/alias variation (common on Windows/macOS), pnpm will still warn and keep env expansion
disabled, diverging from pacquet’s canonicalize-based comparison.
Code

pnpm11/config/reader/src/loadNpmrcFiles.ts[R92-103]

+  const workspaceNpmrcPath = path.resolve(workspaceNpmrcDir, '.npmrc')
+  // When npmrcAuthFile explicitly points at the project .npmrc, the user has
+  // opted in to trusting it — allow auth env expansion and suppress the warning.
+  const workspaceIsTrustedAuthFile = userConfigPath === workspaceNpmrcPath
const workspaceNpmrc = readAndFilterNpmrc(
-    path.resolve(workspaceNpmrcDir, '.npmrc'),
+    workspaceNpmrcPath,
warnings,
env,
-    { expandAuthValueEnv: false, expandRequestDestinationEnv: false }
+    {
+      expandAuthValueEnv: workspaceIsTrustedAuthFile,
+      expandRequestDestinationEnv: workspaceIsTrustedAuthFile,
+    }
Evidence
The TS side resolves both paths and compares them directly, and normalizePath only does
path.resolve (no realpath). The Rust side compares canonicalized paths, so the two implementations
will disagree in symlink/alias scenarios.

pnpm11/config/reader/src/loadNpmrcFiles.ts[80-108]
pnpm11/config/reader/src/loadNpmrcFiles.ts[595-601]
pacquet/crates/config/src/lib.rs[1945-1959]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`workspaceIsTrustedAuthFile` is computed via strict string equality on `path.resolve(...)` results. This fails to detect that two different path spellings (symlink path vs real path; drive-letter casing differences; etc.) refer to the same file.
### Issue Context
The Rust port (`pacquet`) uses `canonicalize()` for this comparison, so the TS and Rust implementations can behave differently for the same user configuration.
### Fix Focus Areas
- pnpm11/config/reader/src/loadNpmrcFiles.ts[84-105]
- pnpm11/config/reader/src/loadNpmrcFiles.ts[595-601]
### Suggested fix
Use a best-effort realpath comparison (with an ENOENT-safe fallback to the resolved path) so symlink/case aliases still match:

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
pnpm11/config/reader/test/index.ts (1)

4001-4027: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Cover the literal .npmrc variant from the issue too.

This test only exercises PNPM_CONFIG_NPMRC_AUTH_FILE with path.resolve('.npmrc'). The reported regression was the literal .npmrc value, so adding that case would protect the exact input shape this fix is meant to preserve. As per path instructions, "Test expectations: include a regression test that fails without the fix and asserts the observable effect," and the PR objective calls out PNPM_CONFIG_NPMRC_AUTH_FILE=.npmrc.

🤖 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 `@pnpm11/config/reader/test/index.ts` around lines 4001 - 4027, The current
regression test only covers PNPM_CONFIG_NPMRC_AUTH_FILE using the resolved
absolute path, but it should also cover the literal .npmrc value mentioned in
the issue. Update the test in the getConfig-based auth warning coverage to add a
case for env.PNPM_CONFIG_NPMRC_AUTH_FILE set to ".npmrc" alongside the existing
path.resolve('.npmrc') scenario, and assert that warnings from the auth warning
filter still do not include "Ignored project-level auth setting" for that exact
input shape.

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.

Inline comments:
In @.changeset/rare-mice-peel.md:
- Around line 1-5: The changeset only declares a patch for `@pnpm/config.reader`,
but this PR also changes pnpm CLI warning behavior, so add a pnpm release note
entry to the same changeset. Update the changeset content alongside the existing
package entry so the pnpm-facing output change is captured with the correct bump
type, using the changeset file and its current package list as the place to make
the edit.

---

Nitpick comments:
In `@pnpm11/config/reader/test/index.ts`:
- Around line 4001-4027: The current regression test only covers
PNPM_CONFIG_NPMRC_AUTH_FILE using the resolved absolute path, but it should also
cover the literal .npmrc value mentioned in the issue. Update the test in the
getConfig-based auth warning coverage to add a case for
env.PNPM_CONFIG_NPMRC_AUTH_FILE set to ".npmrc" alongside the existing
path.resolve('.npmrc') scenario, and assert that warnings from the auth warning
filter still do not include "Ignored project-level auth setting" for that exact
input shape.
🪄 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: e3bbdb42-33a1-42f1-bf96-c590bcc5d419

📥 Commits

Reviewing files that changed from the base of the PR and between aea6ace and 1104071.

📒 Files selected for processing (6)
  • .changeset/rare-mice-peel.md
  • pacquet/crates/config/src/lib.rs
  • pacquet/crates/config/src/npmrc_auth/tests.rs
  • pacquet/crates/config/src/tests.rs
  • pnpm11/config/reader/src/loadNpmrcFiles.ts
  • pnpm11/config/reader/test/index.ts

Comment thread .changeset/rare-mice-peel.md Resolved
@codecov-commenter

codecov-commenter commented Jun 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.62%. Comparing base (25c7388) to head (7a3b883).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12679      +/-   ##
==========================================
- Coverage   85.62%   85.62%   -0.01%     
==========================================
  Files         413      413              
  Lines       64335    64343       +8     
==========================================
+ Hits        55089    55093       +4     
- Misses       9246     9250       +4     

☔ View full report in Codecov by Harness.
📢 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.

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 1104071

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 `@pacquet/crates/config/src/lib.rs`:
- Around line 1950-1951: The trust check in config parsing is comparing raw
PathBufs, so relative PNPM_CONFIG_NPMRC_AUTH_FILE values like .npmrc or ./.npmrc
won’t match the workspace .npmrc and the ignored-auth warning still fires.
Update the project_is_trusted_auth_file logic in the config code to compare
resolved/normalized paths using pnpm-equivalent semantics before deciding trust,
and add a regression test covering a relative npmrcAuthFile value that should
suppress the warning only when it resolves exactly to the workspace .npmrc.
🪄 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: 39087097-f6bd-40a4-ac66-3664a981537b

📥 Commits

Reviewing files that changed from the base of the PR and between 1104071 and 908b6f3.

📒 Files selected for processing (4)
  • .changeset/rare-mice-peel.md
  • pacquet/crates/config/src/lib.rs
  • pacquet/crates/config/src/npmrc_auth/tests.rs
  • pacquet/crates/config/src/tests.rs
🚧 Files skipped from review as they are similar to previous changes (3)
  • .changeset/rare-mice-peel.md
  • pacquet/crates/config/src/npmrc_auth/tests.rs
  • pacquet/crates/config/src/tests.rs

Comment thread pacquet/crates/config/src/lib.rs Resolved
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 908b6f3

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Jun 26, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

Grey Divider

New Review Started

This review has been superseded by a new analysis

Grey Divider

Qodo Logo

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Jun 26, 2026
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 499a72a

1 similar comment
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 499a72a

@github-actions

github-actions Bot commented Jun 26, 2026 •

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: 1cee3fc95f08

Each scenario reports direct installs and pnpr installs. Bencher consumes pacquet@HEAD and pnpr@HEAD.

Scenario: Isolated linker: fresh restore, cold cache + cold store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.096 ± 0.174 3.922 4.423 1.93 ± 0.10
pacquet@main 4.049 ± 0.153 3.886 4.302 1.91 ± 0.09
pnpr@HEAD 2.118 ± 0.062 2.020 2.215 1.00
pnpr@main 2.123 ± 0.116 1.960 2.372 1.00 ± 0.06
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.0961688365799995,
      "stddev": 0.17379363782264998,
      "median": 4.05606480158,
      "user": 3.859672839999999,
      "system": 3.4992972399999993,
      "min": 3.92172373058,
      "max": 4.42274136458,
      "times": [
        4.36545379958,
        4.064802927580001,
        4.07269458858,
        3.92172373058,
        4.1712992485800005,
        3.9905420145800004,
        4.42274136458,
        4.04732667558,
        3.94094713558,
        3.96415688058
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.049352784080001,
      "stddev": 0.15313271305719675,
      "median": 3.9855688325800003,
      "user": 3.8779425399999994,
      "system": 3.49578594,
      "min": 3.88574812358,
      "max": 4.30175090258,
      "times": [
        4.24503620558,
        4.30175090258,
        3.9609670085800004,
        4.03220701458,
        3.93457328158,
        3.88574812358,
        3.9225203085800002,
        3.96838523158,
        4.23958733058,
        4.00275243358
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 2.11765304558,
      "stddev": 0.06219831447852616,
      "median": 2.11222312708,
      "user": 2.63370724,
      "system": 3.0213639399999996,
      "min": 2.01976031058,
      "max": 2.2145113055800003,
      "times": [
        2.1544528775800003,
        2.2145113055800003,
        2.1624327195800004,
        2.08777759558,
        2.1860735405800003,
        2.0923445435800003,
        2.05320272358,
        2.01976031058,
        2.13210171058,
        2.0738731285800003
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 2.1230986685800004,
      "stddev": 0.11625168752964363,
      "median": 2.0879028230800003,
      "user": 2.6393439400000003,
      "system": 3.0000195399999994,
      "min": 1.96015271758,
      "max": 2.37216717158,
      "times": [
        2.20376631258,
        2.37216717158,
        2.0759249845800003,
        2.0876493595800003,
        2.02232375258,
        2.0881562865800003,
        2.13318263658,
        1.96015271758,
        2.0706321665800003,
        2.21703129758
      ]
    }
  ]
}

Scenario: Isolated linker: fresh restore, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 643.1 ± 17.7 617.7 665.1 1.01 ± 0.04
pacquet@main 638.7 ± 15.0 607.5 657.5 1.00
pnpr@HEAD 685.1 ± 28.7 658.5 756.5 1.07 ± 0.05
pnpr@main 686.5 ± 26.2 658.9 739.5 1.07 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.6430657473800002,
      "stddev": 0.017698368854393798,
      "median": 0.6407508473800001,
      "user": 0.36858177999999997,
      "system": 1.3270916399999997,
      "min": 0.61772725238,
      "max": 0.6650813403800001,
      "times": [
        0.61772725238,
        0.65375185838,
        0.61835762938,
        0.6358168983800001,
        0.6382782333800001,
        0.6327750913800001,
        0.66449699338,
        0.6432234613800001,
        0.6650813403800001,
        0.6611487153800001
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.6386845763800001,
      "stddev": 0.014990560491128594,
      "median": 0.6420320793800001,
      "user": 0.38246347999999997,
      "system": 1.31735944,
      "min": 0.6075399653800001,
      "max": 0.6574733703800001,
      "times": [
        0.64503059238,
        0.6336019483800001,
        0.6315599873800001,
        0.6238176363800001,
        0.6501908243800001,
        0.6390335663800001,
        0.65066111238,
        0.6574733703800001,
        0.6075399653800001,
        0.64793676038
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.68507623168,
      "stddev": 0.028675412585696693,
      "median": 0.68108504938,
      "user": 0.38293458,
      "system": 1.3485056399999997,
      "min": 0.65851857538,
      "max": 0.7565096113800001,
      "times": [
        0.69018554338,
        0.65851857538,
        0.65940820838,
        0.6598433473800001,
        0.6767068393800001,
        0.68029593338,
        0.6906613513800001,
        0.69675874138,
        0.6818741653800001,
        0.7565096113800001
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.68651640318,
      "stddev": 0.026202199425236373,
      "median": 0.6848465703800001,
      "user": 0.38051508,
      "system": 1.35396514,
      "min": 0.65892380638,
      "max": 0.7395135903800001,
      "times": [
        0.65892380638,
        0.6887086933800001,
        0.6623611423800001,
        0.6809844473800001,
        0.66293938738,
        0.6626027443800001,
        0.7060629633800001,
        0.6977114643800001,
        0.7395135903800001,
        0.70535579238
      ]
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + cold store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.225 ± 0.046 4.163 4.337 1.93 ± 0.10
pacquet@main 4.218 ± 0.046 4.128 4.280 1.93 ± 0.10
pnpr@HEAD 2.189 ± 0.115 2.034 2.361 1.00
pnpr@main 2.253 ± 0.141 2.052 2.450 1.03 ± 0.08
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.225193748760001,
      "stddev": 0.04618917913133223,
      "median": 4.22067961716,
      "user": 3.7132777,
      "system": 3.36851268,
      "min": 4.16274133316,
      "max": 4.33713902216,
      "times": [
        4.33713902216,
        4.21331208516,
        4.22529120016,
        4.25138008416,
        4.22116159516,
        4.16274133316,
        4.18980344816,
        4.20031208916,
        4.22019763916,
        4.23059899116
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.21766064856,
      "stddev": 0.045512519912213265,
      "median": 4.21475115816,
      "user": 3.7216876999999995,
      "system": 3.3332738799999992,
      "min": 4.12832731316,
      "max": 4.2796963331599995,
      "times": [
        4.2796963331599995,
        4.22976011116,
        4.263847066159999,
        4.19974220516,
        4.2480015481599995,
        4.1912291671599995,
        4.12832731316,
        4.192210001159999,
        4.19099192116,
        4.25280081916
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 2.189295972459999,
      "stddev": 0.11498064446893902,
      "median": 2.16510538016,
      "user": 2.4681525,
      "system": 2.8719124799999998,
      "min": 2.03410919816,
      "max": 2.3614761931599997,
      "times": [
        2.09319492616,
        2.2414892101599997,
        2.14575204816,
        2.3614761931599997,
        2.1223767681599996,
        2.03410919816,
        2.29219406916,
        2.07565415216,
        2.1844587121599996,
        2.3422544471599998
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 2.2531595487599994,
      "stddev": 0.14128919277530103,
      "median": 2.2034099431599996,
      "user": 2.4442616999999993,
      "system": 2.88221128,
      "min": 2.05188608316,
      "max": 2.45040332916,
      "times": [
        2.45040332916,
        2.05188608316,
        2.3621541641599997,
        2.4096482441599996,
        2.19203437816,
        2.11845185816,
        2.1949350001599996,
        2.40487460516,
        2.21188488616,
        2.13532293916
      ]
    }
  ]
}

Scenario: Isolated linker: fresh install, hot cache + hot store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.323 ± 0.015 1.301 1.351 2.08 ± 0.04
pacquet@main 1.328 ± 0.009 1.311 1.342 2.08 ± 0.03
pnpr@HEAD 0.676 ± 0.084 0.634 0.913 1.06 ± 0.13
pnpr@main 0.637 ± 0.009 0.622 0.650 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.3225181034799998,
      "stddev": 0.015390452110597638,
      "median": 1.32230645298,
      "user": 1.28503272,
      "system": 1.6866187799999999,
      "min": 1.30087771298,
      "max": 1.35080852198,
      "times": [
        1.33328822598,
        1.32529730698,
        1.30087771298,
        1.3145434809799998,
        1.3157871609799998,
        1.3193155989799998,
        1.3017883229799998,
        1.33494291398,
        1.32853178898,
        1.35080852198
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.32819296538,
      "stddev": 0.008681694001584554,
      "median": 1.32744543198,
      "user": 1.2979592199999999,
      "system": 1.6926479799999998,
      "min": 1.31111073198,
      "max": 1.3415700739799998,
      "times": [
        1.32706968798,
        1.33038492998,
        1.32536457098,
        1.33555447798,
        1.3370298969799999,
        1.3210852499799999,
        1.32782117598,
        1.3415700739799998,
        1.3249388579799999,
        1.31111073198
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.6761379110799999,
      "stddev": 0.08369396799908534,
      "median": 0.6516776654800001,
      "user": 0.33076562,
      "system": 1.2861660799999999,
      "min": 0.6336186179800001,
      "max": 0.9132194219800001,
      "times": [
        0.6336186179800001,
        0.6495316709800001,
        0.65208495198,
        0.6523223679800001,
        0.9132194219800001,
        0.66178590398,
        0.65953961398,
        0.6512703789800001,
        0.6420280619800001,
        0.6459781209800001
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.6371019278800001,
      "stddev": 0.00938947143399005,
      "median": 0.6369979989800001,
      "user": 0.32578081999999997,
      "system": 1.25528048,
      "min": 0.6217138629800001,
      "max": 0.6499505209800001,
      "times": [
        0.6499505209800001,
        0.63571061098,
        0.62836994698,
        0.6456974319800001,
        0.6315895319800001,
        0.6217138629800001,
        0.63828538698,
        0.6297779279800001,
        0.64105534898,
        0.64886870898
      ]
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + hot store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.954 ± 0.051 2.922 3.092 4.56 ± 0.09
pacquet@main 2.965 ± 0.025 2.934 3.011 4.58 ± 0.06
pnpr@HEAD 0.660 ± 0.008 0.648 0.677 1.02 ± 0.02
pnpr@main 0.648 ± 0.007 0.636 0.658 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.9543187536,
      "stddev": 0.05067607498549321,
      "median": 2.9370923239,
      "user": 1.73790646,
      "system": 1.9163622,
      "min": 2.9218960889,
      "max": 3.0916547999,
      "times": [
        2.9636999809,
        2.9433323639,
        2.9478095119,
        2.9246815029,
        2.9218960889,
        2.9306493359,
        2.9248214339,
        2.9308522839,
        3.0916547999,
        2.9637902339
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.9653446206000007,
      "stddev": 0.02524335038676217,
      "median": 2.9632540184000002,
      "user": 1.7528220599999997,
      "system": 1.9270157,
      "min": 2.9341658369,
      "max": 3.0114964719,
      "times": [
        2.9629530549000003,
        3.0114964719,
        2.9683187219000002,
        2.9457042479,
        2.9635549819,
        2.9341658369,
        2.9460111759000003,
        2.9406515179,
        2.9896490659,
        2.9909411309
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.6600313048,
      "stddev": 0.008119941613109867,
      "median": 0.6578783188999999,
      "user": 0.34022645999999995,
      "system": 1.2943311000000002,
      "min": 0.6481344669,
      "max": 0.6773873259,
      "times": [
        0.6563199949,
        0.6659018889,
        0.6589578689,
        0.6481344669,
        0.6551153839,
        0.6539620339,
        0.6773873259,
        0.6642908459,
        0.6567987689,
        0.6634444699
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.6476570573,
      "stddev": 0.007045075710625896,
      "median": 0.6482519549,
      "user": 0.33367026,
      "system": 1.2653219999999998,
      "min": 0.6357443669,
      "max": 0.6581079649,
      "times": [
        0.6408953689,
        0.6479038899,
        0.6357443669,
        0.6498333909,
        0.6417857569,
        0.6486000198999999,
        0.6457306519,
        0.6503860489,
        0.6581079649,
        0.6575831139
      ]
    }
  ]
}

Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 6.974 ± 0.168 6.740 7.265 1.40 ± 0.05
pacquet@main 6.892 ± 0.121 6.733 7.119 1.38 ± 0.04
pnpr@HEAD 4.989 ± 0.116 4.819 5.227 1.00
pnpr@main 5.064 ± 0.101 4.921 5.261 1.02 ± 0.03
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 6.973974233040001,
      "stddev": 0.1682226948987471,
      "median": 6.9425940527400005,
      "user": 4.105315159999999,
      "system": 3.8026046800000004,
      "min": 6.740427388740001,
      "max": 7.26485053974,
      "times": [
        6.8709408747400005,
        6.81088032474,
        6.740427388740001,
        6.98602395174,
        7.00189675674,
        7.16624965674,
        7.12909745674,
        6.89916415374,
        7.26485053974,
        6.87021122674
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 6.891586577039999,
      "stddev": 0.12111671395291584,
      "median": 6.88304580874,
      "user": 4.062754459999999,
      "system": 3.8104609799999993,
      "min": 6.73269409474,
      "max": 7.11929671774,
      "times": [
        6.90973629274,
        6.76798115574,
        6.84771071874,
        7.11929671774,
        6.95701770074,
        6.879101313740001,
        6.88699030374,
        7.03497993374,
        6.780357538740001,
        6.73269409474
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 4.98865593254,
      "stddev": 0.11590925844174578,
      "median": 4.98598127324,
      "user": 2.76450656,
      "system": 3.2536189799999997,
      "min": 4.819237562740001,
      "max": 5.2265203087400005,
      "times": [
        5.05774311374,
        4.89297890874,
        4.90506997574,
        5.00392542674,
        4.91017633574,
        5.05451602874,
        4.819237562740001,
        5.0483545447400004,
        5.2265203087400005,
        4.96803711974
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 5.06388661124,
      "stddev": 0.10130423229181337,
      "median": 5.0580511047400005,
      "user": 2.7951957600000004,
      "system": 3.2716799800000005,
      "min": 4.92062780074,
      "max": 5.26112094574,
      "times": [
        5.26112094574,
        5.11696355774,
        4.97394196074,
        4.99735371274,
        5.04031059174,
        5.14757447474,
        5.12204653274,
        5.07579161774,
        4.98313491774,
        4.92062780074
      ]
    }
  ]
}

@github-actions

github-actions Bot commented Jun 26, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branchpr/12679
Testbedpacquet
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
milliseconds (ms)
(Result Δ%)
Upper Boundary
milliseconds (ms)
(Limit %)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
🚷 view threshold
4,225.19 ms
(-4.21%)Baseline: 4,410.68 ms
5,292.81 ms
(79.83%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
2,954.32 ms
(-3.15%)Baseline: 3,050.49 ms
3,660.59 ms
(80.71%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
1,322.52 ms
(-2.73%)Baseline: 1,359.62 ms
1,631.54 ms
(81.06%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
4,096.17 ms
(-4.57%)Baseline: 4,292.12 ms
5,150.54 ms
(79.53%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
6,973.97 ms
(-0.53%)Baseline: 7,010.82 ms
8,412.98 ms
(82.90%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
643.07 ms
(+2.53%)Baseline: 627.19 ms
752.63 ms
(85.44%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

github-actions Bot commented Jun 26, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branchpr/12679
Testbedpnpr

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds flag.

Click to view all benchmark results
BenchmarkLatencymilliseconds (ms)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
2,189.30 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
660.03 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
676.14 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
2,117.65 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
4,988.66 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
685.08 ms
🐰 View full continuous benchmarking report in Bencher

@bro-ankit bro-ankit left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@zkochan Can I have your review here?

@zkochan
zkochan force-pushed the fix/npmrc-auth-file-warning-12480 branch from 499a72a to 6dc1f64 Compare July 4, 2026 00:22
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 6dc1f64

1 similar comment
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 6dc1f64

… seam

Anchor a relative npmrcAuthFile value at the cwd via the existing
GetCurrentDir capability instead of std::path::absolute, so the trust
check is testable with a fake cwd. Add regression tests on both stacks
for the literal ".npmrc" value reported in pnpm#12480, isolate
the enableGlobalVirtualStore CI test from the developer's global
config.yaml, and reword the changeset as a release note.
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 1cee3fc

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 `@pnpm11/config/reader/test/index.ts`:
- Around line 4042-4066: The test coverage in this config reader spec is missing
the negative parity case for PNPM_CONFIG_NPMRC_AUTH_FILE when a relative path
resolves outside the project, so the trust check in loadNpmrcFiles.ts is only
exercised for trusted resolutions. Add a mirrored test alongside the existing
getConfig-based cases that changes the cwd, sets PNPM_CONFIG_NPMRC_AUTH_FILE to
".npmrc", and verifies warnings still include “Ignored project-level auth
setting” when the resolved file is elsewhere. Keep the existing trusted-path
test for the literal relative project .npmrc and use the same warning-filtering
pattern to assert the untrusted case is not suppressed.
🪄 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: a086e914-33d8-4bdd-9714-6724af0bf580

📥 Commits

Reviewing files that changed from the base of the PR and between 6dc1f64 and 1cee3fc.

📒 Files selected for processing (5)
  • .changeset/rare-mice-peel.md
  • pacquet/crates/config/src/api.rs
  • pacquet/crates/config/src/lib.rs
  • pacquet/crates/config/src/tests.rs
  • pnpm11/config/reader/test/index.ts
✅ Files skipped from review due to trivial changes (2)
  • pacquet/crates/config/src/api.rs
  • .changeset/rare-mice-peel.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • pacquet/crates/config/src/lib.rs

Comment thread pnpm11/config/reader/test/index.ts Resolved
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 1cee3fc

…fake cwd

Mirror pacquet's npmrc_auth_file_relative_resolving_elsewhere_keeps_warning
on the TypeScript side: a relative PNPM_CONFIG_NPMRC_AUTH_FILE that does not
resolve to the project .npmrc keeps the warning and does not expand the
token. Isolate the test from the developer's real auth.ini via
XDG_CONFIG_HOME. Also reset the FAKE_CWD thread-local in set_fake_env so a
fake cwd cannot leak into a later test on a reused worker thread.
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Jul 4, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

Grey Divider

New Review Started

This review has been superseded by a new analysis

Grey Divider

Qodo Logo

Fixes the dylint perfectionist::bare-identifier-reference finding.
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Jul 4, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

Grey Divider

New Review Started

This review has been superseded by a new analysis

Grey Divider

Qodo Logo

@zkochan

zkochan commented Jul 4, 2026

Copy link
Copy Markdown
Member

Regarding the two open findings in the qodo review:

2. Fake cwd leaks across tests — fixed in f136c18: set_fake_env now also resets the FAKE_CWD thread-local, and every FakeEnv test starts with set_fake_env, so a fake cwd can no longer leak into a later test on a reused worker thread.

4. Path equality misses symlinks — the premise is out of date: pacquet no longer canonicalizes in this check (the canonicalize IO was removed in an earlier review round). Both stacks now do the same lexical comparison — path.resolve equality in TypeScript, cwd-anchored component equality in Rust — so they agree in symlink/alias scenarios. When a symlinked spelling does not match lexically, the behavior fails safe (the warning stays and credentials are dropped, exactly the pre-fix behavior), and the user can pass the resolved path. Adding realpath IO to every config load to widen an opt-in convenience does not seem worth it, so this is intentionally left as is.


Written by an agent (Claude Code, claude-fable-5).

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Jul 4, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

Grey Divider

New Review Started

This review has been superseded by a new analysis

Grey Divider

Qodo Logo

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 7a3b883

@zkochan
zkochan merged commit 806c3ec into pnpm:main Jul 4, 2026
32 checks passed
@welcome

welcome Bot commented Jul 4, 2026

Copy link
Copy Markdown

Congrats on merging your first pull request! 🎉🎉🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product: pacquet reviewed: coderabbit CodeRabbit submitted an approving review state: automerge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"[WARN] Ignored project-level auth setting" still warns when project level .npmrc file is trusted

3 participants