Skip to content

perf(cli): build the end-to-end tests as one target - #13679

Merged
zkochan merged 1 commit into
mainfrom
opt-build
Aug 7, 2026
Merged

zkochan merged 1 commit into
mainfrom
opt-build

Conversation

@zkochan

@zkochan zkochan commented Aug 6, 2026 •

Copy link
Copy Markdown
Member

Summary

pacquet-cli had 114 integration-test files, and Cargo builds one binary per tests/*.rs. Each of those binaries statically links the whole dependency graph — pnpr, the full registry server, included — so each weighed 241 MB, and any change to the crate recompiled and re-linked all ~27 GB of them.

Every file now lives under tests/suite/ as a module of tests/suite/main.rs, so that work happens once.

Measured on a 32-core Linux box (mold, sccache, debug = "line-tables-only"), min of 3 reps:

before after
One-line change to cli/src/lib.rs, rebuild its test targets 20.5–22.1s 3.45–3.73s
Touch package-manifest, rebuild --workspace --all-targets ~30s 11.2s
Clean cargo build -p pacquet-cli --tests disk usage 30 GB 4.9 GB
Test binaries 114 × 241 MB 1 × 264 MB

The disk figure matters beyond local builds: the Rust CI test job already carries a Free up runner disk space step and a line-tables-only override because this workspace kept crossing the runner's ENOSPC ceiling mid-link.

How this was chosen

cargo build --timings showed the build is throughput-bound, not chain-bound — the moment pacquet-cli's rlib lands, all 114 test binaries unblock at once and run to the end of the build, with nothing waiting on a dependency chain. So splitting crates would not have helped; the workspace is already 75 crates at normal-dep depth 11. Two other candidates were measured and rejected: split-debuginfo = "unpacked" (19.2s vs 20.6s) and a nodatacow/uncompressed target dir (22.5s). Building third-party deps without debuginfo cuts each binary to 182 MB but its wall-time effect was inconclusive under load, so it is not included here.

Trade-offs

  • Editing a single test file now rebuilds the suite binary: ~1s → ~3.5s. That is the rarer of the two loops; crate changes are the common case.
  • --test <file_stem> becomes the module filter -E 'test(/^<file_stem>::/)'.

Both are documented in pnpm/AGENTS.md, along with the rule that new test files belong under tests/suite/, so a stray tests/*.rs does not quietly reintroduce a binary.

Test isolation is unchanged: cargo nextest, which every test recipe in the justfile and the codecov workflow uses, runs each test in its own process no matter how many binaries there are.

Verification

  • cargo nextest run -p pacquet-cli --no-fail-fast — 2438 passed, 0 failed, 4 skipped
  • cargo clippy --locked --workspace --all-targets -- --deny warnings — clean
  • cargo fmt --check, taplo format --check, typos, cargo doc, cargo dylint — clean (full pre-push gate)

Squash Commit Body

`pacquet-cli` had 114 integration-test files, and Cargo builds one binary
per `tests/*.rs`. Each of those binaries statically links the whole
dependency graph — `pnpr`, the full registry server, included — so each
weighed 241 MB, and any change to the crate recompiled and re-linked all
~27 GB of them.

Every file now lives under `tests/suite/` as a module of
`tests/suite/main.rs`, so that work happens once. Measured on a 32-core
Linux box (mold, sccache, `debug = "line-tables-only"`):

  one-line change to cli/src/lib.rs, rebuild its test targets
      20.5-22.1s -> 3.45-3.73s
  touch package-manifest, rebuild --workspace --all-targets
      ~30s -> 11.2s
  clean `cargo build -p pacquet-cli --tests` disk usage
      30 GB -> 4.9 GB
  test binaries
      114 x 241 MB -> 1 x 264 MB

The disk figure matters beyond local builds: the Rust CI test job already
carries a "Free up runner disk space" step and a `line-tables-only`
override because this workspace kept crossing the runner's ENOSPC
ceiling mid-link.

Trade-offs: editing a single test file now rebuilds the suite binary
(~1s -> ~3.5s), which is the rarer of the two loops; and
`--test <file_stem>` becomes the module filter
`-E 'test(/^<file_stem>::/)'`. Both are documented in `pnpm/AGENTS.md`,
along with the rule that new test files belong under `tests/suite/`,
so a stray `tests/*.rs` does not quietly reintroduce a binary.

Test isolation is unchanged. `cargo nextest`, which every test recipe in
the justfile and the codecov workflow uses, runs each test in its own
process no matter how many binaries there are.

Two things the merge surfaced and this commit also fixes: seven test
files declared `pub mod _utils;` without ever using it, so each was
compiling 538 dead lines; and the `must_use_candidate` expectation in
`_utils` no longer fires now that the module is private rather than a
binary root.

Snapshots move to `tests/suite/snapshots/` under the `suite__` prefix
insta derives from the new module path.

Checklist

  • The change is implemented in both the TypeScript CLI and the Rust
    pnpm/ port, or the description notes what still needs porting.
    No counterpart needed — this changes only how pacquet's own test targets
    are laid out. Nothing user-visible, so nothing to mirror.
  • Added or updated tests. All 114 test files move; none is added or
    removed, and all 2438 tests pass.
  • Updated the documentation if needed. pnpm/AGENTS.md gains the
    tests/suite/ layout rule and the module-filter form of --test.

No changeset: no published package changes — this is test-target layout only.


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


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by CodeRabbit

  • Tests

    • Added extensive end-to-end coverage across CLI commands, installation, publishing, authentication, auditing, workspaces, catalogs, runtimes, scripts, dependency management, registries, and reporting.
    • Expanded validation for error handling, security-sensitive scenarios, cross-platform behavior, lockfiles, caching, and compatibility.
    • Consolidated CLI test execution and added targeted commands for running individual test suites.
  • Documentation

    • Documented CLI test-suite structure and guidance for adding and running new end-to-end tests.

Copilot AI lite review requested due to automatic review settings August 6, 2026 10:58
@greptile-apps

greptile-apps Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Too many files changed for review (124 files, 100 file limit).

Bypass the limit by tagging @greptile-apps to review.

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: baad4828-ffb6-40d5-9589-224a3a867011

📥 Commits

Reviewing files that changed from the base of the PR and between 658fb59 and 0287c50.

📒 Files selected for processing (6)
  • pnpm/AGENTS.md
  • pnpm/crates/cli/tests/suite/change.rs
  • pnpm/crates/cli/tests/suite/global.rs
  • pnpm/crates/cli/tests/suite/hoist.rs
  • pnpm/crates/cli/tests/suite/lockfile_resolution_reuse.rs
  • pnpm/crates/cli/tests/suite/version.rs
🚧 Files skipped from review as they are similar to previous changes (3)
  • pnpm/AGENTS.md
  • pnpm/crates/cli/tests/suite/hoist.rs
  • pnpm/crates/cli/tests/suite/change.rs

📝 Walkthrough

Walkthrough

The PR consolidates Pacquet CLI end-to-end tests into one Cargo test binary. It registers suite modules in main.rs, centralizes _utils imports, updates test-running guidance, and adds broad integration coverage for CLI commands, workspaces, registries, lockfiles, publishing, runtimes, and security cases.

Changes

Unified Pacquet CLI test suite

Layer / File(s) Summary
Single test binary and shared utilities
pnpm/AGENTS.md, pnpm/crates/cli/tests/suite/main.rs, pnpm/crates/cli/tests/suite/_utils/mod.rs, pnpm/crates/cli/tests/suite/*.rs
CLI suites now share one Cargo target. Test modules import the crate-level _utils module privately. Guidance documents module registration and cargo nextest filtering.
CLI integration coverage
pnpm/crates/cli/tests/suite/*.rs
Added end-to-end coverage for commands, workspaces, registries, authentication, lockfiles, publishing, runtimes, scripts, SBOMs, and filesystem behavior.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related issues

  • pnpm/pacquet#437: The PR adds runtime installation tests for Node, Deno, and Bun.

Possibly related PRs

  • pnpm/pnpm#12923: Related CLI integration-test infrastructure and binary setup.
  • pnpm/pnpm#13152: Related shared CLI test infrastructure and _utils organization.
  • pnpm/pnpm#13161: Related Rust CLI integration-test coverage and organization.

Suggested labels: product: pacquet

Suggested reviewers: copilot

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch opt-build

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-code-review

Copy link
Copy Markdown

PR Summary by Qodo

perf(cli): Build pacquet-cli end-to-end tests as a single suite target

✨ Enhancement 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Consolidate pacquet-cli e2e integration tests into one tests/suite binary to avoid per-file
 relinks.
• Update suite tests to use shared crate::_utils module structure.
• Document new test organization and nextest module-filter invocation.
Diagram

graph TD
  A([Cargo: build tests]) --> B["tests/suite/main.rs"] --> C["suite modules (114)"] --> D(["single suite test binary"]) --> E(["cargo nextest"]) --> F["per-test process isolation"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Split e2e tests into a dedicated crate
  • ➕ Can reduce rebuild scope when only non-test crates change
  • ➕ Allows separate dependency graphs/features for tests
  • ➖ Does not address per-file integration-test binary linking overhead
  • ➖ Adds workspace structure/maintenance and cross-crate test plumbing complexity
2. Reduce/debug-info or split-debuginfo tuning only
  • ➕ No test code reorganization required
  • ➕ May reduce link time and binary size somewhat
  • ➖ Does not eliminate N-way duplicate linking when tests are per-file targets
  • ➖ Often yields smaller wins than collapsing to a single target for large static link graphs

Recommendation: Keep the chosen approach (single tests/suite/main.rs target). For Rust integration tests with a large static dependency graph, collapsing per-file targets is the most direct way to eliminate repeated linking work and disk amplification; the remaining alternatives may offer marginal improvements but won’t remove the core N-binary relink cost.

Files changed (124) +161 / -45 · 89 not counted

Refactor (1) +0 / -4
mod.rsAdjust suite test utilities linting attributes +0/-4

Adjust suite test utilities linting attributes

• Removes a '#[expect(clippy::must_use_candidate)]' annotation on 'WorkspaceFixture::project'. Keeps the API unchanged while relying on current lint settings/usage patterns.

pnpm/crates/cli/tests/suite/_utils/mod.rs

Tests (122) +150 / -41
add.rsConvert add e2e test into suite module +1/-1

Convert add e2e test into suite module

• Switches from declaring '_utils' as a local submodule to importing the shared suite utilities via 'crate::_utils'. Aligns the file with the new single-binary suite layout.

pnpm/crates/cli/tests/suite/add.rs

approve_builds.rsMove approve_builds test into suite module not counted

Move approve_builds test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/approve_builds.rs

audit.rsMove audit test into suite module not counted

Move audit test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/audit.rs

auth.rsMove auth test into suite module not counted

Move auth test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/auth.rs

bin.rsMove bin test into suite module not counted

Move bin test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/bin.rs

bugs.rsMove bugs test into suite module not counted

Move bugs test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/bugs.rs

bundled_dependencies.rsConvert bundled_dependencies e2e test to use crate-level suite utils +1/-1

Convert bundled_dependencies e2e test to use crate-level suite utils

• Replaces 'pub mod _utils;' with 'use crate::_utils;' and keeps re-exports used by the test. Ensures the test compiles as a module within the unified suite binary.

pnpm/crates/cli/tests/suite/bundled_dependencies.rs

cache.rsMove cache test into suite module not counted

Move cache test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/cache.rs

cat_file.rsMove cat_file test into suite module not counted

Move cat_file test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/cat_file.rs

cat_index.rsMove cat_index test into suite module not counted

Move cat_index test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/cat_index.rs

catalog.rsMove catalog test into suite module not counted

Move catalog test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/catalog.rs

change.rsMove change test into suite module not counted

Move change test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/change.rs

clean.rsMove clean test into suite module not counted

Move clean test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/clean.rs

completion.rsMove completion test into suite module not counted

Move completion test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/completion.rs

config_dependencies.rsConvert config_dependencies e2e test into suite module +1/-1

Convert config_dependencies e2e test into suite module

• Switches from declaring '_utils' as a local submodule to importing suite utilities via 'crate::_utils'. Aligns module structure with the new suite binary.

pnpm/crates/cli/tests/suite/config_dependencies.rs

convergence_overrides.rsMove convergence_overrides test into suite module not counted

Move convergence_overrides test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/convergence_overrides.rs

create.rsMove create test into suite module not counted

Move create test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/create.rs

current_lockfile.rsConvert current_lockfile e2e test to suite module utilities +1/-1

Convert current_lockfile e2e test to suite module utilities

• Replaces per-file '_utils' module declaration with 'use crate::_utils' and keeps necessary re-exports. Ensures the module compiles cleanly within 'tests/suite/main.rs'.

pnpm/crates/cli/tests/suite/current_lockfile.rs

custom_fetchers.rsMove custom_fetchers test into suite module not counted

Move custom_fetchers test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/custom_fetchers.rs

custom_resolvers.rsMove custom_resolvers test into suite module not counted

Move custom_resolvers test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/custom_resolvers.rs

dedupe.rsMove dedupe test into suite module not counted

Move dedupe test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/dedupe.rs

dedupe_direct_deps.rsRemove redundant per-file _utils module declaration +0/-2

Remove redundant per-file _utils module declaration

• Drops 'pub mod _utils;' now that '_utils' is provided once by the suite root. Keeps test logic intact while compiling as part of the unified suite binary.

pnpm/crates/cli/tests/suite/dedupe_direct_deps.rs

dedupe_injected_deps.rsConvert dedupe_injected_deps e2e test into suite module +1/-1

Convert dedupe_injected_deps e2e test into suite module

• Replaces per-file '_utils' module declaration with 'use crate::_utils'. Aligns the module with the unified suite binary compilation model.

pnpm/crates/cli/tests/suite/dedupe_injected_deps.rs

deploy.rsMove deploy test into suite module not counted

Move deploy test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/deploy.rs

deprecate.rsMove deprecate test into suite module not counted

Move deprecate test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/deprecate.rs

dist_tag.rsMove dist_tag test into suite module not counted

Move dist_tag test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/dist_tag.rs

dlx.rsMove dlx test into suite module not counted

Move dlx test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/dlx.rs

docs.rsMove docs test into suite module not counted

Move docs test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/docs.rs

dry_run.rsMove dry_run test into suite module not counted

Move dry_run test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/dry_run.rs

exclude_links_from_lockfile.rsConvert exclude_links_from_lockfile e2e test into suite module +1/-1

Convert exclude_links_from_lockfile e2e test into suite module

• Switches '_utils' from a per-file module to 'crate::_utils' import to match the new single-suite target layout.

pnpm/crates/cli/tests/suite/exclude_links_from_lockfile.rs

exec.rsMove exec test into suite module not counted

Move exec test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/exec.rs

exec_recursive.rsMove exec_recursive test into suite module not counted

Move exec_recursive test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/exec_recursive.rs

fetch.rsMove fetch test into suite module not counted

Move fetch test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/fetch.rs

find_hash.rsMove find_hash test into suite module not counted

Move find_hash test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/find_hash.rs

git_hosted_install.rsConvert git_hosted_install e2e test to use suite utils +1/-1

Convert git_hosted_install e2e test to use suite utils

• Replaces 'pub mod _utils;' with 'use crate::_utils;' so the test can compile as a module under the suite root, while keeping existing test behavior.

pnpm/crates/cli/tests/suite/git_hosted_install.rs

global.rsMove global test into suite module not counted

Move global test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/global.rs

global_virtual_store.rsConvert global_virtual_store e2e test to use suite utils +1/-1

Convert global_virtual_store e2e test to use suite utils

• Imports '_utils' via 'crate::_utils' and preserves re-exports expected by the test. Keeps unix-only gating intact while compiling within the suite binary.

pnpm/crates/cli/tests/suite/global_virtual_store.rs

hoist.rsConvert hoist e2e test to use suite utils +1/-1

Convert hoist e2e test to use suite utils

• Replaces per-file '_utils' declaration with 'use crate::_utils' and retains re-exports. Ensures the unix-only test compiles under the suite root.

pnpm/crates/cli/tests/suite/hoist.rs

hoisted_node_linker.rsConvert hoisted_node_linker e2e test to use suite utils +1/-1

Convert hoisted_node_linker e2e test to use suite utils

• Replaces per-file '_utils' module with 'use crate::_utils' and keeps re-exports. Supports compilation as part of the unified suite binary.

pnpm/crates/cli/tests/suite/hoisted_node_linker.rs

import.rsMove import test into suite module not counted

Move import test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/import.rs

init.rsRely on suite-root utils instead of per-file _utils module +0/-3

Rely on suite-root utils instead of per-file _utils module

• Removes 'pub mod _utils;' / re-export boilerplate from the file so utilities come from the suite root. Keeps the test logic intact under unified compilation.

pnpm/crates/cli/tests/suite/init.rs

inject_workspace_packages.rsRemove redundant per-file _utils module declaration +0/-2

Remove redundant per-file _utils module declaration

• Drops 'pub mod _utils;' now that '_utils' is defined once in the suite root. Behavior remains unchanged while compiling in the single-binary suite.

pnpm/crates/cli/tests/suite/inject_workspace_packages.rs

install.rsConvert install e2e test to suite module imports +1/-1

Convert install e2e test to suite module imports

• Switches from per-file '_utils' module declaration to 'use crate::_utils' and keeps 'pub use _utils::*;' for existing helper access. Aligns with new suite layout.

pnpm/crates/cli/tests/suite/install.rs

install_filters.rsConvert install_filters e2e test to suite module imports +1/-1

Convert install_filters e2e test to suite module imports

• Imports suite utilities via 'crate::_utils' and maintains re-exports as needed. Ensures compatibility within the single suite test target.

pnpm/crates/cli/tests/suite/install_filters.rs

install_runtimes.rsMove install_runtimes test into suite module not counted

Move install_runtimes test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/install_runtimes.rs

install_state.rsMove install_state test into suite module not counted

Move install_state test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/install_state.rs

install_test.rsRemove redundant per-file _utils module declaration +0/-2

Remove redundant per-file _utils module declaration

• Drops 'pub mod _utils;' as '_utils' now lives at suite root. The test continues to build as part of the unified suite binary.

pnpm/crates/cli/tests/suite/install_test.rs

licenses.rsConvert licenses e2e test to use suite utils +1/-1

Convert licenses e2e test to use suite utils

• Imports the utilities module via 'crate::_utils' to match the suite module layout. Preserves existing helper usage.

pnpm/crates/cli/tests/suite/licenses.rs

lifecycle_scripts.rsConvert lifecycle_scripts e2e test to use suite utils +1/-1

Convert lifecycle_scripts e2e test to use suite utils

• Uses 'crate::_utils' instead of declaring '_utils' as a per-file module. Keeps test helpers and behavior unchanged.

pnpm/crates/cli/tests/suite/lifecycle_scripts.rs

link.rsMove link test into suite module not counted

Move link test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/link.rs

list.rsMove list test into suite module not counted

Move list test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/list.rs

local_tarball_dependency.rsMove local_tarball_dependency test into suite module not counted

Move local_tarball_dependency test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/local_tarball_dependency.rs

lockfile_only.rsConvert lockfile_only e2e test to use suite utils +1/-1

Convert lockfile_only e2e test to use suite utils

• Imports '_utils' via 'crate::_utils' and preserves specific re-exports used by the test. Keeps behavior unchanged while compiling in the suite binary.

pnpm/crates/cli/tests/suite/lockfile_only.rs

lockfile_resolution_reuse.rsDrop a lockfile-resolution reuse test during suite consolidation not counted

Drop a lockfile-resolution reuse test during suite consolidation

• Removes the 'adding_and_removing_an_ignored_optional_dependency_uses_the_safe_path' test function, leaving the remaining reuse test(s) intact. This reduces suite surface area while reorganizing into a single binary target.

pnpm/crates/cli/tests/suite/lockfile_resolution_reuse.rs

lockfile_verification.rsConvert lockfile_verification e2e test to use suite utils +1/-1

Convert lockfile_verification e2e test to use suite utils

• Imports suite utilities via 'crate::_utils' and keeps re-exports expected by the file. Maintains error-envelope verification behavior under unified compilation.

pnpm/crates/cli/tests/suite/lockfile_verification.rs

login.rsMove login test into suite module not counted

Move login test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/login.rs

logout.rsMove logout test into suite module not counted

Move logout test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/logout.rs

main.rsAdd unified suite entrypoint declaring all e2e test modules +124/-0

Add unified suite entrypoint declaring all e2e test modules

• Introduces 'tests/suite/main.rs' as the single integration test target that 'mod'-includes all previously separate test files. Documents the motivation (avoid repeated linking) and notes that nextest preserves per-test process isolation.

pnpm/crates/cli/tests/suite/main.rs

multiple_importers.rsConvert multiple_importers e2e test to use suite utils +1/-1

Convert multiple_importers e2e test to use suite utils

• Switches from declaring '_utils' locally to importing it via 'crate::_utils' and keeping re-exports. Ensures compatibility with the suite module layout.

pnpm/crates/cli/tests/suite/multiple_importers.rs

named_registry_install.rsConvert named_registry_install e2e test into suite module +1/-1

Convert named_registry_install e2e test into suite module

• Imports suite utilities via 'crate::_utils' rather than declaring them per file. Maintains existing workspace-yaml editing logic.

pnpm/crates/cli/tests/suite/named_registry_install.rs

nested_file_dependencies.rsMove nested_file_dependencies test into suite module not counted

Move nested_file_dependencies test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/nested_file_dependencies.rs

optional_dependencies.rsConvert optional_dependencies e2e test to use suite utils +1/-1

Convert optional_dependencies e2e test to use suite utils

• Replaces per-file '_utils' module declaration with 'use crate::_utils' and retains re-exports. Keeps optional dependency behavior checks unchanged.

pnpm/crates/cli/tests/suite/optional_dependencies.rs

outdated.rsMove outdated test into suite module not counted

Move outdated test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/outdated.rs

override_version_references.rsMove override_version_references test into suite module not counted

Move override_version_references test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/override_version_references.rs

pack.rsMove pack test into suite module not counted

Move pack test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/pack.rs

pack_recursive.rsMove pack_recursive test into suite module not counted

Move pack_recursive test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/pack_recursive.rs

package_manager_check.rsSimplify package_manager_check tests by removing mocked registry setup not counted

Simplify package_manager_check tests by removing mocked registry setup

• Changes tests to use 'CommandTempCwd::init()' instead of initializing a mocked registry with a pinned pnpm version, and removes related env wiring/cleanup. Keeps assertions focused on 'packageManager' behavior while reducing setup overhead under the unified suite.

pnpm/crates/cli/tests/suite/package_manager_check.rs

patch.rsConvert patch e2e test to suite utils and fix include_str path +2/-2

Convert patch e2e test to suite utils and fix include_str path

• Imports suite utilities via 'crate::_utils' and adjusts the 'include_str!' relative path to the patch fixture to match the new file location. Preserves patched-package behavior checks.

pnpm/crates/cli/tests/suite/patch.rs

peers.rsMove peers test into suite module not counted

Move peers test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/peers.rs

ping.rsMove ping test into suite module not counted

Move ping test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/ping.rs

pnpm_compatibility.rsConvert pnpm_compatibility e2e test to use suite utils +1/-1

Convert pnpm_compatibility e2e test to use suite utils

• Replaces per-file '_utils' module declaration with 'use crate::_utils' and keeps re-exports. Maintains unix-only gating and compatibility checks.

pnpm/crates/cli/tests/suite/pnpm_compatibility.rs

pnpr_install.rsMove pnpr_install test into suite module not counted

Move pnpr_install test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/pnpr_install.rs

pnpx_alias.rsMove pnpx_alias test into suite module not counted

Move pnpx_alias test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/pnpx_alias.rs

prefix.rsMove prefix test into suite module not counted

Move prefix test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/prefix.rs

prune.rsMove prune test into suite module not counted

Move prune test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/prune.rs

publish.rsMove publish test into suite module not counted

Move publish test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/publish.rs

publish_recursive.rsMove publish_recursive test into suite module not counted

Move publish_recursive test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/publish_recursive.rs

rebuild_recursive.rsMove rebuild_recursive test into suite module not counted

Move rebuild_recursive test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/rebuild_recursive.rs

remove.rsMove remove test into suite module not counted

Move remove test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/remove.rs

repeat_install.rsConvert repeat_install e2e test to use suite utils +1/-1

Convert repeat_install e2e test to use suite utils

• Replaces per-file '_utils' module declaration with 'use crate::_utils' and keeps re-exports. Preserves unix-only behavior and repeat-install assertions.

pnpm/crates/cli/tests/suite/repeat_install.rs

repo.rsMove repo test into suite module not counted

Move repo test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/repo.rs

restart.rsMove restart test into suite module not counted

Move restart test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/restart.rs

root.rsMove root test into suite module not counted

Move root test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/root.rs

run.rsMove run test into suite module not counted

Move run test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/run.rs

run_recursive.rsMove run_recursive test into suite module not counted

Move run_recursive test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/run_recursive.rs

runtime.rsMove runtime test into suite module not counted

Move runtime test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/runtime.rs

sbom.rsMove sbom test into suite module not counted

Move sbom test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/sbom.rs

scope_report.rsRemove redundant per-file _utils module declaration +0/-2

Remove redundant per-file _utils module declaration

• Drops 'pub mod _utils;' now that suite utilities are defined once in 'tests/suite/main.rs'. Keeps scope-report assertions unchanged.

pnpm/crates/cli/tests/suite/scope_report.rs

search.rsMove search test into suite module not counted

Move search test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/search.rs

self_update.rsMove self_update test into suite module not counted

Move self_update test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/self_update.rs

set_script.rsMove set_script test into suite module not counted

Move set_script test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/set_script.rs

side_effects_cache.rsMove side_effects_cache test into suite module not counted

Move side_effects_cache test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/side_effects_cache.rs

suite__add__should_install_all_dependencies.snapRelocate snapshot under suite snapshots directory not counted

Relocate snapshot under suite snapshots directory

• Snapshot file is now stored under the suite module snapshot path to match the consolidated test layout. Snapshot contents are preserved.

pnpm/crates/cli/tests/suite/snapshots/suite__add__should_install_all_dependencies.snap

suite__add__should_symlink_correctly.snapRelocate snapshot under suite snapshots directory not counted

Relocate snapshot under suite snapshots directory

• Snapshot file is now stored under the suite module snapshot path to match the consolidated test layout. Snapshot contents are preserved.

pnpm/crates/cli/tests/suite/snapshots/suite__add__should_symlink_correctly.snap

suite__init__should_create_package_json.snapRelocate snapshot under suite snapshots directory not counted

Relocate snapshot under suite snapshots directory

• Snapshot file is now stored under the suite module snapshot path to match the consolidated test layout. Snapshot contents are preserved.

pnpm/crates/cli/tests/suite/snapshots/suite__init__should_create_package_json.snap

suite__init__should_throw_on_existing_file.snapRelocate snapshot under suite snapshots directory not counted

Relocate snapshot under suite snapshots directory

• Snapshot file is now stored under the suite module snapshot path to match the consolidated test layout. Snapshot contents are preserved.

pnpm/crates/cli/tests/suite/snapshots/suite__init__should_throw_on_existing_file.snap

suite__install__should_install_dependencies.snapRelocate snapshot under suite snapshots directory not counted

Relocate snapshot under suite snapshots directory

• Snapshot file is now stored under the suite module snapshot path to match the consolidated test layout. Snapshot contents are preserved.

pnpm/crates/cli/tests/suite/snapshots/suite__install__should_install_dependencies.snap

suite__install__should_install_exec_files.snapRelocate snapshot under suite snapshots directory not counted

Relocate snapshot under suite snapshots directory

• Snapshot file is now stored under the suite module snapshot path to match the consolidated test layout. Snapshot contents are preserved.

pnpm/crates/cli/tests/suite/snapshots/suite__install__should_install_exec_files.snap

suite__install__should_install_index_files.snapRelocate snapshot under suite snapshots directory not counted

Relocate snapshot under suite snapshots directory

• Snapshot file is now stored under the suite module snapshot path to match the consolidated test layout. Snapshot contents are preserved.

pnpm/crates/cli/tests/suite/snapshots/suite__install__should_install_index_files.snap

stage.rsMove stage test into suite module not counted

Move stage test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/stage.rs

stale_pin_dedupe.rsMove stale_pin_dedupe test into suite module not counted

Move stale_pin_dedupe test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/stale_pin_dedupe.rs

star_tests.rsMove star_tests test into suite module not counted

Move star_tests test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/star_tests.rs

stars_tests.rsMove stars_tests test into suite module not counted

Move stars_tests test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/stars_tests.rs

store.rsMove store test into suite module not counted

Move store test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/store.rs

tarball_url_dependency.rsMove tarball_url_dependency test into suite module not counted

Move tarball_url_dependency test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/tarball_url_dependency.rs

team.rsMove team test into suite module not counted

Move team test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/team.rs

test_command.rsMove test_command test into suite module not counted

Move test_command test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/test_command.rs

undeprecate.rsMove undeprecate test into suite module not counted

Move undeprecate test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/undeprecate.rs

unlink.rsMove unlink test into suite module not counted

Move unlink test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/unlink.rs

unpublish.rsMove unpublish test into suite module not counted

Move unpublish test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/unpublish.rs

unstar_tests.rsMove unstar_tests test into suite module not counted

Move unstar_tests test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/unstar_tests.rs

update.rsConvert update e2e test into suite module +1/-1

Convert update e2e test into suite module

• Switches from declaring '_utils' as a local submodule to importing it via 'crate::_utils'. Aligns helper usage with the unified suite binary.

pnpm/crates/cli/tests/suite/update.rs

update_changeset.rsMove update_changeset test into suite module not counted

Move update_changeset test into suite module

• Part of the suite consolidation: this test now compiles as a module under 'tests/suite/main.rs' instead of a standalone integration test binary.

pnpm/crates/cli/tests/suite/update_changeset.rs

update_jsr.rsRemove redundant per-file _utils module declaration +0/-2

Remove redundant per-file _utils module declaration

• Drops 'pub mod _utils;' now that '_utils' is defined once at the suite root. Keeps JSR-related update assertions unchanged.

pnpm/crates/cli/tests/suite/update_js

[Comment truncated to fit github's 65,536-char limit.]

@qodo-code-review

qodo-code-review Bot commented Aug 6, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (1) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. main.rs doc uses previously 📘 Rule violation ⚙ Maintainability
Description
Newly added documentation uses historical phrasing (e.g., previously, former per-file) instead
of clearly documenting the current behavior/contract, which can quickly become stale. This violates
the guideline that source comments and docs should avoid historical implementation notes and only
describe the current supported invocation.
Code

pnpm/crates/cli/tests/suite/main.rs[R3-6]

+//! Each module below was previously its own integration-test target.
+//! Cargo links an integration-test binary against the whole dependency
+//! graph, so one target per file meant re-linking ~240 MB per file on
+//! every change to the crate. `cargo nextest` still runs each test in
Relevance

●●● Strong

Team often rewords docs to avoid temporal phrasing like “before/previously” in CLI test comments.

PR-#13417
PR-#13246
PR-#13138

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 772199 explicitly disallows historical phrasing in comments/documentation and
requires describing current behavior. The added rustdoc in pnpm/crates/cli/tests/suite/main.rs
includes the word previously, indicating past structure rather than the present contract, and the
newly added text in pnpm/AGENTS.md uses former per-file, which similarly references prior
behavior; these phrases directly demonstrate the violation in the cited locations.

Rule 772199: Comments must describe current behavior, not historical implementations
pnpm/crates/cli/tests/suite/main.rs[3-6]
pnpm/AGENTS.md[286-287]

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

## Issue description
Update the newly added documentation to remove historical phrasing (e.g., `previously`, `former per-file`) and rewrite it to describe only the current behavior/contract and the currently supported invocation.

## Issue Context
PR Compliance ID 772199 requires that comments and documentation describe current behavior and explicitly forbids historical implementation notes that reference prior structures/usages, since they can become stale.

## Fix Focus Areas
- pnpm/crates/cli/tests/suite/main.rs[3-6]
- pnpm/AGENTS.md[286-287]

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


Grey Divider

Context used
✅ Compliance rules (platform): 24 rules

To customize comments, go to the Qodo configuration screen, or learn more in the docs.

Previous review results

Review updated until commit 0287c50 ⚖️ Balanced

Results up to commit e5d91cf ⚖️ Balanced


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


Remediation recommended
1. main.rs doc uses previously 📘 Rule violation ⚙ Maintainability
Description
Newly added documentation uses historical phrasing (e.g., previously, former per-file) instead
of clearly documenting the current behavior/contract, which can quickly become stale. This violates
the guideline that source comments and docs should avoid historical implementation notes and only
describe the current supported invocation.
Code

pnpm/crates/cli/tests/suite/main.rs[R3-6]

+//! Each module below was previously its own integration-test target.
+//! Cargo links an integration-test binary against the whole dependency
+//! graph, so one target per file meant re-linking ~240 MB per file on
+//! every change to the crate. `cargo nextest` still runs each test in
Relevance

●●● Strong

Team often rewords docs to avoid temporal phrasing like “before/previously” in CLI test comments.

PR-#13417
PR-#13246
PR-#13138

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 772199 explicitly disallows historical phrasing in comments/documentation and
requires describing current behavior. The added rustdoc in pnpm/crates/cli/tests/suite/main.rs
includes the word previously, indicating past structure rather than the present contract, and the
newly added text in pnpm/AGENTS.md uses former per-file, which similarly references prior
behavior; these phrases directly demonstrate the violation in the cited locations.

Rule 772199: Comments must describe current behavior, not historical implementations
pnpm/crates/cli/tests/suite/main.rs[3-6]
pnpm/AGENTS.md[286-287]

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

## Issue description
Update the newly added documentation to remove historical phrasing (e.g., `previously`, `former per-file`) and rewrite it to describe only the current behavior/contract and the currently supported invocation.

## Issue Context
PR Compliance ID 772199 requires that comments and documentation describe current behavior and explicitly forbids historical implementation notes that reference prior structures/usages, since they can become stale.

## Fix Focus Areas
- pnpm/crates/cli/tests/suite/main.rs[3-6]
- pnpm/AGENTS.md[286-287]

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


Results up to commit 658fb59 ⚖️ Balanced


No changes from previous review

Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@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: 4

Note

Due to the large number of review comments, Critical, Major severity comments were prioritized as inline comments.

🟡 Minor comments (19)
pnpm/crates/cli/tests/suite/deploy.rs-496-499 (1)

496-499: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Confirm the intended path on Line 498.

deploy_dir is already workspace/legacy-deploy-no-lockfile. Line 498 therefore checks workspace/legacy-deploy-no-lockfile/legacy-deploy-no-lockfile/node_modules. If the goal is to prove that deploy does not nest a second directory of the same name, the assertion is correct but the doubled segment is easy to misread. If the goal is something else, the assertion passes for the wrong reason and proves nothing.

State the intent in the assertion message either way.

🐛 Proposed clarification
     let deploy_dir = workspace.join("legacy-deploy-no-lockfile");
     assert!(deploy_dir.join("node_modules/lib").exists());
-    assert!(!deploy_dir.join("legacy-deploy-no-lockfile/node_modules").exists());
+    assert!(
+        !deploy_dir.join("legacy-deploy-no-lockfile/node_modules").exists(),
+        "deploy must install at the target root, not in a nested directory of the same name",
+    );
     assert!(!deploy_dir.join("pnpm-lock.yaml").exists());
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm/crates/cli/tests/suite/deploy.rs` around lines 496 - 499, Clarify the
intent of the second node_modules assertion in the deploy test by adding an
explicit assertion message to the check involving
deploy_dir.join("legacy-deploy-no-lockfile/node_modules"). Preserve the existing
path and assertion behavior while making clear that it verifies no nested
duplicate deploy directory is created.
pnpm/crates/cli/tests/suite/cat_file.rs-79-89 (1)

79-89: 🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win

Make the path-traversal test assert the security property, not one specific error string.

The payload decodes to 16 bytes, not a 64-byte sha512 digest. The comment on line 87 states the command may fail either as "not found" or as an invalid decode, but the assertion accepts only "File not found in store". If the CLI adds a digest-length check, this test fails while the security property still holds. The test also proves only that an error occurred, not that no path outside the store was read.

Accept either failure reason, and assert that the store boundary was not crossed.

🔒️ Proposed change
 #[test]
 fn should_prevent_path_traversal() {
-    let CommandTempCwd { mut pacquet, root: _root, .. } =
+    let CommandTempCwd { mut pacquet, root: _root, .. } =
         CommandTempCwd::init().add_mocked_registry();
     // A crafted base64 payload that decodes to bytes resembling a path traversal like "../../etc/passwd".
     // "Li4vLi4vZXRjL3Bhc3N3ZA==" is base64 for "../../etc/passwd"
     let output = pacquet.arg("cat-file").arg("sha512-Li4vLi4vZXRjL3Bhc3N3ZA==").assert().failure();
     let stderr = String::from_utf8_lossy(&output.get_output().stderr);
-    // It should fail to find the file (or decode as invalid depending on length), but it must NOT escape the store.
-    assert!(stderr.contains("File not found in store"));
+    // The decoded bytes are not a valid digest, so either rejection is correct.
+    // What must hold is that no path outside the store is read.
+    assert!(
+        stderr.contains("File not found in store") || stderr.contains("Invalid hash format"),
+        "unexpected failure reason: {stderr}",
+    );
+    assert!(!stderr.contains("passwd"), "the traversal path must not be opened: {stderr}");
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm/crates/cli/tests/suite/cat_file.rs` around lines 79 - 89, Update
should_prevent_path_traversal to accept either the existing “File not found in
store” failure or an invalid digest/decode failure, while asserting the command
remains unsuccessful. Add an assertion that the crafted traversal payload does
not read or expose content outside the store, preserving the test’s focus on
enforcing the store boundary rather than one exact error message.
pnpm/crates/cli/tests/suite/restart.rs-110-125 (1)

110-125: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

The Windows rationale comment contradicts the #[cfg(unix)] gate.

Lines 116-118 explain that the log path travels as a script argument so that "a Windows path's backslashes would be swallowed as string escapes" is avoided. Under #[cfg(unix)] at Line 111 the test never compiles on Windows, so that precaution has no effect and the comment describes a situation the test cannot reach.

The script body here uses node, not a POSIX shell builtin, so the gate may be unnecessary. Either remove #[cfg(unix)] so the Windows-safe argument passing is actually exercised, or remove the Windows rationale from the comment.

As per coding guidelines: comments "should describe current behavior rather than historical implementation details."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm/crates/cli/tests/suite/restart.rs` around lines 110 - 125, The
restart_passes_args_to_scripts test’s Windows-path rationale conflicts with its
#[cfg(unix)] gate. Remove the unnecessary Unix-only gate so the argument-passing
behavior is exercised on Windows, while preserving the existing script
construction and path-as-argument behavior.

Source: Coding guidelines

pnpm/crates/cli/tests/suite/run_recursive.rs-112-143 (1)

112-143: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

The concurrency probe has a 1-second budget, which can flake under CI load.

Each script polls for its peer's marker at most 100 times with sleep 0.01, so the total wait is about 1 second plus loop overhead. The test then runs test -f ../<peer>.started, which fails the script if the peer has not started. Under a loaded CI runner, spawning the second sh process can take longer than 1 second even when the runner is correctly parallel. The test then fails for a scheduling reason, not for a behavior regression.

Raise the attempt count so the budget is several seconds. The test still fails fast when execution is genuinely serial, because a serial runner never writes the peer marker and the loop always exhausts.

🔧 Proposed fix to widen the wait budget
                 "build": format!(
                     "touch ../{name}.started; \
                      attempts=0; \
-                     while [ ! -f ../{peer}.started ] && [ \"$attempts\" -lt 100 ]; do \
+                     while [ ! -f ../{peer}.started ] && [ \"$attempts\" -lt 1000 ]; do \
                        sleep 0.01; attempts=$((attempts + 1)); \
                      done; \
                      test -f ../{peer}.started"
                 ),
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm/crates/cli/tests/suite/run_recursive.rs` around lines 112 - 143,
Increase the polling attempt limit in the waits_for_peer build-script closure
from 100 to a several-second budget while keeping the 0.01-second sleep and
existing marker validation unchanged. This should tolerate CI scheduling delays
without changing the test’s failure behavior for genuinely serial execution.
pnpm/crates/cli/tests/suite/repo.rs-18-32 (1)

18-32: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Keep separate diagnostics for missing manifest and missing repository field.

repo_fails_without_package_json and repo_fails_without_repository_field currently assert the same ERR_PNPM_NO_REPO_URL output, but a missing importer manifest is modeled elsewhere as ERR_PNPM_NO_IMPORTER_MANIFEST_FOUND. Keep the two cases separate so this suite does not lock in an intentional parity divergence for missing package.json.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm/crates/cli/tests/suite/repo.rs` around lines 18 - 32, The
repo_fails_without_package_json test should assert the missing-manifest
diagnostic ERR_PNPM_NO_IMPORTER_MANIFEST_FOUND instead of the
missing-repository-field ERR_PNPM_NO_REPO_URL message. Keep
repo_fails_without_repository_field asserting the repository-field error so the
two scenarios retain distinct diagnostics.

Source: Learnings

pnpm/crates/cli/tests/suite/login.rs-32-38 (1)

32-38: 🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win

Pin HOME as well as XDG_CONFIG_HOME.

Lines 33 and 87 set only XDG_CONFIG_HOME. pnpm/crates/cli/tests/suite/logout.rs lines 26-27 and 49-50 set both XDG_CONFIG_HOME and HOME for the same config-directory resolution. If the resolver falls back to $HOME on any platform, or if a later change adds that fallback, these login tests write auth credentials into the developer's real home directory. Set HOME to root.path() here too.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm/crates/cli/tests/suite/login.rs` around lines 32 - 38, Update the login
test command setup at both config-directory environment assignments to set HOME
to root.path() alongside XDG_CONFIG_HOME, matching the isolation used by the
logout tests and preventing credentials from reaching the developer’s home
directory.
pnpm/crates/cli/tests/suite/link.rs-328-332 (1)

328-332: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use the junction-aware symlink helper for Windows compatibility.

NodeModuleLinker::link can create directory junctions on Windows, and fs::symlink_metadata(...).file_type().is_symlink() does not accept those. Import pacquet_testing_utils::fs::is_symlink_or_junction in pnpm/crates/cli/tests/suite/link.rs and assert is_symlink_or_junction(&linked).expect("inspect link") instead.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm/crates/cli/tests/suite/link.rs` around lines 328 - 332, Update the link
assertion in the test to import and use
pacquet_testing_utils::fs::is_symlink_or_junction, calling it with linked and
expecting successful inspection, instead of checking file_type().is_symlink()
via symlink_metadata. Preserve the existing failure message.

Source: Path instructions

pnpm/crates/cli/tests/suite/fetch.rs-161-174 (1)

161-174: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Make the GVS fixture assertion fail early.

After writing the workspace YAML, assert that the replaced content differs from the original string before running fetch. A no-op write currently still calls fetch, then the test can fail later with a message pointing at the fetch behavior instead of the fixture change.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm/crates/cli/tests/suite/fetch.rs` around lines 161 - 174, Update the
workspace YAML setup around yaml_path so it retains the original content,
verifies the replacement changed it, and only then writes the modified YAML.
Make this assertion occur before pacquet_at(...).with_arg("fetch"), so a missing
enableGlobalVirtualStore fixture change fails immediately.
pnpm/crates/cli/tests/suite/install_runtimes.rs-306-330 (1)

306-330: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Assert the resolved Node version; the test currently proves only that the install exits 0.

explicit_node_version_takes_priority_over_the_manifest_runtime sets nodeVersion: 20.0.0 and a conflicting devEngines.runtime of ^22.0.0, then only calls .assert().success(). Nothing checks which version won. If precedence regressed and the manifest runtime ^22.0.0 were selected, engineStrict: true with engines.node: "<21" would be the only thing that could fail the install — and onFail: ignore may suppress that path. The test then passes for the wrong reason.

Add an assertion on the observable outcome, for example the resolved runtime recorded in pnpm-lock.yaml or the absence of any node@runtime:^22 entry.

💚 Suggested assertion
     command(&workspace).with_arg("install").assert().success();
+    let lockfile = fs::read_to_string(workspace.join("pnpm-lock.yaml")).unwrap();
+    assert!(
+        !lockfile.contains("node@runtime:"),
+        "the explicit nodeVersion must win over the devEngines runtime:\n{lockfile}",
+    );
 }

Replace the assertion with the exact artifact that records the chosen version if the lockfile is not the right place.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm/crates/cli/tests/suite/install_runtimes.rs` around lines 306 - 330,
Strengthen explicit_node_version_takes_priority_over_the_manifest_runtime by
asserting the selected Node 20.0.0 runtime in the observable install artifact,
such as the corresponding pnpm-lock.yaml entry. Ensure the test also verifies
that the conflicting node@runtime:^22.0.0 runtime is not selected, rather than
relying only on command success.

Source: Path instructions

pnpm/crates/cli/tests/suite/list.rs-787-791 (1)

787-791: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use enable_gvs_in_workspace_yaml for the global-virtual-store toggle.

list.rs has its own String::replace(...) branch without checking that the fixture changed. If enableGlobalVirtualStore: false is missing, the install runs without GVS and the later path assertions no longer cover the intended case. Call crate::_utils::enable_gvs_in_workspace_yaml(&workspace, "privateHoistPattern: '*'\n") instead, or add the same assert to the inline replacement.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm/crates/cli/tests/suite/list.rs` around lines 787 - 791, The workspace
YAML update in the list test should use the shared enable_gvs_in_workspace_yaml
helper instead of the unchecked String::replace branch. Replace the inline
read/replace/write logic with
crate::_utils::enable_gvs_in_workspace_yaml(&workspace, "privateHoistPattern:
'*'\n") so the fixture change is validated before running the GVS assertions.

Source: Path instructions

pnpm/crates/cli/tests/suite/global.rs-1-3 (1)

1-3: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Correct the module doc: no update -g test exists here.

The module doc lists update -g among the covered commands. This file contains tests for add -g, remove -g, list -g, and outdated -g only.

📝 Proposed doc fix
 //! End-to-end tests for global package management (`add -g`, `remove -g`,
-//! `update -g`, `list -g`). The happy paths need the mocked registry and
+//! `list -g`, `outdated -g`). The happy paths need the mocked registry and
 //! create real symlinks / bin shims, so they are Unix-gated.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm/crates/cli/tests/suite/global.rs` around lines 1 - 3, Update the
module-level documentation in the global test module to remove “update -g” and
list the commands actually covered: add -g, remove -g, list -g, and outdated -g.
pnpm/crates/cli/tests/suite/global.rs-10-14 (1)

10-14: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Gate the Path imports for non-Unix global tests.

This module has #[cfg(unix)] tests that use Path/PathBuf, but global_list_empty() and global_add_pnpm_is_rejected() are not Unix-gated and do not use either type. On --all-targets, the Cargo Windows target is built in CI, so gated imports in a non-gated module can trigger unused_imports under -D warnings. Gate these imports under #[cfg(unix)] unless these functions also need to run on Windows.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm/crates/cli/tests/suite/global.rs` around lines 10 - 14, Gate the Path
and PathBuf imports in the global test module with cfg(unix), while keeping fs
and Command available to the non-Unix tests global_list_empty() and
global_add_pnpm_is_rejected().
pnpm/crates/cli/tests/suite/package_manager_check.rs-548-556 (1)

548-556: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Clear Windows home/profile env vars in the package manager check helper.

package_manager_check.rs runs under the Windows CI matrix, but run() does not clear USERPROFILE or APPDATA; Windows reads .npmrc from those locations rather than HOME. Add the same env isolation used for the store-path test so these assertions cannot depend on the runner/user profile.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm/crates/cli/tests/suite/package_manager_check.rs` around lines 548 - 556,
The run helper must isolate Windows profile-based configuration as well as HOME
and XDG_CONFIG_HOME. Update run to clear or override USERPROFILE and APPDATA
using the same environment isolation approach as the store-path test, while
preserving any values explicitly configured by the test.
pnpm/crates/cli/tests/suite/self_update.rs-6-9 (1)

6-9: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Update the cross-reference to the new suite layout.

The comment points at tests/with.rs. This PR moves that file to tests/suite/with.rs.

✏️ Proposed fix
-//! the mock registry doesn't serve `pnpm` / `@pnpm/exe` (see `tests/with.rs`
-//! for the same limitation), so the command is expected to fail at the
+//! the mock registry doesn't serve `pnpm` / `@pnpm/exe` (see
+//! `tests/suite/with.rs` for the same limitation), so the command is expected to fail at the
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm/crates/cli/tests/suite/self_update.rs` around lines 6 - 9, Update the
cross-reference in the self-update test comment to point from tests/with.rs to
tests/suite/with.rs, leaving the surrounding explanation unchanged.
pnpm/crates/cli/tests/suite/search.rs-45-50 (1)

45-50: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

unreachable_registry can race with another listener on the same port.

The function binds an ephemeral port, records it, then drops the listener. The port is free from that moment. Any other process on the machine, including a mockito server started by a concurrent test in this suite, can bind the same port before fails_on_a_network_failure sends its request. The test then gets a real HTTP response and the Network request failed assertion fails.

Use a port that never accepts a connection. star_tests.rs and unstar_tests.rs already use http://127.0.0.1:9/ (the discard port) for the same purpose.

🐛 Proposed fix
-fn unreachable_registry() -> String {
-    let listener = TcpListener::bind("127.0.0.1:0").expect("bind a probe socket");
-    let port = listener.local_addr().expect("read the probe socket address").port();
-    drop(listener);
-    format!("http://127.0.0.1:{port}/")
-}
+/// Port 9 (discard) never accepts a TCP connection on loopback, so the
+/// request fails deterministically instead of racing a freed ephemeral port.
+fn unreachable_registry() -> String {
+    "http://127.0.0.1:9/".to_string()
+}

Remove the now-unused std::net::TcpListener import.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm/crates/cli/tests/suite/search.rs` around lines 45 - 50, Update
unreachable_registry to return the fixed discard-port URL http://127.0.0.1:9/
instead of binding and releasing an ephemeral TcpListener, ensuring the target
cannot be claimed by another test. Remove the now-unused TcpListener import.
pnpm/crates/cli/tests/suite/sbom.rs-6-39 (1)

6-39: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Report the fixture path when the fixture directory is missing.

copy_fixture resolves either the local fixture or the sibling pnpm11 fixture tree; failures from fs::read_dir(&fixture_dir).expect(...) currently do not tell test failures which path was tried. Include fixture_dir.display() in the panic message when the directory cannot be read.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm/crates/cli/tests/suite/sbom.rs` around lines 6 - 39, Update copy_fixture
so the fs::read_dir(&fixture_dir) failure message includes
fixture_dir.display(), identifying the resolved fixture path that could not be
read while preserving the existing panic behavior.
pnpm/crates/cli/tests/suite/why.rs-133-151 (1)

133-151: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

why_depth_limits_output does not prove that --depth limits output.

The test computes output_full and output_depth1, then asserts only that each output contains expected entries. It never asserts that depth1_stdout omits something present in full_stdout. The test passes even if --depth 1 is ignored entirely. The test also never asserts that either command succeeded.

Add a negative assertion for the content that depth 1 must exclude, and assert both exit statuses.

♻️ Proposed strengthening
     let full_stdout = String::from_utf8_lossy(&output_full.stdout);
     let depth1_stdout = String::from_utf8_lossy(&output_depth1.stdout);
+    assert!(output_full.status.success(), "why should succeed: {full_stdout}");
+    assert!(output_depth1.status.success(), "why --depth 1 should succeed: {depth1_stdout}");
     assert!(full_stdout.contains("test-why"), "full output shows project: {full_stdout}");
     assert!(depth1_stdout.contains(DEP), "depth=1 output still shows the target: {depth1_stdout}");
     assert!(depth1_stdout.contains(PKG), "depth=1 output shows direct parent: {depth1_stdout}");
+    assert!(
+        !depth1_stdout.contains("test-why"),
+        "depth=1 must cut the importer beyond the direct parent: {depth1_stdout}",
+    );

Confirm the expected depth-1 boundary against the command implementation before adopting the negative assertion.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm/crates/cli/tests/suite/why.rs` around lines 133 - 151, Strengthen
why_depth_limits_output by asserting both why command invocations succeed, then
compare the outputs to verify depth 1 excludes content that appears in the
unrestricted output. Confirm the command’s depth-1 boundary and use an entry
that should be omitted at that depth, while retaining the existing assertions
for the target and direct parent.

Source: Path instructions

pnpm/crates/cli/tests/suite/undeprecate.rs-76-84 (1)

76-84: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Pin a registry for the validation-only failure tests.

fails_when_package_is_not_provided and fails_when_message_is_provided pass registry: None, and the workspace from CommandTempCwd::init() contains no .npmrc. The CLI therefore resolves the default public registry. Both tests pass today only because argument validation runs before any request. If validation ever moves after config or network setup, these tests issue an outbound request to the public registry from CI.

The rest of this cohort already pins an unreachable registry for validation-only failures, for example http://localhost:4873/ in pnpm/crates/cli/tests/suite/stage.rs at Lines 316 and 326. Apply the same pattern here.

🛡️ Proposed change
-    let output = run_undeprecate(&workspace, &auth_file, None, &[]);
+    let output =
+        run_undeprecate(&workspace, &auth_file, Some("http://localhost:4873/"), &[]);
-    let output = run_undeprecate(&workspace, &auth_file, None, &["foo", "extra-message"]);
+    let output = run_undeprecate(
+        &workspace,
+        &auth_file,
+        Some("http://localhost:4873/"),
+        &["foo", "extra-message"],
+    );

Also applies to: 107-115

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm/crates/cli/tests/suite/undeprecate.rs` around lines 76 - 84, Update the
validation-only tests fails_when_package_is_not_provided and
fails_when_message_is_provided to pass an unreachable localhost registry, such
as http://localhost:4873/, instead of None when calling run_undeprecate. Keep
their existing assertions and validation scenarios unchanged.
pnpm/crates/cli/tests/suite/undeprecate.rs-15-19 (1)

15-19: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Move the duplicated empty_auth_file helper into the shared suite utilities. Eight test modules define the same helper by name and content; add a single public definition to pnpm/crates/cli/tests/suite/_utils/mod.rs and replace the local definitions in the affected modules.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm/crates/cli/tests/suite/undeprecate.rs` around lines 15 - 19, The
duplicated empty_auth_file helper should be centralized in the shared suite
utilities. Add one public empty_auth_file definition to
pnpm/crates/cli/tests/suite/_utils/mod.rs, then remove the local definitions and
use the shared helper in pnpm/crates/cli/tests/suite/undeprecate.rs lines 15-19
and pnpm/crates/cli/tests/suite/team.rs lines 14-18; apply the same replacement
to the other six affected test modules.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pnpm/crates/cli/tests/suite/outdated.rs`:
- Around line 55-56: Update the workspace-manifest setup in the outdated test
cases to read the existing pnpm-workspace.yaml, append the packages
configuration, and write it back instead of replacing it. Apply this to each
fs::write call identified in the diff, reusing the existing helper pattern and
preserving the storeDir and cacheDir entries created by add_mocked_registry().

In `@pnpm/crates/cli/tests/suite/publish.rs`:
- Line 270: Update the publish tests in pnpm/crates/cli/tests/suite/publish.rs
at lines 270-270, 301-301, and 322-322: retain each registry mock, configure it
with an expectation of exactly one request, and call its assert method after the
corresponding command assertion. Ensure the rejection mock verifies the failing
publish reached the registry, while the JSON-success and reporter-suppression
mocks each verify one upload request.

In `@pnpm/crates/cli/tests/suite/update_changeset.rs`:
- Around line 372-387: The test
update_changeset_supports_a_package_outside_a_workspace must preserve the
fixture’s isolated store and cache configuration. Replace only the
workspace-defining settings in pnpm-workspace.yaml, or rewrite the file while
retaining storeDir, cacheDir, and enableGlobalVirtualStore: false, instead of
removing the entire YAML before running install.

In `@pnpm/crates/cli/tests/suite/version.rs`:
- Around line 115-120: Update pacquet_recursive_version to use the shared
test_command helper with the temp root from CommandTempCwd::init() before
changing directories and invoking pnpm version, rather than constructing an
independent Command. Preserve pacquet_version’s version argument handling and
remove the duplicated unisolated command setup.

---

Minor comments:
In `@pnpm/crates/cli/tests/suite/cat_file.rs`:
- Around line 79-89: Update should_prevent_path_traversal to accept either the
existing “File not found in store” failure or an invalid digest/decode failure,
while asserting the command remains unsuccessful. Add an assertion that the
crafted traversal payload does not read or expose content outside the store,
preserving the test’s focus on enforcing the store boundary rather than one
exact error message.

In `@pnpm/crates/cli/tests/suite/deploy.rs`:
- Around line 496-499: Clarify the intent of the second node_modules assertion
in the deploy test by adding an explicit assertion message to the check
involving deploy_dir.join("legacy-deploy-no-lockfile/node_modules"). Preserve
the existing path and assertion behavior while making clear that it verifies no
nested duplicate deploy directory is created.

In `@pnpm/crates/cli/tests/suite/fetch.rs`:
- Around line 161-174: Update the workspace YAML setup around yaml_path so it
retains the original content, verifies the replacement changed it, and only then
writes the modified YAML. Make this assertion occur before
pacquet_at(...).with_arg("fetch"), so a missing enableGlobalVirtualStore fixture
change fails immediately.

In `@pnpm/crates/cli/tests/suite/global.rs`:
- Around line 1-3: Update the module-level documentation in the global test
module to remove “update -g” and list the commands actually covered: add -g,
remove -g, list -g, and outdated -g.
- Around line 10-14: Gate the Path and PathBuf imports in the global test module
with cfg(unix), while keeping fs and Command available to the non-Unix tests
global_list_empty() and global_add_pnpm_is_rejected().

In `@pnpm/crates/cli/tests/suite/install_runtimes.rs`:
- Around line 306-330: Strengthen
explicit_node_version_takes_priority_over_the_manifest_runtime by asserting the
selected Node 20.0.0 runtime in the observable install artifact, such as the
corresponding pnpm-lock.yaml entry. Ensure the test also verifies that the
conflicting node@runtime:^22.0.0 runtime is not selected, rather than relying
only on command success.

In `@pnpm/crates/cli/tests/suite/link.rs`:
- Around line 328-332: Update the link assertion in the test to import and use
pacquet_testing_utils::fs::is_symlink_or_junction, calling it with linked and
expecting successful inspection, instead of checking file_type().is_symlink()
via symlink_metadata. Preserve the existing failure message.

In `@pnpm/crates/cli/tests/suite/list.rs`:
- Around line 787-791: The workspace YAML update in the list test should use the
shared enable_gvs_in_workspace_yaml helper instead of the unchecked
String::replace branch. Replace the inline read/replace/write logic with
crate::_utils::enable_gvs_in_workspace_yaml(&workspace, "privateHoistPattern:
'*'\n") so the fixture change is validated before running the GVS assertions.

In `@pnpm/crates/cli/tests/suite/login.rs`:
- Around line 32-38: Update the login test command setup at both
config-directory environment assignments to set HOME to root.path() alongside
XDG_CONFIG_HOME, matching the isolation used by the logout tests and preventing
credentials from reaching the developer’s home directory.

In `@pnpm/crates/cli/tests/suite/package_manager_check.rs`:
- Around line 548-556: The run helper must isolate Windows profile-based
configuration as well as HOME and XDG_CONFIG_HOME. Update run to clear or
override USERPROFILE and APPDATA using the same environment isolation approach
as the store-path test, while preserving any values explicitly configured by the
test.

In `@pnpm/crates/cli/tests/suite/repo.rs`:
- Around line 18-32: The repo_fails_without_package_json test should assert the
missing-manifest diagnostic ERR_PNPM_NO_IMPORTER_MANIFEST_FOUND instead of the
missing-repository-field ERR_PNPM_NO_REPO_URL message. Keep
repo_fails_without_repository_field asserting the repository-field error so the
two scenarios retain distinct diagnostics.

In `@pnpm/crates/cli/tests/suite/restart.rs`:
- Around line 110-125: The restart_passes_args_to_scripts test’s Windows-path
rationale conflicts with its #[cfg(unix)] gate. Remove the unnecessary Unix-only
gate so the argument-passing behavior is exercised on Windows, while preserving
the existing script construction and path-as-argument behavior.

In `@pnpm/crates/cli/tests/suite/run_recursive.rs`:
- Around line 112-143: Increase the polling attempt limit in the waits_for_peer
build-script closure from 100 to a several-second budget while keeping the
0.01-second sleep and existing marker validation unchanged. This should tolerate
CI scheduling delays without changing the test’s failure behavior for genuinely
serial execution.

In `@pnpm/crates/cli/tests/suite/sbom.rs`:
- Around line 6-39: Update copy_fixture so the fs::read_dir(&fixture_dir)
failure message includes fixture_dir.display(), identifying the resolved fixture
path that could not be read while preserving the existing panic behavior.

In `@pnpm/crates/cli/tests/suite/search.rs`:
- Around line 45-50: Update unreachable_registry to return the fixed
discard-port URL http://127.0.0.1:9/ instead of binding and releasing an
ephemeral TcpListener, ensuring the target cannot be claimed by another test.
Remove the now-unused TcpListener import.

In `@pnpm/crates/cli/tests/suite/self_update.rs`:
- Around line 6-9: Update the cross-reference in the self-update test comment to
point from tests/with.rs to tests/suite/with.rs, leaving the surrounding
explanation unchanged.

In `@pnpm/crates/cli/tests/suite/undeprecate.rs`:
- Around line 76-84: Update the validation-only tests
fails_when_package_is_not_provided and fails_when_message_is_provided to pass an
unreachable localhost registry, such as http://localhost:4873/, instead of None
when calling run_undeprecate. Keep their existing assertions and validation
scenarios unchanged.
- Around line 15-19: The duplicated empty_auth_file helper should be centralized
in the shared suite utilities. Add one public empty_auth_file definition to
pnpm/crates/cli/tests/suite/_utils/mod.rs, then remove the local definitions and
use the shared helper in pnpm/crates/cli/tests/suite/undeprecate.rs lines 15-19
and pnpm/crates/cli/tests/suite/team.rs lines 14-18; apply the same replacement
to the other six affected test modules.

In `@pnpm/crates/cli/tests/suite/why.rs`:
- Around line 133-151: Strengthen why_depth_limits_output by asserting both why
command invocations succeed, then compare the outputs to verify depth 1 excludes
content that appears in the unrestricted output. Confirm the command’s depth-1
boundary and use an entry that should be omitted at that depth, while retaining
the existing assertions for the target and direct parent.

---

Nitpick comments:
In `@pnpm/crates/cli/tests/suite/approve_builds.rs`:
- Around line 33-37: Move the shared pacquet constructor from approve_builds.rs
into pnpm/crates/cli/tests/suite/_utils/ and reuse it there, consolidating
equivalent constructors such as auth.rs::pacquet_at, bugs.rs::pacquet_at,
catalog.rs::pacquet, and audit.rs::pacquet_cmd as applicable. In
pnpm/crates/cli/tests/suite/audit.rs lines 1077-1095, move nerf, stdout, stderr,
assert_success, and assert_failure into _utils and update callers; consolidate
the equivalent nerf in dist_tag.rs and preserve the existing
canonicalize/list.rs::canonical relationship without inventing unrelated
changes.

In `@pnpm/crates/cli/tests/suite/cache.rs`:
- Line 10: Replace the repeated literal v11/metadata path construction in the
cache tests, including the import test path, with
cache_dir.join(pacquet_resolving_npm_resolver::mirror::ABBREVIATED_META_DIR).
Update all identified sites while preserving the surrounding test behavior.

In `@pnpm/crates/cli/tests/suite/cat_index.rs`:
- Line 11: Remove the redundant self-rebinding statement let pacquet = pacquet;
from the affected test, leaving the destructured pacquet field available
directly for the remaining test logic.

In `@pnpm/crates/cli/tests/suite/custom_fetchers.rs`:
- Around line 12-23: Move the shared pacquet_at, write_manifest, and
installed_version helpers from custom_fetchers.rs and custom_resolvers.rs into
suite/_utils, exposing them through the existing _utils module declared by
suite/main.rs. Remove the duplicate local definitions and import the shared
helpers in both test modules, preserving their current behavior and signatures.

In `@pnpm/crates/cli/tests/suite/dedupe.rs`:
- Around line 59-60: Extract the repeated
Command::cargo_bin("pnpm").expect(...).with_current_dir(...) construction into a
local helper, such as pacquet_cmd, in the dedupe test module. Add the required
std::path::Path import, define the helper to accept the workspace path, and
replace all seven inline constructions while preserving their existing behavior.
- Around line 269-272: Review the inline NDJSON parsing in the test and reuse
_utils::ndjson_records(&Output) if strict validation of every stderr line is not
required. If the test intentionally requires all stderr lines to be valid JSON,
retain the existing serde_json parsing and expectation unchanged.

In `@pnpm/crates/cli/tests/suite/dist_tag.rs`:
- Around line 626-645: Guard both unreachable-registry tests, rm_refuses_latest
and the test around the later dist-tag case, with the same fetch retry and fetch
timeout environment settings used by
ls_redacts_registry_credentials_on_network_error. Extend or reuse the
appropriate run_dist_tag helper so these tests fail fast if validation
regresses, and invoke the guarded/offline variant at both call sites.
- Around line 50-72: The repeated test setup around CommandTempCwd::init,
mockito::Server, the registry URL, and configure should be extracted into a
small fixture helper returning the workspace, server, and auth file, then reused
by the dist-tag tests while preserving existing setup behavior. This is optional
and may be deferred if it would expand the suite-consolidation scope.

In `@pnpm/crates/cli/tests/suite/dlx.rs`:
- Around line 47-48: Update the doc comments for both Unix-gated dlx tests near
their #[cfg(unix)] attributes to state why they are Unix-only, or replace the
gates with cfg_attr-based Windows ignores carrying that reason. Keep the
existing fixture and regression documentation unchanged.

In `@pnpm/crates/cli/tests/suite/exec_recursive.rs`:
- Around line 12-47: Move write_workspace and summary_statuses from
exec_recursive.rs into suite/_utils/mod.rs, including both the name-list and
manifest-map write_workspace variants, then import and reuse them. Remove the
duplicate summary_statuses from run_recursive.rs; update exec_recursive.rs,
list.rs, and pack_recursive.rs at the specified ranges to delete local helper
definitions and use the shared variants.

In `@pnpm/crates/cli/tests/suite/fetch.rs`:
- Around line 19-22: Update virtual_dep to reuse crate::_utils::slot for
constructing the virtual-store slot instead of duplicating the name
transformation and hard-coded 100.0.0 version; pass the resulting slot into the
existing helper for joining it to the workspace path, using the _utils API for
wrapping an existing workspace path as needed.
- Around line 7-9: Centralize suite test helpers in crate::_utils: in
pnpm/crates/cli/tests/suite/fetch.rs:7-9 and dry_run.rs:14-16, remove each local
pacquet_at and import the shared command builder; in
install_runtimes.rs:615-617, remove command and use that builder. In
exec.rs:8-15, move write_executable into crate::_utils behind #[cfg(unix)], then
update run.rs to use the shared helper.

In `@pnpm/crates/cli/tests/suite/find_hash.rs`:
- Line 45: Replace the pre-assertion println! diagnostics in the find_hash test
suite with eprintln!, including the output statements at both diagnostic
locations, while preserving their existing messages and values.
- Line 65: Update the find-hash test invocation in the relevant test function to
generate the 128-character hexadecimal input programmatically instead of
embedding the long literal, while preserving the existing failure assertion and
argument value.
- Around line 101-106: Move the base64 Engine and STANDARD as BASE64 import from
inside parse_hash to the module-level imports at the top of find_hash.rs,
leaving the hash decoding and encoding logic unchanged.

In `@pnpm/crates/cli/tests/suite/global.rs`:
- Around line 229-230: Replace the target directory constructed from
CARGO_MANIFEST_DIR in the package_dir setup with the guaranteed
CARGO_TARGET_TMPDIR environment value, while preserving the existing
tempfile::tempdir_in behavior.

In `@pnpm/crates/cli/tests/suite/link.rs`:
- Around line 6-16: Extract the repeated setup in the link tests into a
link_fixture() helper that initializes CommandTempCwd, adds the mocked registry,
destructures mock_instance, and writes the standard test-project package.json.
Add a write_target(root, name) helper for creating target directories and
writing their manifests, then update the affected tests to use these helpers
while preserving each test’s variable setup and behavior.
- Around line 41-44: Add the same stderr/error-message assertion used by
link_fails_without_paths to ln_alias_fails_without_paths after checking
output.status, verifying the output contains “You must provide a parameter”
before cleanup.

In `@pnpm/crates/cli/tests/suite/list.rs`:
- Around line 409-430: Update the test helper run_ok to print each rendered
command output with eprintln! using display formatting before returning it, so
all multiline tree assertions—including the listed assert_eq! call sites—show
readable newlines and box-drawing characters on failure. Keep the existing
return value and assertion behavior unchanged.

In `@pnpm/crates/cli/tests/suite/lockfile_resolution_reuse.rs`:
- Line 280: Remove the dbg! calls near the lockfile resolution assertions,
including those referencing lockfile.snapshots and lockfile.packages. Preserve
useful failure diagnostics by incorporating the relevant values into the
assertion messages instead of printing during successful runs.
- Around line 55-63: Extract the duplicated `.npmrc` dead-registry rewrite into
a shared `kill_the_registry(npmrc_path: &Path)` helper next to
`dead_registry_url`. Replace the identical blocks at each affected call site
with this helper, preserving the existing filtering, formatting, and failure
behavior.
- Around line 144-153: Strengthen the test around dead_registry_url and the
second install to verify that no network resolution occurred, rather than
relying solely on the released port being refused. Assert the CLI/install result
or recorded resolution state using the existing test symbols so a reclaimed port
and successful live-server response causes the test to fail.
- Around line 281-306: The lockfile assertions in the test, including the
earlier assertions around lines 66–69 and 221–223, need actionable failure
diagnostics. Replace the bare assert! calls with messages naming whether the
wanted or current lockfile failed and rendering the relevant snapshots,
optional-dependency map, or packages map; remove the dbg!(&workspace) and log
the needed structure through assertion messages instead. Keep the existing
conditions and workspace existence assertion behavior unchanged.
- Around line 15-17: Centralize the shared pacquet_at helper in
pnpm/crates/cli/tests/suite/_utils/mod.rs, remove the local definition from
lockfile_resolution_reuse.rs, and import the shared helper there. In
pnpm/crates/cli/tests/suite/find_hash.rs, replace each inline pnpm Command
construction and current_dir setup at lines 40-41, 63-64, and 108-109 with
pacquet_at(&workspace) calls.
- Around line 408-413: Extract the duplicated manifest timestamp update from the
test flow into a helper such as bump_mtime(path: &Path), and replace both
occurrences near the reused-manifest and corresponding later setup with calls to
it. Keep the existing now-plus-two-seconds timestamp, writable open, set_times,
and failure expectation, and document in the helper why the future mtime is
required.

In `@pnpm/crates/cli/tests/suite/login.rs`:
- Around line 65-67: Update the headless login test in the relevant test
function to read auth.ini after the flow completes and assert that the
cli-headless-token from the done endpoint was stored, matching the verification
pattern used by the logout test; otherwise narrow the doc comment to only
describe the behaviors currently asserted.

In `@pnpm/crates/cli/tests/suite/logout.rs`:
- Around line 48-53: Update the not-logged-in test’s registry argument in the
logout test setup to use the local mockito server URL, matching the first test’s
server configuration, instead of the public npm registry URL. Keep the existing
logout invocation and assertions unchanged.
- Around line 12-14: Update the mock setup in the logout test to construct the
DELETE path using the existing TOKEN constant instead of repeating its literal
value. Keep the endpoint format unchanged so the mock continues matching the
request and mock.assert() remains valid.

In `@pnpm/crates/cli/tests/suite/nested_file_dependencies.rs`:
- Around line 121-128: Replace the byte-level lockfile.contains assertions in
the nested dependency test with parsed-structure checks using
pacquet_lockfile::Lockfile, matching lockfile_resolution_reuse.rs. If exact pnpm
output formatting is intentionally required, retain the assertions and document
that requirement in the test’s doc comment.
- Around line 87-94: Extract the duplicated workspace YAML append logic into
_utils::add_workspace_packages(workspace: &Path, globs: &[&str]), and update
both suite modules to call it while preserving their respective glob values.
Resolve the sibling-module write_manifest name collision by either centralizing
the helpers in _utils or renaming one function to distinguish its input type and
purpose.

In `@pnpm/crates/cli/tests/suite/override_version_references.rs`:
- Around line 102-110: Extract the diagnostic unwrapping logic from the test
suites into a shared unwrap_diagnostic helper in _utils/mod.rs, including
whitespace collapsing and removal of the │ continuation prefix. Replace the
local stderr normalization in override_version_references and the equivalent
logic in package_manager_check with calls to this shared helper.

In `@pnpm/crates/cli/tests/suite/pack.rs`:
- Around line 74-84: Add a second workspace package in the pack test fixture
with its own dependencies, then extend the assertions near the existing
packed-manifest checks to verify those dependencies remain intact. Keep the
existing pkg hook behavior and assertions, ensuring the test exercises both the
matching and non-matching manifest.name branches.

In `@pnpm/crates/cli/tests/suite/package_manager_check.rs`:
- Around line 574-577: Remove the dbg!(&output) call from the command execution
helper after command.args(args).output(), leaving the existing output return and
assert_success/assert_failure diagnostics unchanged.

In `@pnpm/crates/cli/tests/suite/ping.rs`:
- Around line 27-37: Move the shared pacquet_at and empty_auth_file helpers from
the ping test module into the suite’s _utils/mod.rs, preserving their current
behavior and signatures. Update ping.rs and the other suite modules that define
equivalent pacquet or empty_auth_file helpers to import and reuse the
centralized implementations, removing the duplicates.

In `@pnpm/crates/cli/tests/suite/pnpr_install.rs`:
- Around line 284-322: Replace the local workspace helpers in pnpr_install.rs,
including write_workspace_project, replace_workspace_dependency,
read_workspace_lockfile, and read_workspace_current_lockfile, with the shared
WorkspaceFixture from _utils/mod.rs. Add the missing dependency-form helper
there if needed, then update the test to use WorkspaceFixture::project(),
::wanted(), ::current(), importer(), snapshot_entries(), and project
node_modules helpers, preserving the existing fixture behavior.

In `@pnpm/crates/cli/tests/suite/pnpx_alias.rs`:
- Around line 24-26: Update the assertion block in the pnpx alias test to print
both multiline values, pnpx_help and dlx_help, immediately before assert_eq!, so
failures expose readable help output while preserving the existing comparison.

In `@pnpm/crates/cli/tests/suite/prefix.rs`:
- Around line 22-23: Remove the unconditional dbg!(&output) diagnostics from the
affected test cases: prefix.rs lines 22-23 and 82-83, and root.rs lines 24, 45,
and 60. Their existing rendered stdout/stderr assertions provide sufficient
failure diagnostics; leave root_matches_pnpm_from_a_workspace_subdir unchanged.

In `@pnpm/crates/cli/tests/suite/publish.rs`:
- Line 29: Remove the implementation-restating rustdoc comment above the publish
test helper; retain documentation only for public item contracts and do not
replace it with another comment.

In `@pnpm/crates/cli/tests/suite/remove.rs`:
- Line 29: Remove the fixed diagnostic eprintln! calls in the remove test at the
referenced assertions, including the logs near dependency removal and the other
listed locations. Keep the underlying simple scalar equality assertions
unchanged, retaining logging only where it provides meaningful multi-line or
complex-state failure context.

In `@pnpm/crates/cli/tests/suite/restart.rs`:
- Around line 10-11: Use consistent POSIX-shell platform gating for all restart
tests, including restart_runs_stop_restart_start_scripts,
restart_fails_when_stop_script_fails, and
restart_fails_when_restart_script_fails. Replace the silent #[cfg(unix)] gate
with the existing cfg_attr(target_os = "windows", ignore = "...") pattern and
preserve the visible reason describing the POSIX shell dependency.

In `@pnpm/crates/cli/tests/suite/root.rs`:
- Around line 15-17: Remove the duplicate canonicalize helper from root.rs and
reuse the shared helper in _utils/mod.rs for the affected tests, preserving the
existing doc comment that explains the CLI dunce::canonicalize behavior. Update
callers as needed to use the shared PathBuf-returning helper, while retaining
list.rs’s required String conversion behavior.

In `@pnpm/crates/cli/tests/suite/run_recursive.rs`:
- Around line 14-24: Move write_workspace from
pnpm/crates/cli/tests/suite/run_recursive.rs (lines 14-24) into _utils/mod.rs,
keeping it distinct from list.rs::write_workspace, then import it in
run_recursive.rs and publish_recursive.rs (lines 20-30), removing the local
publish_recursive.rs copy. Move write_executable from run_recursive.rs (lines
26-31) into _utils/mod.rs behind #[cfg(unix)], import it in run_recursive.rs and
run.rs, and remove the local run.rs copy.

In `@pnpm/crates/cli/tests/suite/runtime.rs`:
- Around line 6-19: Update the assertions in the reporter loop to include the
current reporter variant in both failure messages. Use the existing reporter
value, including the None case, so failures identify which configuration
produced the unexpected status or stderr.

In `@pnpm/crates/cli/tests/suite/sbom.rs`:
- Around line 828-841: Remove the duplicate test function
sbom_dev_flag_includes_only_dev from the SBOM test suite; retain
sbom_dev_flag_excludes_prod as the single coverage for --dev including the dev
dependency and excluding the production dependency.

In `@pnpm/crates/cli/tests/suite/stale_pin_dedupe.rs`:
- Around line 91-96: In
refreshes_stale_transitive_pin_for_caret_range_direct_dep, add a baseline
lockfile assertion immediately after the first install using manifest version
100.0.0, verifying the initial resolved pin is 100.0.0 before changing the
manifest and running the second install.

In `@pnpm/crates/cli/tests/suite/star_tests.rs`:
- Around line 10-35: Move the shared helpers pacquet_at, empty_auth_file, nerf,
configure, stderr_of, and stdout_of into one public implementation in
pnpm/crates/cli/tests/suite/_utils/mod.rs, preserving caller-specific behavior
such as the fetch-retry environment setting and existing parameters. Update
pnpm/crates/cli/tests/suite/star_tests.rs:10-35, unstar_tests.rs:10-35,
search.rs:14-22, unpublish.rs:26-34, view.rs:29-39, and version.rs:160-162 to
import and use those shared helpers; keep helpers that are not shared private to
their module.

In `@pnpm/crates/cli/tests/suite/store.rs`:
- Around line 65-70: Replace the dbg!(&output) call in the store path test with
eprintln! logging that decodes output.stdout and output.stderr into readable
text before asserting output.status.success(). Keep the existing step logging
and ensure both streams are included in the failure diagnostics.

In `@pnpm/crates/cli/tests/suite/tarball_url_dependency.rs`:
- Around line 106-114: In the tarball URL setup, add an assertion after deriving
the replaced mock URL and before constructing package_key that the tarball URL
does not start with mock_instance.url(). Preserve the existing localhost URL
construction and ensure the test fails loudly if the replacement no longer
produces a non-registry tarball URL.

In `@pnpm/crates/cli/tests/suite/team.rs`:
- Around line 33-35: Replace the hand-rolled argument loops in
pnpm/crates/cli/tests/suite/team.rs lines 33-35 and
pnpm/crates/cli/tests/suite/undeprecate.rs lines 34-36 with chained
.with_args(args) and .with_args(params) calls respectively, then invoke
.output() while preserving the existing command_extra builder chains.

In `@pnpm/crates/cli/tests/suite/update_changeset.rs`:
- Around line 61-65: Update generated_changeset_text to log the generated
changeset string with eprintln! immediately before the existing assert_eq! on
the single generated path, preserving the current assertion and return behavior
so all callers receive readable output on failure.

In `@pnpm/crates/cli/tests/suite/version.rs`:
- Line 16: Remove all four dbg! calls, including dbg!(&output), from the version
test cases in the test module. Keep the existing assertions and rely on their
failure diagnostics for captured output.

In `@pnpm/crates/cli/tests/suite/whoami.rs`:
- Around line 26-34: Move the shared nerf-dart logic from the local helper in
whoami.rs and the matching copies in dist_tag.rs, star_tests.rs, and
unstar_tests.rs into a single public nerf function in the suite _utils module.
Update those four modules to call the shared _utils::nerf, while leaving
audit.rs’s separate mocked-http helper unchanged.

In `@pnpm/crates/cli/tests/suite/why.rs`:
- Around line 303-305: Replace direct lines[0] indexing in the why test
assertions with a fallible first-line accessor that includes {stdout} in the
assertion failure message. Apply the same guard to the corresponding assertions
around lines 333, 358, 384, 408, and 492, preserving each existing
expected-value check.

In `@pnpm/crates/cli/tests/suite/with.rs`:
- Around line 23-26: Remove the dbg!(&output) debug statements from the test
cases in with.rs, including the occurrences near the listed test locations,
while preserving assert_success, assert_current_version, and the existing
assertions.
- Around line 138-142: Replace hardcoded pinned-version values in the with.rs
test setup and assertions with PINNED_PNPM_VERSION, including the "Version
9.3.0" checks and bare "9.3.0" arguments. Preserve the deliberate 9.1.0 literal
used to test a version different from the pinned version.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

@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.

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

🛑 Comments failed to post (4)
pnpm/crates/cli/tests/suite/outdated.rs (1)

55-56: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Confirm that add_mocked_registry writes storeDir/cacheDir into pnpm-workspace.yaml.
set -euo pipefail

fd -t f 'bin.rs' pnpm/crates/testing-utils/src --exec cat -n {}

Repository: pnpm/pnpm

Length of output: 6397


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== locate files =="
fd -t f 'outdated.rs|override_version_references.rs|main.rs' pnpm/crates/cli/tests/suite pnpm/crates/cli/tests 2>/dev/null | sed -n '1,120p'

echo
echo "== outdated.rs snippets around mentioned writes =="
FILE="$(fd -t f '^outdated\.rs$' pnpm/crates/cli/tests/suite | head -n 1)"
if [ -n "${FILE:-}" ]; then
  echo "FILE=$FILE"
  rg -n "pnpm-workspace|packages:|add_mocked_registry|add_overrides|fs::write" "$FILE" -C 4 || true
  sed -n '1,80p;180,310p' "$FILE" | wc -l
  sed -n '1,80p;180,310p' "$FILE"
fi

echo
echo "== override_version_references.rs related snippets =="
FILE="$(fd -t f '^override_version_references\.rs$' pnpm/crates/cli/tests/suite | head -n 1)"
if [ -n "${FILE:-}" ]; then
  echo "FILE=$FILE"
  sed -n '1,80p' "$FILE"
fi

echo
echo "== nearby imports/usages of addWorkspace or helper definitions =="
rg -n "addWorkspace|add_overrides|pnpm-workspace.yaml|packages:" pnpm/crates/cli/tests/suite pnpm/crates/cli/tests/_utils.rs 2>/dev/null | sed -n '1,200p'

Repository: pnpm/pnpm

Length of output: 40739


Append packages: instead of replacing pnpm-workspace.yaml.

add_mocked_registry() writes pnpm-workspace.yaml with per-test storeDir and cacheDir, and override_version_references.rs documents that tests must extend that file. The fs::write(...) calls at outdated.rs:55, 204, 238, and 296-300 drop those settings, so the tests may use a shared default store and become run-order-dependent. Read, append, and re-write the existing YAML, matching the helper used there.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm/crates/cli/tests/suite/outdated.rs` around lines 55 - 56, Update the
workspace-manifest setup in the outdated test cases to read the existing
pnpm-workspace.yaml, append the packages configuration, and write it back
instead of replacing it. Apply this to each fs::write call identified in the
diff, reusing the existing helper pattern and preserving the storeDir and
cacheDir entries created by add_mocked_registry().
pnpm/crates/cli/tests/suite/publish.rs (1)

270-270: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Assert each configured registry request.

A test can currently pass if publishing fails or succeeds before the expected PUT. Retain each mock, set .expect(1), and call mock.assert() after the command assertion.

  • pnpm/crates/cli/tests/suite/publish.rs#L270-L270: Retain the rejection mock and assert that the failing publish reached the registry.
  • pnpm/crates/cli/tests/suite/publish.rs#L301-L301: Retain the JSON-success mock and assert one upload request.
  • pnpm/crates/cli/tests/suite/publish.rs#L322-L322: Retain the reporter-suppression mock and assert one upload request.
📍 Affects 1 file
  • pnpm/crates/cli/tests/suite/publish.rs#L270-L270 (this comment)
  • pnpm/crates/cli/tests/suite/publish.rs#L301-L301
  • pnpm/crates/cli/tests/suite/publish.rs#L322-L322
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm/crates/cli/tests/suite/publish.rs` at line 270, Update the publish tests
in pnpm/crates/cli/tests/suite/publish.rs at lines 270-270, 301-301, and
322-322: retain each registry mock, configure it with an expectation of exactly
one request, and call its assert method after the corresponding command
assertion. Ensure the rejection mock verifies the failing publish reached the
registry, while the JSON-success and reporter-suppression mocks each verify one
upload request.

Source: Path instructions

pnpm/crates/cli/tests/suite/update_changeset.rs (1)

372-387: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Determine whether add_mocked_registry writes storeDir/cacheDir to .npmrc, pnpm-workspace.yaml, or both.
set -euo pipefail

fd -g 'bin.rs' pnpm/crates/testing-utils --exec rg -n -C 10 'add_mocked_registry|storeDir|cacheDir|store_dir|cache_dir|pnpm-workspace.yaml|npmrc' {} \;

Repository: pnpm/pnpm

Length of output: 5631


🏁 Script executed:

#!/bin/bash
# Inspect the target test and nearby isolation setup without executing repository code.
set -euo pipefail

file="pnpm/crates/cli/tests/suite/update_changeset.rs"
sed -n '1,55p;330,405p' "$file"

printf '\n--- related workspace yaml usages ---\n'
rg -n 'fn setup|fs::remove_file\(workspace\.join\("pnpm-workspace.yaml"\)\)|workspace\.join\("pnpm-workspace.yaml"\)|write_manifest\(|write_changeset_config\(' pnpm/crates/cli/tests/suite/update_changeset.rs

Repository: pnpm/pnpm

Length of output: 6431


Do not delete the workspace YAML that carries isolated storeDir/cacheDir.

add_mocked_registry() writes both per-test temp storeDir/cacheDir paths into pnpm-workspace.yaml. This test removes that file before pnpm install, so the command can fall back to the default global store/cache instead of the temporary fixture paths. Replace only the workspace-defining keys from the existing YAML, or rewrite it while preserving storeDir, cacheDir, and enableGlobalVirtualStore: false.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm/crates/cli/tests/suite/update_changeset.rs` around lines 372 - 387, The
test update_changeset_supports_a_package_outside_a_workspace must preserve the
fixture’s isolated store and cache configuration. Replace only the
workspace-defining settings in pnpm-workspace.yaml, or rewrite the file while
retaining storeDir, cacheDir, and enableGlobalVirtualStore: false, instead of
removing the entire YAML before running install.
pnpm/crates/cli/tests/suite/version.rs (1)

115-120: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Confirm every pacquet_version / pacquet_recursive_version call site passes a
# CommandTempCwd workspace whose parent is the temp root.
set -euo pipefail

rg -nP --type=rust -C4 '\bpacquet_(recursive_)?version\s*\(' pnpm/crates/cli/tests/suite/version.rs

Repository: pnpm/pnpm

Length of output: 16432


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== version.rs relevant sections =="
sed -n '80,125p;580,600p' pnpm/crates/cli/tests/suite/version.rs

echo
echo "== CommandTempCwd definitions/usages =="
rg -n --type=rust -C3 'struct CommandTempCwd|impl CommandTempCwd|CommandTempCwd' pnpm/crates/cli/tests/suite pnpm/crates

echo
echo "== test_command occurrences/definition =="
rg -n --type=rust -C3 'fn test_command|test_command\(' pnpm/crates/cli/tests/suite/version.rs

Repository: pnpm/pnpm

Length of output: 50366


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== version.rs relevant sections =="
sed -n '80,125p;580,600p' pnpm/crates/cli/tests/suite/version.rs

echo
echo "== CommandTempCwd definitions and version call-site workspace types =="
rg -n --type=rust -C4 'struct CommandTempCwd|impl CommandTempCwd|type CommandTempCwd|new() -> CommandTempCwd' pnpm/crates/testing-utils crates/testing-utils 2>/dev/null || true
rg -n --type=rust -C3 'let CommandTempCwd |\broot:\s*|workspace:' pnpm/crates/testing-utils pnpm/crates/cli/tests/suite/version.rs | sed -n '1,220p'

echo
echo "== test_command occurrences/definition in version.rs =="
sed -n '80,110p' pnpm/crates/cli/tests/suite/version.rs | cat -n

Repository: pnpm/pnpm

Length of output: 23177


Route pacquet_recursive_version through test_command.

pacquet_version already adds version, while pacquet_recursive_version builds a separate unisolated pnpm command. Both helpers are invoked with root from CommandTempCwd::init(), so pass the temp root through test_command before changing directories and running the command; this keeps these tests from reading the developer’s global npm/pnpm config and avoids duplication.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm/crates/cli/tests/suite/version.rs` around lines 115 - 120, Update
pacquet_recursive_version to use the shared test_command helper with the temp
root from CommandTempCwd::init() before changing directories and invoking pnpm
version, rather than constructing an independent Command. Preserve
pacquet_version’s version argument handling and remove the duplicated unisolated
command setup.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@github-actions

github-actions Bot commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                                            main                                   pr
-----                                            ----                                   --
lockfile/parse_pnpm_lock                         1.00     12.6±1.20ms    29.7 MB/sec    1.02     12.9±0.45ms    29.1 MB/sec
packument/parse                                  1.01     40.3±0.89µs  1646.1 MB/sec    1.00     40.0±0.60µs  1658.9 MB/sec
tarball/download_dependency                      1.04      2.6±0.16ms  1667.8 KB/sec    1.00      2.5±0.08ms  1727.7 KB/sec
tarball_batch/cold_store_many_medium_tarballs    1.00    196.4±7.53ms 81.5 KElem/sec    1.07   209.7±11.04ms 76.3 KElem/sec
workspace_resolution/hoist_heavy                 1.00    266.4±9.35ms        ? ?/sec    1.06    281.1±5.37ms        ? ?/sec

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 658fb59

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@codecov-commenter

codecov-commenter commented Aug 6, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.19%. Comparing base (2ac554b) to head (0287c50).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #13679   +/-   ##
=======================================
  Coverage   88.19%   88.19%           
=======================================
  Files         615      615           
  Lines       99955    99955           
=======================================
  Hits        88160    88160           
  Misses      11795    11795           

☔ 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.

@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: 4

🧹 Nitpick comments (2)
pnpm/crates/cli/tests/suite/sbom.rs (1)

828-841: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Remove this duplicate test.

sbom_dev_flag_includes_only_dev repeats sbom_dev_flag_excludes_prod at lines 426-439. Both copy the with-dev-dependency fixture, both run cyclonedx with --dev, and both assert that typescript is present and is-positive is absent. Only the assertion order differs. The duplicate adds one more CLI invocation to the suite without adding coverage, which works against this PR's build- and runtime-cost goal.

♻️ Proposed removal
-#[test]
-fn sbom_dev_flag_includes_only_dev() {
-    let tmp = copy_fixture("with-dev-dependency");
-    let parsed = run_sbom_json(tmp.path(), "cyclonedx", &["--dev"]);
-    let components = parsed["components"].as_array().expect("components");
-    assert!(
-        components.iter().any(|comp| comp["name"] == "typescript"),
-        "dev dep should be included",
-    );
-    assert!(
-        !components.iter().any(|comp| comp["name"] == "is-positive"),
-        "prod dep should be excluded with --dev",
-    );
-}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm/crates/cli/tests/suite/sbom.rs` around lines 828 - 841, Remove the
duplicate test function sbom_dev_flag_includes_only_dev from the SBOM test
suite; retain sbom_dev_flag_excludes_prod as the single coverage for --dev
including typescript and excluding is-positive.
pnpm/crates/cli/tests/suite/cache.rs (1)

10-12: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Reuse ABBREVIATED_META_DIR for the abbreviated mirror paths.

ABBREVIATED_META_DIR is exported from pacquet_resolving_npm_resolver::mirror and resolves to v11/metadata. Replace the repeated "v11/metadata" literal at each shortened cache_dir site instead of constructing it manually.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm/crates/cli/tests/suite/cache.rs` around lines 10 - 12, Update the cache
directory setup in the test to reuse the exported ABBREVIATED_META_DIR constant
from pacquet_resolving_npm_resolver::mirror instead of manually joining "v11"
and "metadata"; apply the same replacement at each abbreviated cache_dir
construction site.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pnpm/crates/cli/tests/suite/deploy.rs`:
- Around line 352-361: Add pacquet-fs to the CLI crate’s [dev-dependencies] so
the deploy_rejects_linked_target_parent test can directly resolve
pacquet_fs::symlink_dir. Keep the existing normal dependency declaration
unchanged.

In `@pnpm/crates/cli/tests/suite/publish.rs`:
- Around line 18-42: Update the publish test setup around pacquet and publish to
pass the shared empty_auth_file path via --npmrc-auth-file, matching the guard
used by unpublish.rs and bugs.rs. Ensure every publish invocation uses this
empty authentication file so user-level ~/.npmrc settings cannot affect the
tests, while preserving the existing project .npmrc behavior.

In `@pnpm/crates/cli/tests/suite/run_recursive.rs`:
- Around line 112-127: Increase the polling limit in the waits_for_peer
build-script closure so peer startup can exceed the current one-second budget on
loaded CI runners. Keep the existing short sleep, early exit when
../{peer}.started appears, and bounded-loop guard unchanged.

In `@pnpm/crates/cli/tests/suite/sbom.rs`:
- Around line 760-768: Update the test sbom_split_single_project_not_triggered
to pass --split through run_sbom_json while preserving its assertion that a
single-project workspace emits one regular JSON document with a bomFormat field
rather than NDJSON; if the intended contract is instead one NDJSON line, adjust
the assertion and rename the test to match that behavior.

---

Nitpick comments:
In `@pnpm/crates/cli/tests/suite/cache.rs`:
- Around line 10-12: Update the cache directory setup in the test to reuse the
exported ABBREVIATED_META_DIR constant from
pacquet_resolving_npm_resolver::mirror instead of manually joining "v11" and
"metadata"; apply the same replacement at each abbreviated cache_dir
construction site.

In `@pnpm/crates/cli/tests/suite/sbom.rs`:
- Around line 828-841: Remove the duplicate test function
sbom_dev_flag_includes_only_dev from the SBOM test suite; retain
sbom_dev_flag_excludes_prod as the single coverage for --dev including
typescript and excluding is-positive.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 70d9cc1e-ce3e-4fc1-b2cc-ff7de5adcb9f

📥 Commits

Reviewing files that changed from the base of the PR and between f31c7ca and 658fb59.

⛔ Files ignored due to path filters (7)
  • pnpm/crates/cli/tests/suite/snapshots/suite__add__should_install_all_dependencies.snap is excluded by !**/*.snap, !**/*.snap
  • pnpm/crates/cli/tests/suite/snapshots/suite__add__should_symlink_correctly.snap is excluded by !**/*.snap, !**/*.snap
  • pnpm/crates/cli/tests/suite/snapshots/suite__init__should_create_package_json.snap is excluded by !**/*.snap, !**/*.snap
  • pnpm/crates/cli/tests/suite/snapshots/suite__init__should_throw_on_existing_file.snap is excluded by !**/*.snap, !**/*.snap
  • pnpm/crates/cli/tests/suite/snapshots/suite__install__should_install_dependencies.snap is excluded by !**/*.snap, !**/*.snap
  • pnpm/crates/cli/tests/suite/snapshots/suite__install__should_install_exec_files.snap is excluded by !**/*.snap, !**/*.snap
  • pnpm/crates/cli/tests/suite/snapshots/suite__install__should_install_index_files.snap is excluded by !**/*.snap, !**/*.snap
📒 Files selected for processing (117)
  • pnpm/AGENTS.md
  • pnpm/crates/cli/tests/suite/_utils/mod.rs
  • pnpm/crates/cli/tests/suite/add.rs
  • pnpm/crates/cli/tests/suite/approve_builds.rs
  • pnpm/crates/cli/tests/suite/audit.rs
  • pnpm/crates/cli/tests/suite/auth.rs
  • pnpm/crates/cli/tests/suite/bin.rs
  • pnpm/crates/cli/tests/suite/bugs.rs
  • pnpm/crates/cli/tests/suite/bundled_dependencies.rs
  • pnpm/crates/cli/tests/suite/cache.rs
  • pnpm/crates/cli/tests/suite/cat_file.rs
  • pnpm/crates/cli/tests/suite/cat_index.rs
  • pnpm/crates/cli/tests/suite/catalog.rs
  • pnpm/crates/cli/tests/suite/change.rs
  • pnpm/crates/cli/tests/suite/clean.rs
  • pnpm/crates/cli/tests/suite/completion.rs
  • pnpm/crates/cli/tests/suite/config_dependencies.rs
  • pnpm/crates/cli/tests/suite/convergence_overrides.rs
  • pnpm/crates/cli/tests/suite/create.rs
  • pnpm/crates/cli/tests/suite/current_lockfile.rs
  • pnpm/crates/cli/tests/suite/custom_fetchers.rs
  • pnpm/crates/cli/tests/suite/custom_resolvers.rs
  • pnpm/crates/cli/tests/suite/dedupe.rs
  • pnpm/crates/cli/tests/suite/dedupe_direct_deps.rs
  • pnpm/crates/cli/tests/suite/dedupe_injected_deps.rs
  • pnpm/crates/cli/tests/suite/deploy.rs
  • pnpm/crates/cli/tests/suite/deprecate.rs
  • pnpm/crates/cli/tests/suite/dist_tag.rs
  • pnpm/crates/cli/tests/suite/dlx.rs
  • pnpm/crates/cli/tests/suite/docs.rs
  • pnpm/crates/cli/tests/suite/dry_run.rs
  • pnpm/crates/cli/tests/suite/exclude_links_from_lockfile.rs
  • pnpm/crates/cli/tests/suite/exec.rs
  • pnpm/crates/cli/tests/suite/exec_recursive.rs
  • pnpm/crates/cli/tests/suite/fetch.rs
  • pnpm/crates/cli/tests/suite/find_hash.rs
  • pnpm/crates/cli/tests/suite/git_hosted_install.rs
  • pnpm/crates/cli/tests/suite/global.rs
  • pnpm/crates/cli/tests/suite/global_virtual_store.rs
  • pnpm/crates/cli/tests/suite/hoist.rs
  • pnpm/crates/cli/tests/suite/hoisted_node_linker.rs
  • pnpm/crates/cli/tests/suite/import.rs
  • pnpm/crates/cli/tests/suite/init.rs
  • pnpm/crates/cli/tests/suite/inject_workspace_packages.rs
  • pnpm/crates/cli/tests/suite/install.rs
  • pnpm/crates/cli/tests/suite/install_filters.rs
  • pnpm/crates/cli/tests/suite/install_runtimes.rs
  • pnpm/crates/cli/tests/suite/install_state.rs
  • pnpm/crates/cli/tests/suite/install_test.rs
  • pnpm/crates/cli/tests/suite/licenses.rs
  • pnpm/crates/cli/tests/suite/lifecycle_scripts.rs
  • pnpm/crates/cli/tests/suite/link.rs
  • pnpm/crates/cli/tests/suite/list.rs
  • pnpm/crates/cli/tests/suite/local_tarball_dependency.rs
  • pnpm/crates/cli/tests/suite/lockfile_only.rs
  • pnpm/crates/cli/tests/suite/lockfile_resolution_reuse.rs
  • pnpm/crates/cli/tests/suite/lockfile_verification.rs
  • pnpm/crates/cli/tests/suite/login.rs
  • pnpm/crates/cli/tests/suite/logout.rs
  • pnpm/crates/cli/tests/suite/main.rs
  • pnpm/crates/cli/tests/suite/multiple_importers.rs
  • pnpm/crates/cli/tests/suite/named_registry_install.rs
  • pnpm/crates/cli/tests/suite/nested_file_dependencies.rs
  • pnpm/crates/cli/tests/suite/optional_dependencies.rs
  • pnpm/crates/cli/tests/suite/outdated.rs
  • pnpm/crates/cli/tests/suite/override_version_references.rs
  • pnpm/crates/cli/tests/suite/pack.rs
  • pnpm/crates/cli/tests/suite/pack_recursive.rs
  • pnpm/crates/cli/tests/suite/package_manager_check.rs
  • pnpm/crates/cli/tests/suite/patch.rs
  • pnpm/crates/cli/tests/suite/peers.rs
  • pnpm/crates/cli/tests/suite/ping.rs
  • pnpm/crates/cli/tests/suite/pnpm_compatibility.rs
  • pnpm/crates/cli/tests/suite/pnpr_install.rs
  • pnpm/crates/cli/tests/suite/pnpx_alias.rs
  • pnpm/crates/cli/tests/suite/prefix.rs
  • pnpm/crates/cli/tests/suite/prune.rs
  • pnpm/crates/cli/tests/suite/publish.rs
  • pnpm/crates/cli/tests/suite/publish_recursive.rs
  • pnpm/crates/cli/tests/suite/rebuild_recursive.rs
  • pnpm/crates/cli/tests/suite/remove.rs
  • pnpm/crates/cli/tests/suite/repeat_install.rs
  • pnpm/crates/cli/tests/suite/repo.rs
  • pnpm/crates/cli/tests/suite/restart.rs
  • pnpm/crates/cli/tests/suite/root.rs
  • pnpm/crates/cli/tests/suite/run.rs
  • pnpm/crates/cli/tests/suite/run_recursive.rs
  • pnpm/crates/cli/tests/suite/runtime.rs
  • pnpm/crates/cli/tests/suite/sbom.rs
  • pnpm/crates/cli/tests/suite/scope_report.rs
  • pnpm/crates/cli/tests/suite/search.rs
  • pnpm/crates/cli/tests/suite/self_update.rs
  • pnpm/crates/cli/tests/suite/set_script.rs
  • pnpm/crates/cli/tests/suite/side_effects_cache.rs
  • pnpm/crates/cli/tests/suite/stage.rs
  • pnpm/crates/cli/tests/suite/stale_pin_dedupe.rs
  • pnpm/crates/cli/tests/suite/star_tests.rs
  • pnpm/crates/cli/tests/suite/stars_tests.rs
  • pnpm/crates/cli/tests/suite/store.rs
  • pnpm/crates/cli/tests/suite/tarball_url_dependency.rs
  • pnpm/crates/cli/tests/suite/team.rs
  • pnpm/crates/cli/tests/suite/test_command.rs
  • pnpm/crates/cli/tests/suite/undeprecate.rs
  • pnpm/crates/cli/tests/suite/unlink.rs
  • pnpm/crates/cli/tests/suite/unpublish.rs
  • pnpm/crates/cli/tests/suite/unstar_tests.rs
  • pnpm/crates/cli/tests/suite/update.rs
  • pnpm/crates/cli/tests/suite/update_changeset.rs
  • pnpm/crates/cli/tests/suite/update_jsr.rs
  • pnpm/crates/cli/tests/suite/update_recursive.rs
  • pnpm/crates/cli/tests/suite/verify_deps_before_run.rs
  • pnpm/crates/cli/tests/suite/version.rs
  • pnpm/crates/cli/tests/suite/view.rs
  • pnpm/crates/cli/tests/suite/whoami.rs
  • pnpm/crates/cli/tests/suite/why.rs
  • pnpm/crates/cli/tests/suite/with.rs
  • pnpm/crates/cli/tests/suite/workspace_install.rs
💤 Files with no reviewable changes (8)
  • pnpm/crates/cli/tests/suite/_utils/mod.rs
  • pnpm/crates/cli/tests/suite/update_recursive.rs
  • pnpm/crates/cli/tests/suite/update_jsr.rs
  • pnpm/crates/cli/tests/suite/inject_workspace_packages.rs
  • pnpm/crates/cli/tests/suite/install_test.rs
  • pnpm/crates/cli/tests/suite/init.rs
  • pnpm/crates/cli/tests/suite/scope_report.rs
  • pnpm/crates/cli/tests/suite/dedupe_direct_deps.rs
🚧 Files skipped from review as they are similar to previous changes (97)
  • pnpm/crates/cli/tests/suite/licenses.rs
  • pnpm/crates/cli/tests/suite/git_hosted_install.rs
  • pnpm/crates/cli/tests/suite/add.rs
  • pnpm/crates/cli/tests/suite/lifecycle_scripts.rs
  • pnpm/crates/cli/tests/suite/hoist.rs
  • pnpm/crates/cli/tests/suite/workspace_install.rs
  • pnpm/crates/cli/tests/suite/hoisted_node_linker.rs
  • pnpm/crates/cli/tests/suite/optional_dependencies.rs
  • pnpm/crates/cli/tests/suite/install_filters.rs
  • pnpm/crates/cli/tests/suite/config_dependencies.rs
  • pnpm/crates/cli/tests/suite/pnpx_alias.rs
  • pnpm/crates/cli/tests/suite/prune.rs
  • pnpm/crates/cli/tests/suite/dedupe_injected_deps.rs
  • pnpm/crates/cli/tests/suite/named_registry_install.rs
  • pnpm/crates/cli/tests/suite/login.rs
  • pnpm/crates/cli/tests/suite/install.rs
  • pnpm/crates/cli/tests/suite/docs.rs
  • pnpm/crates/cli/tests/suite/update.rs
  • pnpm/crates/cli/tests/suite/override_version_references.rs
  • pnpm/crates/cli/tests/suite/repeat_install.rs
  • pnpm/crates/cli/tests/suite/runtime.rs
  • pnpm/crates/cli/tests/suite/test_command.rs
  • pnpm/crates/cli/tests/suite/lockfile_only.rs
  • pnpm/crates/cli/tests/suite/cat_index.rs
  • pnpm/crates/cli/tests/suite/current_lockfile.rs
  • pnpm/crates/cli/tests/suite/logout.rs
  • pnpm/crates/cli/tests/suite/deprecate.rs
  • pnpm/crates/cli/tests/suite/nested_file_dependencies.rs
  • pnpm/crates/cli/tests/suite/dedupe.rs
  • pnpm/crates/cli/tests/suite/repo.rs
  • pnpm/crates/cli/tests/suite/lockfile_verification.rs
  • pnpm/crates/cli/tests/suite/verify_deps_before_run.rs
  • pnpm/crates/cli/tests/suite/convergence_overrides.rs
  • pnpm/AGENTS.md
  • pnpm/crates/cli/tests/suite/link.rs
  • pnpm/crates/cli/tests/suite/patch.rs
  • pnpm/crates/cli/tests/suite/unstar_tests.rs
  • pnpm/crates/cli/tests/suite/pnpm_compatibility.rs
  • pnpm/crates/cli/tests/suite/root.rs
  • pnpm/crates/cli/tests/suite/exclude_links_from_lockfile.rs
  • pnpm/crates/cli/tests/suite/side_effects_cache.rs
  • pnpm/crates/cli/tests/suite/update_changeset.rs
  • pnpm/crates/cli/tests/suite/tarball_url_dependency.rs
  • pnpm/crates/cli/tests/suite/install_state.rs
  • pnpm/crates/cli/tests/suite/fetch.rs
  • pnpm/crates/cli/tests/suite/bin.rs
  • pnpm/crates/cli/tests/suite/team.rs
  • pnpm/crates/cli/tests/suite/global_virtual_store.rs
  • pnpm/crates/cli/tests/suite/whoami.rs
  • pnpm/crates/cli/tests/suite/main.rs
  • pnpm/crates/cli/tests/suite/bundled_dependencies.rs
  • pnpm/crates/cli/tests/suite/remove.rs
  • pnpm/crates/cli/tests/suite/unlink.rs
  • pnpm/crates/cli/tests/suite/stars_tests.rs
  • pnpm/crates/cli/tests/suite/peers.rs
  • pnpm/crates/cli/tests/suite/catalog.rs
  • pnpm/crates/cli/tests/suite/pack_recursive.rs
  • pnpm/crates/cli/tests/suite/undeprecate.rs
  • pnpm/crates/cli/tests/suite/store.rs
  • pnpm/crates/cli/tests/suite/multiple_importers.rs
  • pnpm/crates/cli/tests/suite/completion.rs
  • pnpm/crates/cli/tests/suite/exec.rs
  • pnpm/crates/cli/tests/suite/search.rs
  • pnpm/crates/cli/tests/suite/find_hash.rs
  • pnpm/crates/cli/tests/suite/dist_tag.rs
  • pnpm/crates/cli/tests/suite/exec_recursive.rs
  • pnpm/crates/cli/tests/suite/stale_pin_dedupe.rs
  • pnpm/crates/cli/tests/suite/cat_file.rs
  • pnpm/crates/cli/tests/suite/view.rs
  • pnpm/crates/cli/tests/suite/approve_builds.rs
  • pnpm/crates/cli/tests/suite/install_runtimes.rs
  • pnpm/crates/cli/tests/suite/dlx.rs
  • pnpm/crates/cli/tests/suite/stage.rs
  • pnpm/crates/cli/tests/suite/rebuild_recursive.rs
  • pnpm/crates/cli/tests/suite/custom_resolvers.rs
  • pnpm/crates/cli/tests/suite/local_tarball_dependency.rs
  • pnpm/crates/cli/tests/suite/outdated.rs
  • pnpm/crates/cli/tests/suite/set_script.rs
  • pnpm/crates/cli/tests/suite/restart.rs
  • pnpm/crates/cli/tests/suite/import.rs
  • pnpm/crates/cli/tests/suite/why.rs
  • pnpm/crates/cli/tests/suite/version.rs
  • pnpm/crates/cli/tests/suite/pnpr_install.rs
  • pnpm/crates/cli/tests/suite/create.rs
  • pnpm/crates/cli/tests/suite/custom_fetchers.rs
  • pnpm/crates/cli/tests/suite/with.rs
  • pnpm/crates/cli/tests/suite/ping.rs
  • pnpm/crates/cli/tests/suite/change.rs
  • pnpm/crates/cli/tests/suite/clean.rs
  • pnpm/crates/cli/tests/suite/list.rs
  • pnpm/crates/cli/tests/suite/publish_recursive.rs
  • pnpm/crates/cli/tests/suite/prefix.rs
  • pnpm/crates/cli/tests/suite/global.rs
  • pnpm/crates/cli/tests/suite/auth.rs
  • pnpm/crates/cli/tests/suite/star_tests.rs
  • pnpm/crates/cli/tests/suite/pack.rs
  • pnpm/crates/cli/tests/suite/run.rs

@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.

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 4

🧹 Nitpick comments (2)
pnpm/crates/cli/tests/suite/sbom.rs (1)

828-841: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Remove this duplicate test.

sbom_dev_flag_includes_only_dev repeats sbom_dev_flag_excludes_prod at lines 426-439. Both copy the with-dev-dependency fixture, both run cyclonedx with --dev, and both assert that typescript is present and is-positive is absent. Only the assertion order differs. The duplicate adds one more CLI invocation to the suite without adding coverage, which works against this PR's build- and runtime-cost goal.

♻️ Proposed removal
-#[test]
-fn sbom_dev_flag_includes_only_dev() {
-    let tmp = copy_fixture("with-dev-dependency");
-    let parsed = run_sbom_json(tmp.path(), "cyclonedx", &["--dev"]);
-    let components = parsed["components"].as_array().expect("components");
-    assert!(
-        components.iter().any(|comp| comp["name"] == "typescript"),
-        "dev dep should be included",
-    );
-    assert!(
-        !components.iter().any(|comp| comp["name"] == "is-positive"),
-        "prod dep should be excluded with --dev",
-    );
-}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm/crates/cli/tests/suite/sbom.rs` around lines 828 - 841, Remove the
duplicate test function sbom_dev_flag_includes_only_dev from the SBOM test
suite; retain sbom_dev_flag_excludes_prod as the single coverage for --dev
including typescript and excluding is-positive.
pnpm/crates/cli/tests/suite/cache.rs (1)

10-12: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Reuse ABBREVIATED_META_DIR for the abbreviated mirror paths.

ABBREVIATED_META_DIR is exported from pacquet_resolving_npm_resolver::mirror and resolves to v11/metadata. Replace the repeated "v11/metadata" literal at each shortened cache_dir site instead of constructing it manually.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm/crates/cli/tests/suite/cache.rs` around lines 10 - 12, Update the cache
directory setup in the test to reuse the exported ABBREVIATED_META_DIR constant
from pacquet_resolving_npm_resolver::mirror instead of manually joining "v11"
and "metadata"; apply the same replacement at each abbreviated cache_dir
construction site.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pnpm/crates/cli/tests/suite/deploy.rs`:
- Around line 352-361: Add pacquet-fs to the CLI crate’s [dev-dependencies] so
the deploy_rejects_linked_target_parent test can directly resolve
pacquet_fs::symlink_dir. Keep the existing normal dependency declaration
unchanged.

In `@pnpm/crates/cli/tests/suite/publish.rs`:
- Around line 18-42: Update the publish test setup around pacquet and publish to
pass the shared empty_auth_file path via --npmrc-auth-file, matching the guard
used by unpublish.rs and bugs.rs. Ensure every publish invocation uses this
empty authentication file so user-level ~/.npmrc settings cannot affect the
tests, while preserving the existing project .npmrc behavior.

In `@pnpm/crates/cli/tests/suite/run_recursive.rs`:
- Around line 112-127: Increase the polling limit in the waits_for_peer
build-script closure so peer startup can exceed the current one-second budget on
loaded CI runners. Keep the existing short sleep, early exit when
../{peer}.started appears, and bounded-loop guard unchanged.

In `@pnpm/crates/cli/tests/suite/sbom.rs`:
- Around line 760-768: Update the test sbom_split_single_project_not_triggered
to pass --split through run_sbom_json while preserving its assertion that a
single-project workspace emits one regular JSON document with a bomFormat field
rather than NDJSON; if the intended contract is instead one NDJSON line, adjust
the assertion and rename the test to match that behavior.

---

Nitpick comments:
In `@pnpm/crates/cli/tests/suite/cache.rs`:
- Around line 10-12: Update the cache directory setup in the test to reuse the
exported ABBREVIATED_META_DIR constant from
pacquet_resolving_npm_resolver::mirror instead of manually joining "v11" and
"metadata"; apply the same replacement at each abbreviated cache_dir
construction site.

In `@pnpm/crates/cli/tests/suite/sbom.rs`:
- Around line 828-841: Remove the duplicate test function
sbom_dev_flag_includes_only_dev from the SBOM test suite; retain
sbom_dev_flag_excludes_prod as the single coverage for --dev including
typescript and excluding is-positive.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 70d9cc1e-ce3e-4fc1-b2cc-ff7de5adcb9f

📥 Commits

Reviewing files that changed from the base of the PR and between f31c7ca and 658fb59.

⛔ Files ignored due to path filters (7)
  • pnpm/crates/cli/tests/suite/snapshots/suite__add__should_install_all_dependencies.snap is excluded by !**/*.snap, !**/*.snap
  • pnpm/crates/cli/tests/suite/snapshots/suite__add__should_symlink_correctly.snap is excluded by !**/*.snap, !**/*.snap
  • pnpm/crates/cli/tests/suite/snapshots/suite__init__should_create_package_json.snap is excluded by !**/*.snap, !**/*.snap
  • pnpm/crates/cli/tests/suite/snapshots/suite__init__should_throw_on_existing_file.snap is excluded by !**/*.snap, !**/*.snap
  • pnpm/crates/cli/tests/suite/snapshots/suite__install__should_install_dependencies.snap is excluded by !**/*.snap, !**/*.snap
  • pnpm/crates/cli/tests/suite/snapshots/suite__install__should_install_exec_files.snap is excluded by !**/*.snap, !**/*.snap
  • pnpm/crates/cli/tests/suite/snapshots/suite__install__should_install_index_files.snap is excluded by !**/*.snap, !**/*.snap
📒 Files selected for processing (117)
  • pnpm/AGENTS.md
  • pnpm/crates/cli/tests/suite/_utils/mod.rs
  • pnpm/crates/cli/tests/suite/add.rs
  • pnpm/crates/cli/tests/suite/approve_builds.rs
  • pnpm/crates/cli/tests/suite/audit.rs
  • pnpm/crates/cli/tests/suite/auth.rs
  • pnpm/crates/cli/tests/suite/bin.rs
  • pnpm/crates/cli/tests/suite/bugs.rs
  • pnpm/crates/cli/tests/suite/bundled_dependencies.rs
  • pnpm/crates/cli/tests/suite/cache.rs
  • pnpm/crates/cli/tests/suite/cat_file.rs
  • pnpm/crates/cli/tests/suite/cat_index.rs
  • pnpm/crates/cli/tests/suite/catalog.rs
  • pnpm/crates/cli/tests/suite/change.rs
  • pnpm/crates/cli/tests/suite/clean.rs
  • pnpm/crates/cli/tests/suite/completion.rs
  • pnpm/crates/cli/tests/suite/config_dependencies.rs
  • pnpm/crates/cli/tests/suite/convergence_overrides.rs
  • pnpm/crates/cli/tests/suite/create.rs
  • pnpm/crates/cli/tests/suite/current_lockfile.rs
  • pnpm/crates/cli/tests/suite/custom_fetchers.rs
  • pnpm/crates/cli/tests/suite/custom_resolvers.rs
  • pnpm/crates/cli/tests/suite/dedupe.rs
  • pnpm/crates/cli/tests/suite/dedupe_direct_deps.rs
  • pnpm/crates/cli/tests/suite/dedupe_injected_deps.rs
  • pnpm/crates/cli/tests/suite/deploy.rs
  • pnpm/crates/cli/tests/suite/deprecate.rs
  • pnpm/crates/cli/tests/suite/dist_tag.rs
  • pnpm/crates/cli/tests/suite/dlx.rs
  • pnpm/crates/cli/tests/suite/docs.rs
  • pnpm/crates/cli/tests/suite/dry_run.rs
  • pnpm/crates/cli/tests/suite/exclude_links_from_lockfile.rs
  • pnpm/crates/cli/tests/suite/exec.rs
  • pnpm/crates/cli/tests/suite/exec_recursive.rs
  • pnpm/crates/cli/tests/suite/fetch.rs
  • pnpm/crates/cli/tests/suite/find_hash.rs
  • pnpm/crates/cli/tests/suite/git_hosted_install.rs
  • pnpm/crates/cli/tests/suite/global.rs
  • pnpm/crates/cli/tests/suite/global_virtual_store.rs
  • pnpm/crates/cli/tests/suite/hoist.rs
  • pnpm/crates/cli/tests/suite/hoisted_node_linker.rs
  • pnpm/crates/cli/tests/suite/import.rs
  • pnpm/crates/cli/tests/suite/init.rs
  • pnpm/crates/cli/tests/suite/inject_workspace_packages.rs
  • pnpm/crates/cli/tests/suite/install.rs
  • pnpm/crates/cli/tests/suite/install_filters.rs
  • pnpm/crates/cli/tests/suite/install_runtimes.rs
  • pnpm/crates/cli/tests/suite/install_state.rs
  • pnpm/crates/cli/tests/suite/install_test.rs
  • pnpm/crates/cli/tests/suite/licenses.rs
  • pnpm/crates/cli/tests/suite/lifecycle_scripts.rs
  • pnpm/crates/cli/tests/suite/link.rs
  • pnpm/crates/cli/tests/suite/list.rs
  • pnpm/crates/cli/tests/suite/local_tarball_dependency.rs
  • pnpm/crates/cli/tests/suite/lockfile_only.rs
  • pnpm/crates/cli/tests/suite/lockfile_resolution_reuse.rs
  • pnpm/crates/cli/tests/suite/lockfile_verification.rs
  • pnpm/crates/cli/tests/suite/login.rs
  • pnpm/crates/cli/tests/suite/logout.rs
  • pnpm/crates/cli/tests/suite/main.rs
  • pnpm/crates/cli/tests/suite/multiple_importers.rs
  • pnpm/crates/cli/tests/suite/named_registry_install.rs
  • pnpm/crates/cli/tests/suite/nested_file_dependencies.rs
  • pnpm/crates/cli/tests/suite/optional_dependencies.rs
  • pnpm/crates/cli/tests/suite/outdated.rs
  • pnpm/crates/cli/tests/suite/override_version_references.rs
  • pnpm/crates/cli/tests/suite/pack.rs
  • pnpm/crates/cli/tests/suite/pack_recursive.rs
  • pnpm/crates/cli/tests/suite/package_manager_check.rs
  • pnpm/crates/cli/tests/suite/patch.rs
  • pnpm/crates/cli/tests/suite/peers.rs
  • pnpm/crates/cli/tests/suite/ping.rs
  • pnpm/crates/cli/tests/suite/pnpm_compatibility.rs
  • pnpm/crates/cli/tests/suite/pnpr_install.rs
  • pnpm/crates/cli/tests/suite/pnpx_alias.rs
  • pnpm/crates/cli/tests/suite/prefix.rs
  • pnpm/crates/cli/tests/suite/prune.rs
  • pnpm/crates/cli/tests/suite/publish.rs
  • pnpm/crates/cli/tests/suite/publish_recursive.rs
  • pnpm/crates/cli/tests/suite/rebuild_recursive.rs
  • pnpm/crates/cli/tests/suite/remove.rs
  • pnpm/crates/cli/tests/suite/repeat_install.rs
  • pnpm/crates/cli/tests/suite/repo.rs
  • pnpm/crates/cli/tests/suite/restart.rs
  • pnpm/crates/cli/tests/suite/root.rs
  • pnpm/crates/cli/tests/suite/run.rs
  • pnpm/crates/cli/tests/suite/run_recursive.rs
  • pnpm/crates/cli/tests/suite/runtime.rs
  • pnpm/crates/cli/tests/suite/sbom.rs
  • pnpm/crates/cli/tests/suite/scope_report.rs
  • pnpm/crates/cli/tests/suite/search.rs
  • pnpm/crates/cli/tests/suite/self_update.rs
  • pnpm/crates/cli/tests/suite/set_script.rs
  • pnpm/crates/cli/tests/suite/side_effects_cache.rs
  • pnpm/crates/cli/tests/suite/stage.rs
  • pnpm/crates/cli/tests/suite/stale_pin_dedupe.rs
  • pnpm/crates/cli/tests/suite/star_tests.rs
  • pnpm/crates/cli/tests/suite/stars_tests.rs
  • pnpm/crates/cli/tests/suite/store.rs
  • pnpm/crates/cli/tests/suite/tarball_url_dependency.rs
  • pnpm/crates/cli/tests/suite/team.rs
  • pnpm/crates/cli/tests/suite/test_command.rs
  • pnpm/crates/cli/tests/suite/undeprecate.rs
  • pnpm/crates/cli/tests/suite/unlink.rs
  • pnpm/crates/cli/tests/suite/unpublish.rs
  • pnpm/crates/cli/tests/suite/unstar_tests.rs
  • pnpm/crates/cli/tests/suite/update.rs
  • pnpm/crates/cli/tests/suite/update_changeset.rs
  • pnpm/crates/cli/tests/suite/update_jsr.rs
  • pnpm/crates/cli/tests/suite/update_recursive.rs
  • pnpm/crates/cli/tests/suite/verify_deps_before_run.rs
  • pnpm/crates/cli/tests/suite/version.rs
  • pnpm/crates/cli/tests/suite/view.rs
  • pnpm/crates/cli/tests/suite/whoami.rs
  • pnpm/crates/cli/tests/suite/why.rs
  • pnpm/crates/cli/tests/suite/with.rs
  • pnpm/crates/cli/tests/suite/workspace_install.rs
💤 Files with no reviewable changes (8)
  • pnpm/crates/cli/tests/suite/_utils/mod.rs
  • pnpm/crates/cli/tests/suite/update_recursive.rs
  • pnpm/crates/cli/tests/suite/update_jsr.rs
  • pnpm/crates/cli/tests/suite/inject_workspace_packages.rs
  • pnpm/crates/cli/tests/suite/install_test.rs
  • pnpm/crates/cli/tests/suite/init.rs
  • pnpm/crates/cli/tests/suite/scope_report.rs
  • pnpm/crates/cli/tests/suite/dedupe_direct_deps.rs
🚧 Files skipped from review as they are similar to previous changes (97)
  • pnpm/crates/cli/tests/suite/licenses.rs
  • pnpm/crates/cli/tests/suite/git_hosted_install.rs
  • pnpm/crates/cli/tests/suite/add.rs
  • pnpm/crates/cli/tests/suite/lifecycle_scripts.rs
  • pnpm/crates/cli/tests/suite/hoist.rs
  • pnpm/crates/cli/tests/suite/workspace_install.rs
  • pnpm/crates/cli/tests/suite/hoisted_node_linker.rs
  • pnpm/crates/cli/tests/suite/optional_dependencies.rs
  • pnpm/crates/cli/tests/suite/install_filters.rs
  • pnpm/crates/cli/tests/suite/config_dependencies.rs
  • pnpm/crates/cli/tests/suite/pnpx_alias.rs
  • pnpm/crates/cli/tests/suite/prune.rs
  • pnpm/crates/cli/tests/suite/dedupe_injected_deps.rs
  • pnpm/crates/cli/tests/suite/named_registry_install.rs
  • pnpm/crates/cli/tests/suite/login.rs
  • pnpm/crates/cli/tests/suite/install.rs
  • pnpm/crates/cli/tests/suite/docs.rs
  • pnpm/crates/cli/tests/suite/update.rs
  • pnpm/crates/cli/tests/suite/override_version_references.rs
  • pnpm/crates/cli/tests/suite/repeat_install.rs
  • pnpm/crates/cli/tests/suite/runtime.rs
  • pnpm/crates/cli/tests/suite/test_command.rs
  • pnpm/crates/cli/tests/suite/lockfile_only.rs
  • pnpm/crates/cli/tests/suite/cat_index.rs
  • pnpm/crates/cli/tests/suite/current_lockfile.rs
  • pnpm/crates/cli/tests/suite/logout.rs
  • pnpm/crates/cli/tests/suite/deprecate.rs
  • pnpm/crates/cli/tests/suite/nested_file_dependencies.rs
  • pnpm/crates/cli/tests/suite/dedupe.rs
  • pnpm/crates/cli/tests/suite/repo.rs
  • pnpm/crates/cli/tests/suite/lockfile_verification.rs
  • pnpm/crates/cli/tests/suite/verify_deps_before_run.rs
  • pnpm/crates/cli/tests/suite/convergence_overrides.rs
  • pnpm/AGENTS.md
  • pnpm/crates/cli/tests/suite/link.rs
  • pnpm/crates/cli/tests/suite/patch.rs
  • pnpm/crates/cli/tests/suite/unstar_tests.rs
  • pnpm/crates/cli/tests/suite/pnpm_compatibility.rs
  • pnpm/crates/cli/tests/suite/root.rs
  • pnpm/crates/cli/tests/suite/exclude_links_from_lockfile.rs
  • pnpm/crates/cli/tests/suite/side_effects_cache.rs
  • pnpm/crates/cli/tests/suite/update_changeset.rs
  • pnpm/crates/cli/tests/suite/tarball_url_dependency.rs
  • pnpm/crates/cli/tests/suite/install_state.rs
  • pnpm/crates/cli/tests/suite/fetch.rs
  • pnpm/crates/cli/tests/suite/bin.rs
  • pnpm/crates/cli/tests/suite/team.rs
  • pnpm/crates/cli/tests/suite/global_virtual_store.rs
  • pnpm/crates/cli/tests/suite/whoami.rs
  • pnpm/crates/cli/tests/suite/main.rs
  • pnpm/crates/cli/tests/suite/bundled_dependencies.rs
  • pnpm/crates/cli/tests/suite/remove.rs
  • pnpm/crates/cli/tests/suite/unlink.rs
  • pnpm/crates/cli/tests/suite/stars_tests.rs
  • pnpm/crates/cli/tests/suite/peers.rs
  • pnpm/crates/cli/tests/suite/catalog.rs
  • pnpm/crates/cli/tests/suite/pack_recursive.rs
  • pnpm/crates/cli/tests/suite/undeprecate.rs
  • pnpm/crates/cli/tests/suite/store.rs
  • pnpm/crates/cli/tests/suite/multiple_importers.rs
  • pnpm/crates/cli/tests/suite/completion.rs
  • pnpm/crates/cli/tests/suite/exec.rs
  • pnpm/crates/cli/tests/suite/search.rs
  • pnpm/crates/cli/tests/suite/find_hash.rs
  • pnpm/crates/cli/tests/suite/dist_tag.rs
  • pnpm/crates/cli/tests/suite/exec_recursive.rs
  • pnpm/crates/cli/tests/suite/stale_pin_dedupe.rs
  • pnpm/crates/cli/tests/suite/cat_file.rs
  • pnpm/crates/cli/tests/suite/view.rs
  • pnpm/crates/cli/tests/suite/approve_builds.rs
  • pnpm/crates/cli/tests/suite/install_runtimes.rs
  • pnpm/crates/cli/tests/suite/dlx.rs
  • pnpm/crates/cli/tests/suite/stage.rs
  • pnpm/crates/cli/tests/suite/rebuild_recursive.rs
  • pnpm/crates/cli/tests/suite/custom_resolvers.rs
  • pnpm/crates/cli/tests/suite/local_tarball_dependency.rs
  • pnpm/crates/cli/tests/suite/outdated.rs
  • pnpm/crates/cli/tests/suite/set_script.rs
  • pnpm/crates/cli/tests/suite/restart.rs
  • pnpm/crates/cli/tests/suite/import.rs
  • pnpm/crates/cli/tests/suite/why.rs
  • pnpm/crates/cli/tests/suite/version.rs
  • pnpm/crates/cli/tests/suite/pnpr_install.rs
  • pnpm/crates/cli/tests/suite/create.rs
  • pnpm/crates/cli/tests/suite/custom_fetchers.rs
  • pnpm/crates/cli/tests/suite/with.rs
  • pnpm/crates/cli/tests/suite/ping.rs
  • pnpm/crates/cli/tests/suite/change.rs
  • pnpm/crates/cli/tests/suite/clean.rs
  • pnpm/crates/cli/tests/suite/list.rs
  • pnpm/crates/cli/tests/suite/publish_recursive.rs
  • pnpm/crates/cli/tests/suite/prefix.rs
  • pnpm/crates/cli/tests/suite/global.rs
  • pnpm/crates/cli/tests/suite/auth.rs
  • pnpm/crates/cli/tests/suite/star_tests.rs
  • pnpm/crates/cli/tests/suite/pack.rs
  • pnpm/crates/cli/tests/suite/run.rs
🛑 Comments failed to post (4)
pnpm/crates/cli/tests/suite/deploy.rs (1)

352-361: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Check the pacquet-fs dev-dependency and the symlink_dir signature.
set -euo pipefail

fd -t f 'Cargo.toml' crates/cli | xargs rg -n -A30 '\[dev-dependencies\]'
fd -t f -e rs . crates/fs | xargs ast-grep run --pattern 'pub fn symlink_dir($$$) { $$$ }' --lang rust

Repository: pnpm/pnpm

Length of output: 30427


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== CLI Cargo manifests =="
git ls-files 'pnpm/crates/cli/**/Cargo.toml'

echo
echo "== CLI pnpm/fs references in tests =="
rg -n "pacquet_fs|symlink_dir|symlink_file|pacquet.*fs|pacquet-fs" pnpm/crates/cli pnpm/crates/fs --glob '*.rs' --glob '*.toml' || true

echo
echo "== CLI dev-deps section =="
sed -n '105,135p' pnpm/crates/cli/Cargo.toml

echo
echo "== fs symlink_dir definitions/usages =="
rg -n "pub fn symlink_dir|symlink_dir\(" pnpm/crates/fs --glob '*.rs'
fd -t f -e rs . pnpm/crates/fs | xargs rg -n "symlink_dir"

Repository: pnpm/pnpm

Length of output: 19899


Add pacquet-fs as a CLI test dependency.

pacquet_fs::symlink_dir is used in pnpm/crates/cli/tests/suite/deploy.rs, but pnpm/crates/cli/Cargo.toml only adds pacquet-fs under normal dependencies; the suite is outside src and only gains it by transitive test resolution. Add it to [dev-dependencies] so the Windows symlink setup is explicitly available to the test target.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm/crates/cli/tests/suite/deploy.rs` around lines 352 - 361, Add pacquet-fs
to the CLI crate’s [dev-dependencies] so the deploy_rejects_linked_target_parent
test can directly resolve pacquet_fs::symlink_dir. Keep the existing normal
dependency declaration unchanged.
pnpm/crates/cli/tests/suite/publish.rs (1)

18-42: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Isolate these tests from the developer's ~/.npmrc.

pacquet clears the CI and OIDC variables, but nothing stops the CLI from reading the caller's real ~/.npmrc. write_project only writes a project-level .npmrc. A user file that carries //<host>/:_authToken, always-auth, or similar settings therefore changes what the publish requests send, and results differ between machines.

Sibling modules added in this PR already guard against this. unpublish.rs passes --npmrc-auth-file pointing at an empty file and documents the reason at lines 12-13; bugs.rs uses the same empty_auth_file helper. Apply the same guard here so all 12 publish tests stay host-independent.

🛡️ Proposed guard, matching `unpublish.rs`
 fn pacquet(workspace: &Path) -> Command {
     Command::cargo_bin("pnpm")
         .expect("find the pnpm binary")
         .with_current_dir(workspace)
+        .with_arg("--npmrc-auth-file")
+        .with_arg(empty_auth_file(workspace))
         .without_env("GITHUB_ACTIONS")
         .without_env("GITLAB_CI")
         .without_env("NPM_ID_TOKEN")
         .without_env("ACTIONS_ID_TOKEN_REQUEST_TOKEN")
         .without_env("ACTIONS_ID_TOKEN_REQUEST_URL")
 }
+
+fn empty_auth_file(workspace: &Path) -> PathBuf {
+    let auth_file = workspace.join("auth-npmrc");
+    fs::write(&auth_file, "").expect("write empty auth .npmrc");
+    auth_file
+}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

fn pacquet(workspace: &Path) -> Command {
    Command::cargo_bin("pnpm")
        .expect("find the pnpm binary")
        .with_current_dir(workspace)
        .with_arg("--npmrc-auth-file")
        .with_arg(empty_auth_file(workspace))
        .without_env("GITHUB_ACTIONS")
        .without_env("GITLAB_CI")
        .without_env("NPM_ID_TOKEN")
        .without_env("ACTIONS_ID_TOKEN_REQUEST_TOKEN")
        .without_env("ACTIONS_ID_TOKEN_REQUEST_URL")
}

fn empty_auth_file(workspace: &Path) -> PathBuf {
    let auth_file = workspace.join("auth-npmrc");
    fs::write(&auth_file, "").expect("write empty auth .npmrc");
    auth_file
}

/// Run `pacquet publish --no-git-checks` in `workspace` with `args` appended.
fn publish(workspace: &Path, args: &[&str]) -> std::process::Output {
    pacquet(workspace)
        .with_arg("publish")
        .with_arg("--no-git-checks")
        .with_args(args)
        .output()
        .expect("spawn pacquet publish")
}

fn write_project(dir: &Path, registry: &str, manifest: &Value) {
    fs::write(dir.join(".npmrc"), format!("registry={registry}\n")).expect("write .npmrc");
    fs::write(dir.join("package.json"), manifest.to_string()).expect("write package.json");
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm/crates/cli/tests/suite/publish.rs` around lines 18 - 42, Update the
publish test setup around pacquet and publish to pass the shared empty_auth_file
path via --npmrc-auth-file, matching the guard used by unpublish.rs and bugs.rs.
Ensure every publish invocation uses this empty authentication file so
user-level ~/.npmrc settings cannot affect the tests, while preserving the
existing project .npmrc behavior.
pnpm/crates/cli/tests/suite/run_recursive.rs (1)

112-127: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Raise the peer-wait budget to reduce false failures.

The build script polls for the peer marker at most 100 times with sleep 0.01, so it gives up after about one second and then fails at test -f ../{peer}.started. Under --parallel both scripts normally start together, but on a loaded CI runner the second sh process can take longer than one second to spawn. The test then reports a failure even though the runner behaved correctly.

A larger cap does not slow the passing path, because the loop exits as soon as the peer marker appears. It only extends the timeout on the failing path, and it keeps the guard that prevents an unbounded wait if parallelism regresses.

🔧 Proposed change
-                     while [ ! -f ../{peer}.started ] && [ \"$attempts\" -lt 100 ]; do \
+                     while [ ! -f ../{peer}.started ] && [ \"$attempts\" -lt 3000 ]; do \
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

    let waits_for_peer = |name: &str, peer: &str| {
        json!({
            "name": name,
            "version": "1.0.0",
            "scripts": {
                "build": format!(
                    "touch ../{name}.started; \
                     attempts=0; \
                     while [ ! -f ../{peer}.started ] && [ \"$attempts\" -lt 3000 ]; do \
                       sleep 0.01; attempts=$((attempts + 1)); \
                     done; \
                     test -f ../{peer}.started"
                ),
            },
        })
    };
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm/crates/cli/tests/suite/run_recursive.rs` around lines 112 - 127,
Increase the polling limit in the waits_for_peer build-script closure so peer
startup can exceed the current one-second budget on loaded CI runners. Keep the
existing short sleep, early exit when ../{peer}.started appears, and
bounded-loop guard unchanged.
pnpm/crates/cli/tests/suite/sbom.rs (1)

760-768: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

This test does not exercise the behavior its name claims.

sbom_split_single_project_not_triggered never passes --split. It runs a plain cyclonedx report and asserts that bomFormat is a string, which sbom_cyclonedx_basic at lines 60-77 already covers. As written it cannot detect a regression in split suppression for a single-project workspace.

Add --split so the test proves that a single project still produces one regular JSON document rather than NDJSON.

💚 Proposed fix
 fn sbom_split_single_project_not_triggered() {
     let tmp = copy_fixture("simple-sbom");
-    let parsed = run_sbom_json(tmp.path(), "cyclonedx", &[]);
+    let parsed = run_sbom_json(tmp.path(), "cyclonedx", &["--split"]);
     assert!(
         parsed["bomFormat"].is_string(),
         "single project should produce regular JSON, not NDJSON",
     );
 }

Confirm the expected behavior first: if --split on a single project is meant to emit one NDJSON line instead, assert that shape and rename the test accordingly.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

#[test]
fn sbom_split_single_project_not_triggered() {
    let tmp = copy_fixture("simple-sbom");
    let parsed = run_sbom_json(tmp.path(), "cyclonedx", &["--split"]);
    assert!(
        parsed["bomFormat"].is_string(),
        "single project should produce regular JSON, not NDJSON",
    );
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm/crates/cli/tests/suite/sbom.rs` around lines 760 - 768, Update the test
sbom_split_single_project_not_triggered to pass --split through run_sbom_json
while preserving its assertion that a single-project workspace emits one regular
JSON document with a bomFormat field rather than NDJSON; if the intended
contract is instead one NDJSON line, adjust the assertion and rename the test to
match that behavior.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: 658fb59d59e6

Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm. Bencher consumes pacquet@HEAD and pnpr@HEAD.

The tables below show mean ± σ; Bencher thresholds on the minimum latency, which is far less perturbed by shared-runner contention (noise only adds time).

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.518 ± 0.152 2.368 2.754 1.72 ± 0.16
pacquet@main 2.588 ± 0.146 2.374 2.782 1.77 ± 0.16
pnpr@HEAD 1.463 ± 0.104 1.360 1.701 1.00
pnpr@main 1.542 ± 0.158 1.368 1.781 1.05 ± 0.13
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.51819577694,
      "stddev": 0.1517815274340897,
      "median": 2.43758616224,
      "user": 1.6713775199999996,
      "system": 1.38351138,
      "min": 2.36835018424,
      "max": 2.75385407424,
      "times": [
        2.42002004624,
        2.60331912824,
        2.45433159324,
        2.42084073124,
        2.37102299324,
        2.36835018424,
        2.74823793524,
        2.6312498082399998,
        2.75385407424,
        2.41073127524
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.58798501364,
      "stddev": 0.14569623789744474,
      "median": 2.6371280497400003,
      "user": 1.63148692,
      "system": 1.32842128,
      "min": 2.37399357824,
      "max": 2.7824556662399997,
      "times": [
        2.5580319772399998,
        2.62896112124,
        2.73360359624,
        2.64529497824,
        2.3978172992399998,
        2.67340779124,
        2.41490916224,
        2.7824556662399997,
        2.37399357824,
        2.67137496624
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.46281337534,
      "stddev": 0.10449543214353586,
      "median": 1.4299230292399998,
      "user": 1.14164772,
      "system": 1.16773568,
      "min": 1.36018944524,
      "max": 1.70095078424,
      "times": [
        1.57283283424,
        1.42913690924,
        1.70095078424,
        1.43070914924,
        1.36018944524,
        1.50300244824,
        1.44587706024,
        1.36994916024,
        1.39846302824,
        1.41702293424
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.5420349345399997,
      "stddev": 0.1578072003135907,
      "median": 1.50703574524,
      "user": 1.14725002,
      "system": 1.20511228,
      "min": 1.36772940424,
      "max": 1.78148504324,
      "times": [
        1.5282086212400001,
        1.78148504324,
        1.73752086224,
        1.75201715224,
        1.36772940424,
        1.43091258324,
        1.48586286924,
        1.52900117324,
        1.4071865852399998,
        1.40042505124
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 300.2 ± 19.4 272.1 344.8 1.02 ± 0.09
pacquet@main 302.7 ± 11.3 290.2 328.6 1.03 ± 0.07
pnpr@HEAD 294.9 ± 16.0 273.7 320.9 1.00
pnpr@main 321.1 ± 8.8 301.5 335.0 1.09 ± 0.07
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.30018504604000007,
      "stddev": 0.01938268348058227,
      "median": 0.29917613094,
      "user": 0.26122626,
      "system": 0.58436354,
      "min": 0.27214592744,
      "max": 0.34482274444,
      "times": [
        0.29054345644,
        0.30145471844,
        0.27214592744,
        0.28593569543999997,
        0.30111341644,
        0.29723884544,
        0.30390564044,
        0.29067994244,
        0.34482274444,
        0.31401007344
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.30267966694,
      "stddev": 0.011267448217020934,
      "median": 0.30023106594,
      "user": 0.25956345999999997,
      "system": 0.59116614,
      "min": 0.29021379544,
      "max": 0.32864827744,
      "times": [
        0.29785309144,
        0.32864827744,
        0.30743102344,
        0.30354487144,
        0.31175759444,
        0.30260904044,
        0.29619660344,
        0.29384512944,
        0.29469724244,
        0.29021379544
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.29492161884,
      "stddev": 0.016039172098978673,
      "median": 0.29847486594,
      "user": 0.25302286000000007,
      "system": 0.55446314,
      "min": 0.27374409544,
      "max": 0.32090015844,
      "times": [
        0.32090015844,
        0.30844679444,
        0.29755315644,
        0.29939657544,
        0.30773907444,
        0.30344479244,
        0.27374409544,
        0.27622935144,
        0.28003326944,
        0.28172892044
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.32114295444,
      "stddev": 0.008764850453211832,
      "median": 0.32100155394,
      "user": 0.26337636,
      "system": 0.6072133399999998,
      "min": 0.30145007944,
      "max": 0.33500755344,
      "times": [
        0.31878629044,
        0.30145007944,
        0.32137633444,
        0.32829333144,
        0.33500755344,
        0.32062677344,
        0.32739854644,
        0.31943953044,
        0.31764163744,
        0.32140946744
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.701 ± 0.023 2.663 2.729 1.73 ± 0.16
pacquet@main 2.646 ± 0.066 2.577 2.811 1.70 ± 0.16
pnpr@HEAD 1.638 ± 0.124 1.454 1.841 1.05 ± 0.13
pnpr@main 1.557 ± 0.143 1.425 1.884 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.70134801924,
      "stddev": 0.022680929070496857,
      "median": 2.69690486994,
      "user": 1.7297300599999996,
      "system": 1.49849456,
      "min": 2.66271803344,
      "max": 2.72942653044,
      "times": [
        2.72556362744,
        2.72934485244,
        2.66271803344,
        2.69822886644,
        2.7126100064400003,
        2.6914807984399998,
        2.72942653044,
        2.69226221844,
        2.67626438544,
        2.69558087344
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.6462468558400003,
      "stddev": 0.06634463214952269,
      "median": 2.62239874544,
      "user": 1.6060995599999999,
      "system": 1.36917206,
      "min": 2.57682577944,
      "max": 2.81116083244,
      "times": [
        2.68595451944,
        2.63062097744,
        2.61417651344,
        2.57682577944,
        2.81116083244,
        2.60282404044,
        2.6400369764400002,
        2.61365985144,
        2.6140306194400003,
        2.67317844844
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.6377730084400004,
      "stddev": 0.12432597665946137,
      "median": 1.62532734644,
      "user": 1.1042830600000002,
      "system": 1.22533656,
      "min": 1.4543677984399999,
      "max": 1.84105053344,
      "times": [
        1.64599661844,
        1.73216095044,
        1.5590436624400001,
        1.84105053344,
        1.4543677984399999,
        1.59725271844,
        1.70949871744,
        1.75865974244,
        1.47504126844,
        1.60465807444
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.55702978814,
      "stddev": 0.14299262618199335,
      "median": 1.51474277344,
      "user": 1.10814816,
      "system": 1.2105525599999998,
      "min": 1.4247780404400001,
      "max": 1.88444667144,
      "times": [
        1.88444667144,
        1.50674402244,
        1.54845211144,
        1.46786818144,
        1.45752765344,
        1.4247780404400001,
        1.43384482044,
        1.64595782544,
        1.6779370304399999,
        1.52274152444
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 401.0 ± 13.7 379.5 426.7 1.29 ± 0.05
pacquet@main 389.4 ± 13.3 367.6 413.9 1.25 ± 0.05
pnpr@HEAD 311.5 ± 4.6 306.3 321.5 1.00
pnpr@main 329.5 ± 17.0 314.8 372.7 1.06 ± 0.06
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.40099083384,
      "stddev": 0.013716043045528852,
      "median": 0.39982936944,
      "user": 0.5210368400000001,
      "system": 0.7013001,
      "min": 0.37945942544,
      "max": 0.42671441244,
      "times": [
        0.40204921144,
        0.39614091444000005,
        0.40246094644,
        0.39674716444,
        0.41307814344000005,
        0.41096702144,
        0.42671441244,
        0.39760952744,
        0.38468157144000004,
        0.37945942544
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.38939846934000005,
      "stddev": 0.013268750848663786,
      "median": 0.38904664944,
      "user": 0.5145501400000001,
      "system": 0.6654821999999999,
      "min": 0.36762901344000004,
      "max": 0.41390826944000003,
      "times": [
        0.40183812844,
        0.38741183044000005,
        0.36762901344000004,
        0.37992161044,
        0.39149750144,
        0.39784630444,
        0.37583873644000004,
        0.38991548744000004,
        0.41390826944000003,
        0.38817781144
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.31150576374,
      "stddev": 0.004611122083546097,
      "median": 0.31153853344000004,
      "user": 0.20668883999999998,
      "system": 0.5319798,
      "min": 0.30629511644,
      "max": 0.32152895244,
      "times": [
        0.31268683244,
        0.31243596044,
        0.31496029544000004,
        0.32152895244,
        0.31048545344,
        0.31064110644000004,
        0.30676850744,
        0.30629511644,
        0.31264999244,
        0.30660542044
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.32950700464000005,
      "stddev": 0.01697224701050604,
      "median": 0.32592075394,
      "user": 0.21390203999999996,
      "system": 0.5697162,
      "min": 0.31480281944,
      "max": 0.37269016744,
      "times": [
        0.37269016744,
        0.32263320944,
        0.31669310244000004,
        0.33929222444,
        0.32392153044,
        0.33049214244,
        0.32791997744,
        0.31480281944,
        0.33012742744,
        0.31649744544
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.788 ± 0.057 1.737 1.873 5.45 ± 0.41
pacquet@main 1.768 ± 0.065 1.725 1.943 5.39 ± 0.42
pnpr@HEAD 0.340 ± 0.020 0.310 0.381 1.04 ± 0.09
pnpr@main 0.328 ± 0.022 0.298 0.385 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.7879130480199996,
      "stddev": 0.057314736057778405,
      "median": 1.75440102452,
      "user": 0.8234783999999999,
      "system": 0.81000816,
      "min": 1.7374494405199998,
      "max": 1.87265129652,
      "times": [
        1.83009494052,
        1.87265129652,
        1.87056134452,
        1.75878436752,
        1.74303407952,
        1.74259414152,
        1.75001768152,
        1.73760878052,
        1.8363344075199999,
        1.7374494405199998
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.7679818749199996,
      "stddev": 0.06451525033374737,
      "median": 1.74648118502,
      "user": 0.7867354000000001,
      "system": 0.7721836599999998,
      "min": 1.7250355875199999,
      "max": 1.9434121865199998,
      "times": [
        1.7473665615199998,
        1.7573319455199998,
        1.7595611895199998,
        1.74005973552,
        1.74559580852,
        1.73857900352,
        1.7250355875199999,
        1.72981943052,
        1.79305730052,
        1.9434121865199998
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.34025543122,
      "stddev": 0.01972673965375841,
      "median": 0.33969772052,
      "user": 0.23786789999999997,
      "system": 0.57927696,
      "min": 0.30978950952,
      "max": 0.38082953152000004,
      "times": [
        0.34702440752,
        0.35808726652000006,
        0.33944546652,
        0.38082953152000004,
        0.34491297552000005,
        0.33157601852,
        0.33994997452000003,
        0.30978950952,
        0.32928126852,
        0.32165789352
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.32797698392,
      "stddev": 0.022390614096372212,
      "median": 0.32410999802000007,
      "user": 0.23962509999999998,
      "system": 0.53750006,
      "min": 0.29847540952,
      "max": 0.38460499652,
      "times": [
        0.32141587852000003,
        0.32482636652,
        0.29847540952,
        0.31902462852,
        0.32378031752,
        0.31436447852000005,
        0.32443967852000005,
        0.38460499652,
        0.33310804052000004,
        0.33573004452000005
      ]
    }
  ]
}

Scenario: Isolated linker: fresh resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 180.4 ± 2.3 176.4 183.3 2.05 ± 0.05
pacquet@main 181.1 ± 4.7 176.1 195.1 2.06 ± 0.07
pnpr@HEAD 87.8 ± 1.8 85.1 93.2 1.00
pnpr@main 88.0 ± 1.8 85.3 93.6 1.00 ± 0.03
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.18041111790000006,
      "stddev": 0.0022690072632843054,
      "median": 0.18077689840000002,
      "user": 0.1633083025,
      "system": 0.07067264250000002,
      "min": 0.17636840290000003,
      "max": 0.18327227490000003,
      "times": [
        0.18063194590000003,
        0.18157985990000003,
        0.18324609390000002,
        0.18286001790000003,
        0.18260895590000004,
        0.17849359090000003,
        0.17904745390000001,
        0.18271682790000002,
        0.17844904690000002,
        0.18131321790000002,
        0.17970314690000003,
        0.18092185090000001,
        0.17847277190000002,
        0.18327227490000003,
        0.17636840290000003,
        0.17689242790000004
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.18106205816666668,
      "stddev": 0.004715229284534444,
      "median": 0.18017692890000003,
      "user": 0.16192104000000002,
      "system": 0.07283194666666667,
      "min": 0.17608890590000004,
      "max": 0.19509571290000002,
      "times": [
        0.19509571290000002,
        0.18365660590000002,
        0.18194514690000002,
        0.17839343290000004,
        0.17918552390000003,
        0.18018331190000003,
        0.17608890590000004,
        0.17902341990000004,
        0.18581667190000004,
        0.17658545990000002,
        0.1784103549,
        0.18062041390000003,
        0.18310461890000002,
        0.18017692890000003,
        0.17764436390000002
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.08780246627499999,
      "stddev": 0.0017955188041171761,
      "median": 0.08737790640000001,
      "user": 0.020386239999999996,
      "system": 0.01048892375,
      "min": 0.0851072189,
      "max": 0.09318658190000001,
      "times": [
        0.08797768090000001,
        0.0873992309,
        0.08780395290000001,
        0.0858119549,
        0.08937379790000001,
        0.0851072189,
        0.08786196190000001,
        0.0868971179,
        0.0866392109,
        0.0875310789,
        0.0886085769,
        0.0871170509,
        0.0879154729,
        0.0864744709,
        0.0871565549,
        0.08740379990000001,
        0.0869266719,
        0.08722688690000001,
        0.08724673590000001,
        0.0873109449,
        0.0862936309,
        0.08637487390000001,
        0.0908592329,
        0.08735658190000001,
        0.0866128609,
        0.08755962390000001,
        0.08595860990000001,
        0.0885306399,
        0.09162625690000001,
        0.0917782319,
        0.09318658190000001,
        0.0877514239
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.08800934396250001,
      "stddev": 0.0018366392394116955,
      "median": 0.08793167290000001,
      "user": 0.019273677499999996,
      "system": 0.01170523625,
      "min": 0.0852931579,
      "max": 0.09357236890000001,
      "times": [
        0.0871699299,
        0.0859976949,
        0.0866637869,
        0.0883916589,
        0.0912577829,
        0.0877793469,
        0.0881716149,
        0.0859727569,
        0.0865584709,
        0.0871125319,
        0.0879461299,
        0.0879164149,
        0.09357236890000001,
        0.0899961179,
        0.08838584790000001,
        0.0852931579,
        0.0879172159,
        0.08625293390000001,
        0.0894135929,
        0.0860666929,
        0.0880442449,
        0.0861766409,
        0.08818683490000001,
        0.0881956899,
        0.0856707189,
        0.08878309590000001,
        0.0869625299,
        0.0908235149,
        0.0885522219,
        0.0898197659,
        0.08688157690000001,
        0.0903661239
      ]
    }
  ]
}

Scenario: Isolated linker: peer-heavy resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 855.5 ± 239.0 436.3 1245.9 1.24 ± 0.40
pacquet@main 692.0 ± 114.6 550.3 902.6 1.00
pnpm@HEAD 3140.4 ± 185.5 2893.1 3516.6 4.54 ± 0.80
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.8554652998555556,
      "stddev": 0.2389843631663105,
      "median": 0.8569416843000001,
      "user": 0.7998396999999999,
      "system": 0.1701132844444444,
      "min": 0.4363080243,
      "max": 1.2459300172999999,
      "times": [
        1.1493917302999999,
        0.8569416843000001,
        0.8800417223000001,
        0.7204913853000001,
        1.2459300172999999,
        0.8048609633000001,
        0.7148960063,
        0.8903261653000001,
        0.4363080243
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.6919944265222223,
      "stddev": 0.11462376002034243,
      "median": 0.6667209053,
      "user": 0.6443653666666666,
      "system": 0.11106017333333333,
      "min": 0.5502561013,
      "max": 0.9025693333000001,
      "times": [
        0.7869290323000001,
        0.5532469393,
        0.5502561013,
        0.7459842943000001,
        0.6621650723000001,
        0.6667209053,
        0.6180529753,
        0.9025693333000001,
        0.7420251853000001
      ]
    },
    {
      "command": "pnpm@HEAD",
      "mean": 3.1404051469666667,
      "stddev": 0.1854873416797178,
      "median": 3.1585597493,
      "user": 4.709255477777777,
      "system": 0.30680117333333334,
      "min": 2.8930866093,
      "max": 3.5166024533,
      "times": [
        3.5166024533,
        3.2435896423,
        3.1585597493,
        3.1062471263,
        3.0471330743,
        3.1723357843,
        3.2021897892999998,
        2.9239020943,
        2.8930866093
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.551 ± 0.133 4.442 4.889 1.27 ± 0.04
pacquet@main 4.687 ± 0.172 4.531 4.986 1.31 ± 0.05
pnpr@HEAD 3.633 ± 0.129 3.483 3.891 1.01 ± 0.04
pnpr@main 3.583 ± 0.064 3.499 3.671 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.55135032052,
      "stddev": 0.13306746229094102,
      "median": 4.50106080682,
      "user": 1.8546511199999998,
      "system": 1.40834152,
      "min": 4.44235169982,
      "max": 4.88866774482,
      "times": [
        4.59921993882,
        4.88866774482,
        4.48518940982,
        4.50155808082,
        4.4815538108199995,
        4.63190912282,
        4.44235169982,
        4.45010564782,
        4.50056353282,
        4.53238421682
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.68746368702,
      "stddev": 0.17157601239711717,
      "median": 4.59779003482,
      "user": 2.12910792,
      "system": 1.5896178199999997,
      "min": 4.53095352782,
      "max": 4.9857434638199996,
      "times": [
        4.88525036382,
        4.75688201682,
        4.87218392282,
        4.53095352782,
        4.59189729882,
        4.60368277082,
        4.55056775282,
        4.55299716982,
        4.54447858282,
        4.9857434638199996
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.63307662032,
      "stddev": 0.12923556694831562,
      "median": 3.5907875578199997,
      "user": 1.52443332,
      "system": 1.4777817199999999,
      "min": 3.48289090182,
      "max": 3.89082211782,
      "times": [
        3.5776656938199998,
        3.69840544082,
        3.5287497968199997,
        3.89082211782,
        3.48289090182,
        3.53207214582,
        3.60390942182,
        3.5405467688199996,
        3.76556059582,
        3.71014331982
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 3.5827529579199995,
      "stddev": 0.06368396329964283,
      "median": 3.56584138932,
      "user": 1.5008533199999998,
      "system": 1.4710222199999998,
      "min": 3.49869312882,
      "max": 3.67056030182,
      "times": [
        3.58106554482,
        3.67056030182,
        3.52918727682,
        3.6650284538199998,
        3.49869312882,
        3.53710925182,
        3.52874578582,
        3.5506172338199997,
        3.65503560482,
        3.61148699682
      ]
    }
  ]
}

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13679
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
2,662.72 ms
(-2.86%)Baseline: 2,741.17 ms
3,289.41 ms
(80.95%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
1,737.45 ms
(-5.21%)Baseline: 1,832.91 ms
2,199.49 ms
(78.99%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
379.46 ms
(-19.95%)Baseline: 474.01 ms
568.81 ms
(66.71%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
176.37 ms
(-19.10%)Baseline: 218.02 ms
261.63 ms
(67.41%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,368.35 ms
(-4.43%)Baseline: 2,478.02 ms
2,973.62 ms
(79.65%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
4,442.35 ms
(-1.77%)Baseline: 4,522.42 ms
5,426.91 ms
(81.86%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
272.15 ms
(-11.30%)Baseline: 306.81 ms
368.18 ms
(73.92%)
isolated-linker.peer-heavy-resolve.hot-cache.offline📈 view plot
🚷 view threshold
436.31 ms
(-41.02%)Baseline: 739.76 ms
887.71 ms
(49.15%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13679
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
1,454.37 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
309.79 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
306.30 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
85.11 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,360.19 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
3,482.89 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
273.74 ms
🐰 View full continuous benchmarking report in Bencher

@zkochan

zkochan commented Aug 6, 2026

Copy link
Copy Markdown
Member Author

Thanks for the pass. I went through all 20 findings — none of them is a defect introduced by this PR, and I'd like to keep them out of it.

Why. This PR is 122 file renames. The only content edits in the whole diff are:

  • 32 files where pub mod _utils; became use crate::_utils; (the module is now declared once in tests/suite/main.rs rather than per binary),
  • 7 files where that declaration was deleted outright because they never used _utils,
  • one #[expect(clippy::must_use_candidate)] dropped from _utils, now unfulfilled because the module is private rather than a binary root.

I cross-checked the set of files with content changes against the set of flagged files, and the two are disjoint. Every finding lands on lines this PR does not touch; they surfaced only because GitHub presents a rename as a new file, so the whole pre-existing test body got read as new code.

A few of them may well be worth fixing on their own merits — the Windows junction check in link.rs and the unasserted String::replace in list.rs in particular. But folding pre-existing test fixes into a mechanical move is what makes a 124-file diff unreviewable, and it costs the property that makes this one safe: the move is verifiable by inspection, and revertable in one commit. Happy to file them separately.

One theme is a genuine follow-up, though, and it's worth recording because this PR is what makes it possible: several comments suggest hoisting duplicated helpers (empty_auth_file, assert_success / assert_failure, write_executable, ndjson_records, the slot join) into tests/suite/_utils/. That could not usefully be done before — each test file was its own binary, so a shared helper was recompiled into all 114 of them rather than shared. Now that they are one crate, _utils is compiled once and the dedup is a real win. I'd rather do it as its own PR, where the diff is about deduplication and can be reviewed as such.

For the record on the change itself: cargo nextest run -p pacquet-cli is 2439 passed / 0 failed / 4 skipped, and Rust CI is green on ubuntu, macOS and Windows.


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

`pacquet-cli` had 114 integration-test files, and Cargo builds one binary
per `tests/*.rs`. Each of those binaries statically links the whole
dependency graph — `pnpr`, the full registry server, included — so each
weighed 241 MB, and any change to the crate recompiled and re-linked all
~27 GB of them.

Every file now lives under `tests/suite/` as a module of
`tests/suite/main.rs`, so that work happens once. Measured on a 32-core
Linux box (mold, sccache, `debug = "line-tables-only"`):

  one-line change to cli/src/lib.rs, rebuild its test targets
      20.5-22.1s -> 3.45-3.73s
  touch package-manifest, rebuild --workspace --all-targets
      ~30s -> 11.2s
  clean `cargo build -p pacquet-cli --tests` disk usage
      30 GB -> 4.9 GB
  test binaries
      114 x 241 MB -> 1 x 264 MB

The disk figure matters beyond local builds: the Rust CI test job already
carries a "Free up runner disk space" step and a `line-tables-only`
override because this workspace kept crossing the runner's ENOSPC
ceiling mid-link.

Trade-offs: editing a single test file now rebuilds the suite binary
(~1s -> ~3.5s), which is the rarer of the two loops; and
`--test <file_stem>` becomes the module filter
`-E 'test(/^<file_stem>::/)'`. Both are documented in `pnpm/AGENTS.md`,
along with the rule that new test files belong under `tests/suite/`,
so a stray `tests/*.rs` does not quietly reintroduce a binary.

Test isolation is unchanged. `cargo nextest`, which every test recipe in
the justfile and the codecov workflow uses, runs each test in its own
process no matter how many binaries there are.

Two things the merge surfaced and this commit also fixes: seven test
files declared `pub mod _utils;` without ever using it, so each was
compiling 538 dead lines; and the `must_use_candidate` expectation in
`_utils` no longer fires now that the module is private rather than a
binary root.

Snapshots move to `tests/suite/snapshots/` under the `suite__` prefix
insta derives from the new module path.

`include_str!` resolves against the containing file, so the two call
sites that reach into `pnpm11/` need one more `../` at the new depth.
`pnpm/AGENTS.md` calls this out, since a test written against the old
layout will carry the shorter path.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings August 7, 2026 12:58

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Aug 7, 2026
@zkochan
zkochan merged commit b11fa81 into main Aug 7, 2026
32 checks passed
@zkochan
zkochan deleted the opt-build branch August 7, 2026 13:09
@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 0287c50

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

KSXGitHub pushed a commit that referenced this pull request Aug 17, 2026
Picks up a large batch, of which two reshape this branch's changes:
#13948 renames the Rust crates from `pacquet-` to `pnpm-`, and
#13679 moves the CLI end-to-end tests under `tests/suite/` so
they build as one target.

This branch's helpers move with them. The `pnpm-testing-utils` mtime
helpers keep their names, their imports follow the crate rename, and the
`bump_mtime` call sites travel to the relocated suite files. The
`Sys: Clock` seam on `build_workspace_state` and its `::<Host>` call
sites are re-applied against the renamed crates.
KSXGitHub pushed a commit that referenced this pull request Aug 17, 2026
The crate rename (#13948) collided with every import this branch
touches, and two changes collided semantically:

- `config.registries` became `registries_by_scope` (#13942), so
  `publish_options` builds its scoped-registry map from the new field.
- main's side of `publish_options` still parsed the resolved access through
  `Access::parse`. This branch forwards it verbatim on purpose -- pnpm
  validates only `publishConfig.access`, and dropping an unrecognized
  configured value falls back to the manifest's, which can be the more
  permissive level. Kept this branch's resolution, on main's field name.

The CLI end-to-end tests became a single target under `tests/suite/`
(#13679); git carried the three publish/stage files across and they
are registered in `main.rs`.

Replace this branch's hand-rolled ambient-config isolation with
`without_ambient_pnpm_config()` from #13744, which strips every
`pnpm_config_*` / `npm_config_*` spelling rather than the five names spelled
out here. `CommandTempCwd` already applies it, so the recursive suite only
needs the `XDG_CONFIG_HOME` pin that keeps a developer's global `config.yaml`
out; the other two build their own command and call it directly.

Repoint the `pacquet_publish::` doc references this branch added at
`pnpm_publish::`.
KSXGitHub pushed a commit that referenced this pull request Aug 18, 2026
Five conflicts, all from main growing its own version of what this branch
touches.

The Rust crates were renamed from `pacquet-` to `pnpm-`
(#13948), so every `pacquet_config::` path in the new code moved
with them, and `cli_args/config_warnings.rs` picked up a second warning
(`warn_unmatched_registry_options`) beside this branch's emit-once drain.
Both halves are additive: the file keeps both, and its test module keeps
both test sets.

`crates/cli/tests/` is now a single target whose modules live in
`tests/suite/` (#13679). Git moved `login.rs` for us but left
this branch's new `config_warnings.rs` at the old path, where it would
have become its own ~240 MB binary; it moves into `tests/suite/` and is
declared in `main.rs`.

The substantive one is the config reader. This branch hand-rolled a
`REPO_MANIFEST_SKIPPED_SETTINGS` denylist plus a bespoke
`IGNORED_SCOPE_WARNING`, and main has since generalized exactly that
concept: `PROJECT_MANIFEST_SKIPPED_KEYS`, assembled from the machine
locations, the current run's locations, and the credential keys, with one
warning that names each refused key and the route that does set it
(#13642). Keeping both would leave two denylists answering the
same question, so `scope` joins main's as a `LOGIN_TARGET_KEYS` category
and the bespoke set and constant are dropped. Users get the unified
sentence, which also names the global command, and `pnpm config set
scope` in a project now refuses with that same route rather than writing
a key the reader would ignore.

pacquet has no such mechanism — main left it untouched, since it parses
the manifest into a declared struct — so its `IGNORED_SCOPE_WARNING` is
reworded to the sentence the TypeScript reader now assembles, keeping the
two stacks emitting identical text.

The `Config.ts` note on the field goes away with it: main keeps this fact
only in the denylist, and `configDir` and its peers carry no such note.
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants