Skip to content

fix(pacquet): complete auth and proxy parity - #13158

Merged
zkochan merged 4 commits into
mainfrom
stage-6
Jul 19, 2026
Merged

zkochan merged 4 commits into
mainfrom
stage-6

Conversation

@zkochan

@zkochan zkochan commented Jul 19, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Complete the auth and proxy test-porting work in Stage 6 of pacquet: port the remaining TEST_PORTING.md suites in stages #13146.
  • Add hermetic install coverage for bearer, basic, legacy, scoped, metadata-failure, and tarball-failure authentication paths.
  • Bring pacquet's proxy configuration precedence in line with pnpm for global YAML, environment, npmrc, workspace YAML, and CLI overrides.
  • Cover HTTPS CONNECT proxies, SOCKS5 tunneling, redirect credential handling, proxy config commands, and update the porting plan.

Related to #13146.

Squash Commit Body

Port the remaining Stage 6 auth and proxy scenarios to pacquet with hermetic
registry, HTTPS proxy, and SOCKS5 fixtures.

Apply proxy settings from global and workspace YAML, PNPM_CONFIG environment
variables, npmrc, and CLI flags with pnpm-compatible precedence. Ensure proxy
CLI overrides also reach bootstrap requests, including optimistic installs.

Share minimal tarball fixtures across CLI integration tests and record the
completed coverage in the test-porting plan.

Related to pnpm/pnpm#13146.

Checklist

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

Written by an agent (Codex, GPT-5).


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

Summary by CodeRabbit

  • New Features
    • Added global CLI options: --http-proxy, --https-proxy, and --no-proxy.
    • Proxy settings are now sourced consistently from global configuration, workspace settings, environment variables, and CLI overrides.
    • Expanded proxy routing support (including HTTPS tunneling and SOCKS5 proxying).
  • Bug Fixes
    • Fixed proxy updates to persist to the global config.yaml when using global configuration commands.
    • Improved proxy precedence and preservation for different request types (HTTP vs HTTPS).
  • Tests
    • Added/expanded coverage for proxy precedence, parsing, and network/auth behaviors.

Copilot AI review requested due to automatic review settings July 19, 2026 19:48

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 Jul 19, 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: caa41c8a-edda-41b3-ab08-85ec711eb265

📥 Commits

Reviewing files that changed from the base of the PR and between 5544af6 and 83f1301.

📒 Files selected for processing (4)
  • pnpm/crates/config/src/lib.rs
  • pnpm/crates/config/src/tests.rs
  • pnpm/crates/config/src/workspace_yaml.rs
  • pnpm/crates/testing-utils/src/fixtures.rs
🚧 Files skipped from review as they are similar to previous changes (4)
  • pnpm/crates/testing-utils/src/fixtures.rs
  • pnpm/crates/config/src/lib.rs
  • pnpm/crates/config/src/tests.rs
  • pnpm/crates/config/src/workspace_yaml.rs

📝 Walkthrough

Walkthrough

Proxy settings now flow from global configuration, environment, YAML, CLI flags, and overrides into project and bootstrap network configs. The PR also adds proxy/network regression coverage, registry authentication tests, shared test fixtures, and porting updates.

Changes

Proxy configuration and networking

Layer / File(s) Summary
Proxy configuration sources
pnpm/crates/config/src/{env_overlay.rs,workspace_yaml.rs,lib.rs,npmrc_auth.rs}
Proxy values, no-proxy parsing, environment substitution, trust filtering, and explicit HTTP-proxy tracking are added across configuration sources.
Proxy CLI and override wiring
pnpm/crates/cli/src/cli_args/*, pnpm/crates/cli/src/config_overrides.rs
Global proxy flags and dotted overrides are parsed and applied in normal and install fast-path execution.
Proxy persistence and behavior validation
pnpm/crates/config/src/{tests.rs,workspace_yaml/tests.rs}, pnpm/crates/network/src/tests.rs, pnpm/crates/cli/src/cli_args/config/tests.rs
Tests cover precedence, global config persistence, trusted sources, CLI fallback semantics, HTTPS proxy routing, SOCKS5 forwarding, and redirect authorization behavior.

Authentication test coverage

Layer / File(s) Summary
Authentication test infrastructure
pnpm/crates/cli/tests/auth.rs, pnpm/crates/testing-utils/*, pnpm/crates/cli/tests/tarball_url_dependency.rs
Isolated install helpers, mocked registry scenarios, and shared tarball and integrity fixtures are added.
Authentication behavior validation
pnpm/crates/config/src/tests.rs, pnpm/plans/TEST_PORTING.md
Tests cover credential selection, scoped and workspace precedence, authorization failures, and recorded porting status.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant Config
  participant NetworkClient
  participant Registry
  CLI->>Config: load proxy and authentication settings
  CLI->>NetworkClient: start install requests
  NetworkClient->>Registry: fetch metadata and tarballs through configured proxy
  Registry-->>NetworkClient: return responses and authorization results
  NetworkClient-->>CLI: complete or report install outcome
Loading

Possibly related issues

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 stage-6

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

Fix pacquet auth/proxy parity and add hermetic coverage for Stage 6

🐞 Bug fix 🧪 Tests ✨ Enhancement 🕐 40+ Minutes

Grey Divider

AI Description

• Add global proxy CLI flags and enforce pnpm-compatible proxy precedence.
• Expand hermetic auth/proxy tests for headers, redirects, CONNECT, and SOCKS5.
• Share minimal tarball fixtures and record completed Stage 6 test porting.
Diagram

graph TD
  cli["CLI flags"] --> cfg["Config loader"] --> pxy["ProxyConfig"] --> net["ThrottledClient"] --> ext{{"Registry / Tarballs"}}
  env["Env overlay (PNPM_CONFIG_*, NO_PROXY)"] --> cfg
  yml["YAML (global/workspace)"] --> cfg
  npmrc[".npmrc / auth.ini"] --> cfg
  pxy --> prx{{"HTTP/HTTPS/SOCKS Proxy"}} --> ext
  tests["Hermetic tests"] --> cli
  tests --> net

  subgraph Legend
    direction LR
    _in["Input source"] ~~~ _cfg["Config"] ~~~ _svc(["Network client"]) ~~~ _ext{{"External"}}
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Single precedence engine (layered merge) for proxy settings
  • ➕ Makes precedence explicit and easier to reason about than post-overlay patching
  • ➕ Avoids duplicating override application across call sites (dispatch vs overrides)
  • ➖ Higher refactor cost; riskier to land alongside large test additions
  • ➖ May touch many unrelated config fields if generalized
2. Route all CLI proxy flags through ConfigOverrides only
  • ➕ One code path for dotted and non-dotted proxy overrides
  • ➕ Simplifies dispatch by removing explicit apply_proxy_cli_overrides calls
  • ➖ Requires plumbing global clap args into overrides extraction consistently
  • ➖ Harder to keep bootstrap requests in sync if some flows bypass overrides

Recommendation: The PR’s approach (central apply_proxy_cli_overrides + explicit application to both main and bootstrap configs) is appropriate for parity work: it minimizes refactor blast radius while ensuring CLI overrides reach optimistic/bootstrap requests. If future proxy-related options grow, consider migrating toward a single layered merge engine to reduce duplicated application points.

Files changed (20) +849 / -51

Enhancement (4) +99 / -1
cli_command.rsAdd global proxy CLI flags (https-proxy/http-proxy/no-proxy) +12/-0

Add global proxy CLI flags (https-proxy/http-proxy/no-proxy)

• Extends CliArgs with global flags for HTTPS proxy, HTTP proxy, and no-proxy bypass lists, matching pnpm-style options.

pnpm/crates/cli/src/cli_args/cli_command.rs

env_overlay.rsRead proxy-related PNPM_CONFIG_* and NO_PROXY/NOPROXY env vars +9/-0

Read proxy-related PNPM_CONFIG_* and NO_PROXY/NOPROXY env vars

• Extends environment overlay parsing to include HTTPS_PROXY, HTTP_PROXY, PROXY, and both NO_PROXY/NOPROXY aliases, matching pnpm expectations.

pnpm/crates/config/src/env_overlay.rs

workspace_yaml.rsParse/apply proxy settings from workspace YAML with env substitution rules +53/-1

Parse/apply proxy settings from workspace YAML with env substitution rules

• Adds workspace settings fields for httpsProxy/httpProxy/proxy/noProxy/noproxy, includes env-substitution behavior, and applies resolved proxy settings onto Config.proxy using consistent parsing semantics.

pnpm/crates/config/src/workspace_yaml.rs

fixtures.rsIntroduce shared minimal tarball and sha512 integrity helpers +25/-0

Introduce shared minimal tarball and sha512 integrity helpers

• Adds minimal_tarball() to build a small gzipped tarball containing package/package.json and sha512_integrity() to compute ssri integrity strings, enabling hermetic registry/tarball tests.

pnpm/crates/testing-utils/src/fixtures.rs

Bug fix (3) +67 / -0
dispatch.rsApply proxy CLI overrides during config loading and command dispatch +13/-0

Apply proxy CLI overrides during config loading and command dispatch

• Ensures proxy CLI flags override resolved config in both the direct dispatch path and the configuration load path, including bootstrap-related requests.

pnpm/crates/cli/src/cli_args/dispatch.rs

config_overrides.rsSupport dotted proxy overrides and apply them to network config +23/-0

Support dotted proxy overrides and apply them to network config

• Extends ConfigOverrides to accept https-proxy/http-proxy/no-proxy via '--config.*' and applies those overrides to the Config’s proxy settings with pnpm-like precedence semantics.

pnpm/crates/cli/src/config_overrides.rs

lib.rsCentralize proxy CLI override application and propagate to bootstrap config +31/-0

Centralize proxy CLI override application and propagate to bootstrap config

• Adds Config::apply_proxy_cli_overrides to apply final proxy flag precedence after file/env resolution, including https→http fallback when not explicitly set. Ensures global and env proxy settings also apply to package_manager_bootstrap.proxy.

pnpm/crates/config/src/lib.rs

Refactor (2) +5 / -25
tarball_url_dependency.rsReuse shared minimal tarball fixture in tarball URL dependency tests +4/-24

Reuse shared minimal tarball fixture in tarball URL dependency tests

• Replaces the file-local tarball builder with the shared testing-utils minimal_tarball helper to reduce duplication and align fixtures across tests.

pnpm/crates/cli/tests/tarball_url_dependency.rs

npmrc_auth.rsExpose no-proxy parsing helper for config layers +1/-1

Expose no-proxy parsing helper for config layers

• Makes parse_no_proxy available within the crate so workspace/global config parsing can reuse the same normalization logic as npmrc-auth parsing.

pnpm/crates/config/src/npmrc_auth.rs

Tests (7) +641 / -1
tests.rsTest config set writes httpProxy/noProxy into global config.yaml +42/-0

Test config set writes httpProxy/noProxy into global config.yaml

• Adds coverage ensuring 'config set --global' for httpProxy and no-proxy updates config.yaml (not auth.ini), aligning with pnpm behavior.

pnpm/crates/cli/src/cli_args/config/tests.rs

tests.rsVerify proxy flags parse as global args before/after subcommands +18/-0

Verify proxy flags parse as global args before/after subcommands

• Adds a parsing regression test confirming the new proxy flags are global and accepted on either side of the subcommand.

pnpm/crates/cli/src/cli_args/tests.rs

tests.rsTest dotted proxy overrides update both install and bootstrap proxy config +27/-0

Test dotted proxy overrides update both install and bootstrap proxy config

• Validates that '--config.https-proxy', '--config.http-proxy', and '--config.no-proxy' override existing YAML-derived proxy settings and propagate to package_manager_bootstrap.proxy.

pnpm/crates/cli/src/config_overrides/tests.rs

auth.rsAdd hermetic install tests for auth headers and auth failures +230/-0

Add hermetic install tests for auth headers and auth failures

• Introduces integration tests covering bearer/basic/legacy and scope-specific auth headers for metadata and tarball requests, including cold-store frozen reinstalls. Adds failure-path assertions for 403s on metadata and tarball fetches.

pnpm/crates/cli/tests/auth.rs

tests.rsAdd config precedence tests for auth file and proxy sources +110/-0

Add config precedence tests for auth file and proxy sources

• Adds tests that workspace .npmrc overrides the global auth file, and verifies proxy precedence across global config.yaml, PNPM_CONFIG_* env overrides, and project .npmrc while keeping bootstrap proxy in sync.

pnpm/crates/config/src/tests.rs

tests.rsTest workspace YAML env-substitution behavior for proxy settings +15/-0

Test workspace YAML env-substitution behavior for proxy settings

• Extends workspace YAML tests to ensure proxy fields are ignored when they contain untrusted env placeholders and expanded when trusted, mirroring existing behavior for request destinations.

pnpm/crates/config/src/workspace_yaml/tests.rs

tests.rsAdd network tests for redirect auth stripping, CONNECT, and SOCKS5 tunneling +199/-1

Add network tests for redirect auth stripping, CONNECT, and SOCKS5 tunneling

• Adds tests ensuring Authorization is removed on cross-origin redirects but retained on same-origin redirects. Adds an HTTPS CONNECT proxy recording test and a real SOCKS5 proxy-to-target integration test.

pnpm/crates/network/src/tests.rs

Documentation (2) +29 / -24
tidy-wolves-proxy.mdAdd pacquet patch changeset for proxy precedence fix +5/-0

Add pacquet patch changeset for proxy precedence fix

• Introduces a changeset noting that proxy settings from global config.yaml and CLI options are now honored in pnpm-compatible ways.

.changeset/tidy-wolves-proxy.md

TEST_PORTING.mdMark Stage 6 auth/proxy scenarios as ported with test references +24/-24

Mark Stage 6 auth/proxy scenarios as ported with test references

• Updates the test porting plan to record completed auth, redirect, proxy CONNECT, and SOCKS5 coverage with links to the new/updated Rust tests.

pnpm/plans/TEST_PORTING.md

Other (2) +8 / -0
Cargo.lockLockfile updates for new test fixture dependencies +4/-0

Lockfile updates for new test fixture dependencies

• Adds flate2, serde_json, ssri, and tar to support shared tarball fixtures used across integration tests.

Cargo.lock

Cargo.tomlAdd dependencies needed for shared tarball/integrity fixtures +4/-0

Add dependencies needed for shared tarball/integrity fixtures

• Adds flate2, tar, serde_json, and ssri dependencies to support generating gzipped npm tarballs and computing sha512 integrity in testing-utils.

pnpm/crates/testing-utils/Cargo.toml

@github-actions

github-actions Bot commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                          main                                   pr
-----                          ----                                   --
lockfile/parse_pnpm_lock       1.01     11.1±0.02ms    33.7 MB/sec    1.00     11.0±0.06ms    34.2 MB/sec
packument/parse                1.01     38.3±0.08µs  1730.2 MB/sec    1.00     38.0±0.07µs  1746.3 MB/sec
tarball/download_dependency    1.00      2.1±0.05ms  2025.0 KB/sec    1.04      2.2±0.07ms  1945.3 KB/sec

@qodo-code-review

qodo-code-review Bot commented Jul 19, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Action required

1. Changeset mentions pnpm, not pacquet ✗ Dismissed 📘 Rule violation ⚙ Maintainability ⭐ New
Description
The added changeset targets pacquet but its description says the fix is "in pnpm", which is
misleading for release notes and can cause incorrect user-facing attribution.
Code

.changeset/tidy-wolves-proxy.md[R1-5]

+---
+"pacquet": patch
+---
+
+Fixed proxy settings from the global `config.yaml` and command-line options in pnpm.
Evidence
Compliance rule 12 requires changeset entries to be user-facing and correctly targeted. The
changeset frontmatter bumps pacquet, but the description line claims the fix is in pnpm,
creating an inaccurate release note.

CLAUDE.md: Changesets: add a .changeset entry for published-package changes and include pnpm explicitly when applicable
.changeset/tidy-wolves-proxy.md[1-5]

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

## Issue description
The changeset is for `pacquet` but the text says the fix is in `pnpm`, which can mislead users and produce incorrect release notes.

## Issue Context
This PR appears to primarily change the Rust pacquet stack; the changeset should describe the user-visible change accurately for the package being bumped.

## Fix Focus Areas
- .changeset/tidy-wolves-proxy.md[1-5]

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


2. --https-proxy overwrites http_proxy ✓ Resolved 📘 Rule violation ≡ Correctness Keep pnpm and pacquet in sync
Description
Config::apply_proxy_cli_overrides() can overwrite an explicitly configured HTTP proxy (from
.npmrc http-proxy/proxy or HTTP_PROXY/PROXY) when only --https-proxy is provided,
because it fails to reliably detect that the HTTP proxy was explicitly set by lower-priority
sources. This breaks pnpm/pacquet proxy-precedence parity and can route HTTP registry/tarball
traffic through an unintended proxy.
Code

pnpm/crates/config/src/lib.rs[R1686-1693]

+        let has_explicit_http_proxy = self.explicit_settings.contains_key("httpProxy")
+            || self.raw_auth_config.contains_key("http-proxy");
+        for proxy in [&mut self.proxy, &mut self.package_manager_bootstrap.proxy] {
+            if let Some(value) = https_proxy {
+                proxy.https_proxy = Some(value.to_string());
+                if http_proxy.is_none() && !has_explicit_http_proxy {
+                    proxy.http_proxy = Some(value.to_string());
+                }
Evidence
apply_proxy_cli_overrides() overwrites proxy.http_proxy from the CLI --https-proxy unless
has_explicit_http_proxy is true, but the current explicitness check consults explicit_settings
and raw_auth_config (via self.raw_auth_config.contains_key("http-proxy")). raw_auth_config
comes from NpmrcAuth::raw_ini_config and only retains keys that pass is_ini_config_key
(auth/scoped/per-registry keys), so it never includes .npmrc proxy keys; meanwhile, .npmrc proxy
settings are parsed into structured fields and applied into config.proxy.http_proxy via
NpmrcAuth::apply_proxy_cascade(), and the same cascade can also populate config.proxy.http_proxy
from HTTP_PROXY/PROXY. Because that provenance is not reflected in raw_auth_config,
has_explicit_http_proxy can be false even when an explicit HTTP proxy exists, allowing
--https-proxy to clobber it, diverging from pnpm’s behavior where http-proxy remains independent
from https-proxy and explicit HTTP settings are preserved.

Rule Keep pnpm and pacquet in sync: User-Visible CLI Changes Must Be Kept in Sync Between TypeScript pnpm and Rust pacquet
Rule Conventions: Config and layering: Do Not Hardcode Configurable Values; Use @pnpm/config and Pass Through Options
pnpm/crates/config/src/lib.rs[1686-1699]
pnpm/crates/config/src/npmrc_auth.rs[507-536]
pnpm11/config/reader/src/index.ts[778-801]
pnpm/crates/config/src/config_types.rs[468-473]
pnpm/crates/config/src/lib.rs[1677-1702]
pnpm/crates/config/src/npmrc_auth.rs[368-399]
pnpm/crates/config/src/npmrc_auth.rs[517-542]

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

## Issue description
`Config::apply_proxy_cli_overrides()` currently decides whether it may copy a provided `--https-proxy` value into `http_proxy` (when `--http-proxy` is absent) using a signal like `has_explicit_http_proxy = explicit_settings.contains_key("httpProxy") || raw_auth_config.contains_key("http-proxy")`. However, `.npmrc` proxy keys (`http-proxy` / `proxy`) are applied via `NpmrcAuth::apply_proxy_cascade()` into `config.proxy.http_proxy` and are not tracked in `raw_auth_config` (which only retains auth/scoped/per-registry INI keys), and env fallbacks (`HTTP_PROXY`/`PROXY`) also don’t produce a provenance signal consumed here. As a result, `--https-proxy` can incorrectly overwrite a distinct, explicitly configured HTTP proxy from lower-priority sources, diverging from pnpm’s proxy precedence and potentially misrouting HTTP traffic.

## Issue Context
- `.npmrc` proxy settings are parsed into structured fields on `NpmrcAuth` (e.g., `http_proxy`, legacy proxy fields) and then applied into `config.proxy` by `apply_proxy_cascade()`.
- `raw_auth_config` is sourced from `NpmrcAuth::raw_ini_config` and only captures keys allowed by `is_ini_config_key` (auth/scoped/per-registry), so `.npmrc` proxy keys never land there.
- `apply_proxy_cascade()` can also set `config.proxy.http_proxy` from standard env proxy variables (`HTTP_PROXY`/`PROXY`), but there is currently no explicit provenance signal carried into `apply_proxy_cli_overrides()`.
- In pnpm (TS), `http-proxy` remains independent from `https-proxy` and explicit HTTP proxy settings are preserved when a higher-priority HTTPS proxy is set.

## Fix Focus Areas
- pnpm/crates/config/src/lib.rs[1677-1702]
- pnpm/crates/config/src/lib.rs[1686-1693]
- pnpm/crates/config/src/npmrc_auth.rs[368-399]
- pnpm/crates/config/src/npmrc_auth.rs[517-542]
- pnpm/crates/config/src/config_types.rs[468-473]

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


Grey Divider

Previous review results

Review updated until commit 83f1301

Results up to commit 82d9316 ⚖️ Balanced


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


Action required
1. --https-proxy overwrites http_proxy ✓ Resolved 📘 Rule violation ≡ Correctness Keep pnpm and pacquet in sync
Description
Config::apply_proxy_cli_overrides() can overwrite an explicitly configured HTTP proxy (from
.npmrc http-proxy/proxy or HTTP_PROXY/PROXY) when only --https-proxy is provided,
because it fails to reliably detect that the HTTP proxy was explicitly set by lower-priority
sources. This breaks pnpm/pacquet proxy-precedence parity and can route HTTP registry/tarball
traffic through an unintended proxy.
Code

pnpm/crates/config/src/lib.rs[R1686-1693]

+        let has_explicit_http_proxy = self.explicit_settings.contains_key("httpProxy")
+            || self.raw_auth_config.contains_key("http-proxy");
+        for proxy in [&mut self.proxy, &mut self.package_manager_bootstrap.proxy] {
+            if let Some(value) = https_proxy {
+                proxy.https_proxy = Some(value.to_string());
+                if http_proxy.is_none() && !has_explicit_http_proxy {
+                    proxy.http_proxy = Some(value.to_string());
+                }
Evidence
apply_proxy_cli_overrides() overwrites proxy.http_proxy from the CLI --https-proxy unless
has_explicit_http_proxy is true, but the current explicitness check consults explicit_settings
and raw_auth_config (via self.raw_auth_config.contains_key("http-proxy")). raw_auth_config
comes from NpmrcAuth::raw_ini_config and only retains keys that pass is_ini_config_key
(auth/scoped/per-registry keys), so it never includes .npmrc proxy keys; meanwhile, .npmrc proxy
settings are parsed into structured fields and applied into config.proxy.http_proxy via
NpmrcAuth::apply_proxy_cascade(), and the same cascade can also populate config.proxy.http_proxy
from HTTP_PROXY/PROXY. Because that provenance is not reflected in raw_auth_config,
has_explicit_http_proxy can be false even when an explicit HTTP proxy exists, allowing
--https-proxy to clobber it, diverging from pnpm’s behavior where http-proxy remains independent
from https-proxy and explicit HTTP settings are preserved.

Rule Keep pnpm and pacquet in sync: User-Visible CLI Changes Must Be Kept in Sync Between TypeScript pnpm and Rust pacquet
Rule Conventions: Config and layering: Do Not Hardcode Configurable Values; Use @pnpm/config and Pass Through Options
pnpm/crates/config/src/lib.rs[1686-1699]
pnpm/crates/config/src/npmrc_auth.rs[507-536]
pnpm11/config/reader/src/index.ts[778-801]
pnpm/crates/config/src/config_types.rs[468-473]
pnpm/crates/config/src/lib.rs[1677-1702]
pnpm/crates/config/src/npmrc_auth.rs[368-399]
pnpm/crates/config/src/npmrc_auth.rs[517-542]

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

## Issue description
`Config::apply_proxy_cli_overrides()` currently decides whether it may copy a provided `--https-proxy` value into `http_proxy` (when `--http-proxy` is absent) using a signal like `has_explicit_http_proxy = explicit_settings.contains_key("httpProxy") || raw_auth_config.contains_key("http-proxy")`. However, `.npmrc` proxy keys (`http-proxy` / `proxy`) are applied via `NpmrcAuth::apply_proxy_cascade()` into `config.proxy.http_proxy` and are not tracked in `raw_auth_config` (which only retains auth/scoped/per-registry INI keys), and env fallbacks (`HTTP_PROXY`/`PROXY`) also don’t produce a provenance signal consumed here. As a result, `--https-proxy` can incorrectly overwrite a distinct, explicitly configured HTTP proxy from lower-priority sources, diverging from pnpm’s proxy precedence and potentially misrouting HTTP traffic.

## Issue Context
- `.npmrc` proxy settings are parsed into structured fields on `NpmrcAuth` (e.g., `http_proxy`, legacy proxy fields) and then applied into `config.proxy` by `apply_proxy_cascade()`.
- `raw_auth_config` is sourced from `NpmrcAuth::raw_ini_config` and only captures keys allowed by `is_ini_config_key` (auth/scoped/per-registry), so `.npmrc` proxy keys never land there.
- `apply_proxy_cascade()` can also set `config.proxy.http_proxy` from standard env proxy variables (`HTTP_PROXY`/`PROXY`), but there is currently no explicit provenance signal carried into `apply_proxy_cli_overrides()`.
- In pnpm (TS), `http-proxy` remains independent from `https-proxy` and explicit HTTP proxy settings are preserved when a higher-priority HTTPS proxy is set.

## Fix Focus Areas
- pnpm/crates/config/src/lib.rs[1677-1702]
- pnpm/crates/config/src/lib.rs[1686-1693]
- pnpm/crates/config/src/npmrc_auth.rs[368-399]
- pnpm/crates/config/src/npmrc_auth.rs[517-542]
- pnpm/crates/config/src/config_types.rs[468-473]

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


Qodo Logo

Comment thread pnpm/crates/config/src/lib.rs Resolved
@codecov-commenter

codecov-commenter commented Jul 19, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.45763% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.31%. Comparing base (ebacfa6) to head (83f1301).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
pnpm/crates/config/src/env_overlay.rs 77.77% 2 Missing ⚠️
pnpm/crates/config/src/lib.rs 93.75% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13158      +/-   ##
==========================================
+ Coverage   85.85%   86.31%   +0.45%     
==========================================
  Files         505      507       +2     
  Lines       84029    84704     +675     
==========================================
+ Hits        72147    73111     +964     
+ Misses      11882    11593     -289     

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

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

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

@greptile-apps

greptile-apps Bot commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

Safe to merge — the change is additive (new flags, new tests, moved helpers) and the proxy precedence logic is thoroughly exercised by the new unit tests.

The proxy cascade is well-covered end-to-end: global YAML, env overlay, npmrc, workspace YAML, and both forms of CLI override each have dedicated tests. The http_proxy_is_explicit sentinel correctly prevents inadvertent HTTPS-to-HTTP fallback propagation in every scenario tested. The security boundary (workspace YAML proxy intentionally excluded from package_manager_bootstrap) is preserved and guarded by workspace_yaml_proxy_is_not_trusted_for_package_manager_bootstrap. No change affects lockfile format, store layout, or other shared contract fields.

No files require special attention.

Reviews (3): Last reviewed commit: "fix(pacquet): preserve layered HTTP prox..." | Re-trigger Greptile

@github-actions

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: 82d93164d13b

Each scenario reports direct installs and pnpr installs. 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.510 ± 0.155 2.339 2.782 1.66 ± 0.21
pacquet@main 2.513 ± 0.142 2.351 2.746 1.67 ± 0.21
pnpr@HEAD 1.533 ± 0.137 1.389 1.781 1.02 ± 0.15
pnpr@main 1.508 ± 0.170 1.341 1.783 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.5100779701200002,
      "stddev": 0.15468039920910903,
      "median": 2.47838852552,
      "user": 1.4838288,
      "system": 1.2718275799999998,
      "min": 2.3393132155200003,
      "max": 2.78180956952,
      "times": [
        2.65287346752,
        2.63357786152,
        2.4475005005200003,
        2.3800273025200003,
        2.3393132155200003,
        2.3649058745200002,
        2.78180956952,
        2.36464203052,
        2.50927655052,
        2.62685332852
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.5125117201200005,
      "stddev": 0.14204467918847383,
      "median": 2.47861364252,
      "user": 1.4148368,
      "system": 1.27755918,
      "min": 2.35148899752,
      "max": 2.7455181255200003,
      "times": [
        2.58667930452,
        2.7455181255200003,
        2.61787592752,
        2.5254388585200003,
        2.69502195052,
        2.3929342035200003,
        2.38385988952,
        2.35148899752,
        2.3945115175200002,
        2.4317884265200003
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.53269101952,
      "stddev": 0.1367602803773092,
      "median": 1.48428093302,
      "user": 1.0008016,
      "system": 1.13990208,
      "min": 1.3887541325200001,
      "max": 1.78131448852,
      "times": [
        1.42333825852,
        1.69456590352,
        1.4510990675200002,
        1.39255315752,
        1.6482243785200001,
        1.50885881552,
        1.4597030505200002,
        1.3887541325200001,
        1.57849894252,
        1.78131448852
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.50789382512,
      "stddev": 0.16958918349791682,
      "median": 1.46585340802,
      "user": 1.0027802000000001,
      "system": 1.1431646799999997,
      "min": 1.3408067305200002,
      "max": 1.78295182552,
      "times": [
        1.7706346885200002,
        1.78295182552,
        1.35483667452,
        1.3408067305200002,
        1.60782836852,
        1.41915739952,
        1.3738194535200001,
        1.5125494165200002,
        1.56307664052,
        1.35327705352
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 249.8 ± 3.9 243.2 256.9 1.01 ± 0.04
pacquet@main 248.0 ± 10.0 232.6 262.4 1.00
pnpr@HEAD 266.3 ± 8.6 250.5 278.2 1.07 ± 0.06
pnpr@main 263.7 ± 7.5 254.2 279.9 1.06 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.24981679388000005,
      "stddev": 0.0039009680292448113,
      "median": 0.25001136688000003,
      "user": 0.20536093999999996,
      "system": 0.51760904,
      "min": 0.24316837088,
      "max": 0.25693423088000006,
      "times": [
        0.25693423088000006,
        0.25181203888000003,
        0.24751943888000003,
        0.24316837088,
        0.24703567288,
        0.25130809588,
        0.25326699388000007,
        0.25132695988000003,
        0.24708149888,
        0.24871463788
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.24802947008,
      "stddev": 0.010028468124085397,
      "median": 0.25032475888000005,
      "user": 0.18543433999999998,
      "system": 0.5280047400000001,
      "min": 0.23263271088,
      "max": 0.26244450988000007,
      "times": [
        0.25006032888,
        0.26244450988000007,
        0.25141270088000006,
        0.25288017888000003,
        0.25058918888000004,
        0.24482163788000003,
        0.26104146288,
        0.23780942588,
        0.23263271088,
        0.23660255588
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.26628465448000005,
      "stddev": 0.00862442683929929,
      "median": 0.2647518508800001,
      "user": 0.21175803999999995,
      "system": 0.5328843400000001,
      "min": 0.25054592688000005,
      "max": 0.27816003088,
      "times": [
        0.27816003088,
        0.26465493988000005,
        0.26484876188000006,
        0.27205893488000005,
        0.27531553388,
        0.27443836088000007,
        0.26064740488000004,
        0.25054592688000005,
        0.25898921888000004,
        0.26318743188000004
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.2636509995800001,
      "stddev": 0.007464291100829519,
      "median": 0.26119744438000003,
      "user": 0.19120544,
      "system": 0.5514039399999999,
      "min": 0.25417834988000004,
      "max": 0.27985963388000007,
      "times": [
        0.25888412288000007,
        0.26019431588,
        0.26220057288000004,
        0.27115864988000005,
        0.26702292388000004,
        0.25970765488,
        0.25841639688000007,
        0.26488737488,
        0.25417834988000004,
        0.27985963388000007
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.679 ± 0.017 2.661 2.711 1.71 ± 0.14
pacquet@main 2.681 ± 0.013 2.662 2.702 1.72 ± 0.14
pnpr@HEAD 1.562 ± 0.131 1.388 1.810 1.00
pnpr@main 1.598 ± 0.130 1.392 1.821 1.02 ± 0.12
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.6794846446399996,
      "stddev": 0.017153153727136553,
      "median": 2.67373957244,
      "user": 1.5260591,
      "system": 1.2863043799999998,
      "min": 2.66051265794,
      "max": 2.71085949194,
      "times": [
        2.6700574119400002,
        2.67640630094,
        2.66364173794,
        2.67064472194,
        2.68143608094,
        2.67107284394,
        2.71085949194,
        2.70762854294,
        2.66051265794,
        2.6825866559400002
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.68087217704,
      "stddev": 0.012844886407003509,
      "median": 2.6820992629400005,
      "user": 1.5445183,
      "system": 1.23610848,
      "min": 2.66246750894,
      "max": 2.7020556459400003,
      "times": [
        2.68261441794,
        2.69607424394,
        2.6818874159400004,
        2.66496838094,
        2.67921611394,
        2.7020556459400003,
        2.66246750894,
        2.66871776294,
        2.68231110994,
        2.68840916994
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.56242656324,
      "stddev": 0.13104596737694313,
      "median": 1.5360975194400002,
      "user": 0.9797722999999999,
      "system": 1.0898570799999998,
      "min": 1.3878128329400001,
      "max": 1.80963883594,
      "times": [
        1.50225844794,
        1.3878128329400001,
        1.52188371094,
        1.41353049494,
        1.5503113279400003,
        1.61131018194,
        1.63738446194,
        1.4827430809400002,
        1.70739225694,
        1.80963883594
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.5983099380399999,
      "stddev": 0.12958727353110466,
      "median": 1.61505605244,
      "user": 0.9624153,
      "system": 1.09254148,
      "min": 1.39197833394,
      "max": 1.8208733749400001,
      "times": [
        1.5761137989400003,
        1.67475452494,
        1.8208733749400001,
        1.6787745739400002,
        1.6713940119400001,
        1.58026847994,
        1.6498436249400001,
        1.51821374894,
        1.42088490794,
        1.39197833394
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 548.0 ± 6.0 538.2 559.6 1.90 ± 0.04
pacquet@main 521.8 ± 8.4 504.0 535.1 1.81 ± 0.04
pnpr@HEAD 294.5 ± 5.5 284.6 303.0 1.02 ± 0.03
pnpr@main 288.0 ± 4.9 280.6 296.8 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.5480235178200001,
      "stddev": 0.006039861504002002,
      "median": 0.54770374062,
      "user": 0.6690641599999999,
      "system": 0.643817,
      "min": 0.5382461846200001,
      "max": 0.5596046426200001,
      "times": [
        0.5448430886200001,
        0.54912876462,
        0.54227582062,
        0.5596046426200001,
        0.54989187362,
        0.55357109462,
        0.55110065762,
        0.54529433462,
        0.54627871662,
        0.5382461846200001
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.52182490122,
      "stddev": 0.00838367717290208,
      "median": 0.5234671471200001,
      "user": 0.62611466,
      "system": 0.6269612999999998,
      "min": 0.50395785262,
      "max": 0.53506656962,
      "times": [
        0.50395785262,
        0.5229076596200001,
        0.52402663462,
        0.52483895662,
        0.52632576162,
        0.52509026662,
        0.53506656962,
        0.51228848362,
        0.5225904666200001,
        0.52115636062
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.29445603622000005,
      "stddev": 0.005521067334603948,
      "median": 0.29448513012,
      "user": 0.18336365999999998,
      "system": 0.5291035999999999,
      "min": 0.28461304162,
      "max": 0.30302618462,
      "times": [
        0.29502035262000004,
        0.29764818362,
        0.30043234762000004,
        0.29016663262000003,
        0.29394990762,
        0.29312586362000004,
        0.29745031262000005,
        0.28912753562000004,
        0.30302618462,
        0.28461304162
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.28799134252,
      "stddev": 0.004906005945971855,
      "median": 0.28927808362,
      "user": 0.18477255999999997,
      "system": 0.5036361,
      "min": 0.28064646362,
      "max": 0.29681393062,
      "times": [
        0.28359742062000004,
        0.28064646362,
        0.28121250362,
        0.29003550662,
        0.28866014162000003,
        0.29003386262,
        0.29063676262000004,
        0.28838080762,
        0.28989602562,
        0.29681393062
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.836 ± 0.007 1.827 1.847 6.55 ± 0.25
pacquet@main 1.829 ± 0.014 1.804 1.848 6.52 ± 0.25
pnpr@HEAD 0.283 ± 0.003 0.277 0.287 1.01 ± 0.04
pnpr@main 0.281 ± 0.010 0.271 0.300 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.8363345062799996,
      "stddev": 0.006652230617500245,
      "median": 1.83433397748,
      "user": 0.8552451000000001,
      "system": 0.7330708599999999,
      "min": 1.82685793198,
      "max": 1.84660975198,
      "times": [
        1.84603033698,
        1.83545676498,
        1.8426428729800002,
        1.82685793198,
        1.83163703198,
        1.83271390898,
        1.84660975198,
        1.8315113279800002,
        1.8332111899799999,
        1.83667394498
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.82936562638,
      "stddev": 0.013940041426468382,
      "median": 1.83441334148,
      "user": 0.8563578999999999,
      "system": 0.7245865599999999,
      "min": 1.8037355099799999,
      "max": 1.84823960298,
      "times": [
        1.83445535998,
        1.84823960298,
        1.84461562798,
        1.83507605298,
        1.83437132298,
        1.81931046798,
        1.82490555698,
        1.83567142698,
        1.81327533498,
        1.8037355099799999
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.28333803838,
      "stddev": 0.0032364588450171953,
      "median": 0.28349611698,
      "user": 0.1877511,
      "system": 0.47786176,
      "min": 0.27734337298,
      "max": 0.28728599398,
      "times": [
        0.28561382298,
        0.28238637798,
        0.28140591098,
        0.28459347198,
        0.28239876197999997,
        0.27982713598,
        0.28728599398,
        0.28554207798,
        0.27734337298,
        0.28698345698
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.28050698488,
      "stddev": 0.010473955439640187,
      "median": 0.27590404898,
      "user": 0.1659384,
      "system": 0.48241806,
      "min": 0.27063738698,
      "max": 0.30016995198,
      "times": [
        0.29562548097999997,
        0.30016995198,
        0.27306256798,
        0.27063738698,
        0.27291504097999997,
        0.27712046598,
        0.28903060098,
        0.27470025498,
        0.27505144298,
        0.27675665498
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 323.3 ± 6.4 310.2 329.6 3.91 ± 0.10
pacquet@main 324.5 ± 8.8 314.7 342.7 3.93 ± 0.12
pnpr@HEAD 86.0 ± 1.7 82.5 89.1 1.04 ± 0.03
pnpr@main 82.6 ± 1.2 80.3 87.3 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.3233422319,
      "stddev": 0.006380215008282453,
      "median": 0.32564736460000004,
      "user": 0.3153087,
      "system": 0.05654818,
      "min": 0.31019146960000005,
      "max": 0.32957840560000007,
      "times": [
        0.32553612560000006,
        0.31019146960000005,
        0.32170373060000007,
        0.3234047346,
        0.32957840560000007,
        0.3274984416,
        0.3272321436,
        0.32575860360000003,
        0.32833424660000005,
        0.31418441760000004
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.3244948395000001,
      "stddev": 0.008784813795871474,
      "median": 0.3231689636,
      "user": 0.3205378,
      "system": 0.04846508,
      "min": 0.31469354260000004,
      "max": 0.34267984060000006,
      "times": [
        0.33363358060000003,
        0.34267984060000006,
        0.32594894960000004,
        0.31814799060000004,
        0.32547284860000003,
        0.31727999560000003,
        0.31711827160000006,
        0.32910829660000007,
        0.31469354260000004,
        0.3208650786
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.08598983954117648,
      "stddev": 0.001735419926204029,
      "median": 0.0863031611,
      "user": 0.01921928235294118,
      "system": 0.008885217647058826,
      "min": 0.0825068226,
      "max": 0.0890979856,
      "times": [
        0.0836799186,
        0.0861445436,
        0.0868310696,
        0.0842027776,
        0.0859004876,
        0.0870247126,
        0.0867749156,
        0.0854741286,
        0.08542827260000001,
        0.08646177860000001,
        0.08365071460000001,
        0.0874063676,
        0.0856306926,
        0.0825068226,
        0.08329654160000001,
        0.0869227016,
        0.0872685296,
        0.0869346446,
        0.08724827060000001,
        0.0878714686,
        0.08657225560000001,
        0.0890979856,
        0.08786159060000001,
        0.08543040760000001,
        0.0888984616,
        0.08524054160000001,
        0.08826567660000001,
        0.08800879660000001,
        0.0836097876,
        0.0854237146,
        0.0845352006,
        0.08297859660000001,
        0.0844322276,
        0.0866399426
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.082611771225,
      "stddev": 0.0012034753526118604,
      "median": 0.0823875391,
      "user": 0.018284056249999996,
      "system": 0.0084715225,
      "min": 0.08027728760000001,
      "max": 0.0872849296,
      "times": [
        0.0872849296,
        0.08540348660000001,
        0.08223125560000001,
        0.08329337560000001,
        0.08027728760000001,
        0.0835741806,
        0.0817217026,
        0.0822218386,
        0.08249660260000001,
        0.0828258496,
        0.0834667296,
        0.0813470606,
        0.0823996916,
        0.08234541960000001,
        0.08266107060000001,
        0.08206098760000001,
        0.0830453606,
        0.0823765986,
        0.0823622516,
        0.0825270196,
        0.0823516516,
        0.08224481060000001,
        0.0834895226,
        0.0819348506,
        0.0814465966,
        0.08257957760000001,
        0.0823293506,
        0.0826090336,
        0.0823984796,
        0.0817743206,
        0.0818403996,
        0.0826553866
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.481 ± 0.096 4.406 4.681 1.27 ± 0.05
pacquet@main 4.592 ± 0.213 4.407 4.877 1.30 ± 0.08
pnpr@HEAD 3.532 ± 0.134 3.434 3.801 1.00 ± 0.05
pnpr@main 3.526 ± 0.129 3.419 3.852 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.48058967826,
      "stddev": 0.09586502004204989,
      "median": 4.43597702006,
      "user": 1.6169983799999996,
      "system": 1.35312734,
      "min": 4.40554490906,
      "max": 4.68111634706,
      "times": [
        4.43068766806,
        4.43182130006,
        4.552304268059999,
        4.40804272706,
        4.40554490906,
        4.68111634706,
        4.44013274006,
        4.59973514906,
        4.41634828606,
        4.44016338806
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.592460559360001,
      "stddev": 0.21296649825422817,
      "median": 4.473144871560001,
      "user": 1.6510462799999999,
      "system": 1.37194284,
      "min": 4.4068015440599995,
      "max": 4.87661661306,
      "times": [
        4.40869694306,
        4.51353292006,
        4.41193017006,
        4.74813257606,
        4.8543042950599995,
        4.41420683006,
        4.85762687906,
        4.87661661306,
        4.4068015440599995,
        4.43275682306
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.5320084162599996,
      "stddev": 0.133826444542249,
      "median": 3.4660796655599997,
      "user": 1.16175788,
      "system": 1.20492184,
      "min": 3.43394259106,
      "max": 3.80149494706,
      "times": [
        3.7541974800599998,
        3.46287237006,
        3.46928696106,
        3.45725618106,
        3.45600817006,
        3.55357081406,
        3.43394259106,
        3.80149494706,
        3.45457457506,
        3.47688007306
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 3.5262728535599996,
      "stddev": 0.12929103110915108,
      "median": 3.47584071106,
      "user": 1.14592348,
      "system": 1.21694824,
      "min": 3.41935961706,
      "max": 3.85219513006,
      "times": [
        3.47118901406,
        3.5228115020599997,
        3.85219513006,
        3.41935961706,
        3.53640116506,
        3.48049240806,
        3.62769377706,
        3.44843069706,
        3.44233976806,
        3.4618154570599997
      ]
    }
  ]
}

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branchpr/13158
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,660.51 ms
(-0.45%)Baseline: 2,672.63 ms
3,207.16 ms
(82.96%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
1,826.86 ms
(-0.37%)Baseline: 1,833.58 ms
2,200.30 ms
(83.03%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
538.25 ms
(+0.69%)Baseline: 534.55 ms
641.46 ms
(83.91%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
310.19 ms
(-3.56%)Baseline: 321.63 ms
385.96 ms
(80.37%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,339.31 ms
(-1.25%)Baseline: 2,368.98 ms
2,842.77 ms
(82.29%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
4,405.54 ms
(-0.66%)Baseline: 4,434.68 ms
5,321.61 ms
(82.79%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
243.17 ms
(-0.49%)Baseline: 244.36 ms
293.23 ms
(82.93%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branchpr/13158
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,387.81 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
277.34 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
284.61 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
82.51 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,388.75 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
3,433.94 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
250.55 ms
🐰 View full continuous benchmarking report in Bencher

Copilot AI review requested due to automatic review settings July 19, 2026 20:22

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 Jul 19, 2026
Copilot AI review requested due to automatic review settings July 19, 2026 20:26

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.

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

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 5544af6

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
pnpm/crates/config/src/workspace_yaml.rs (1)

1-1: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Preserve explicit HTTP proxies from lower-priority configuration layers.

WorkspaceSettings::apply_proxy_to unconditionally overwrites an already-set http_proxy with https_proxy whenever the current layer defines https_proxy but no http_proxy. To align with pnpm's configuration precedence, the HTTPS fallback should only occur when http_proxy has not been explicitly set by any layer.

  • pnpm/crates/config/src/workspace_yaml.rs#L978-996: Add http_proxy_is_explicit: bool to the signature and gate the https_proxy fallback on !http_proxy_is_explicit.
  • pnpm/crates/config/src/workspace_yaml.rs#L774-775: Pass config.http_proxy_is_explicit to self.apply_proxy_to(...).
  • pnpm/crates/config/src/lib.rs#L2204-2205: Pass self.package_manager_bootstrap.http_proxy_is_explicit to global_settings.apply_proxy_to(...).
  • pnpm/crates/config/src/lib.rs#L2346-2346: Pass self.package_manager_bootstrap.http_proxy_is_explicit to env_settings.apply_proxy_to(...).
🐛 Proposed fixes

For pnpm/crates/config/src/workspace_yaml.rs:

-    pub fn apply_to(self, config: &mut Config, base_dir: &Path) {
-        self.apply_proxy_to(&mut config.proxy);
+    pub fn apply_to(self, config: &mut Config, base_dir: &Path) {
+        self.apply_proxy_to(&mut config.proxy, config.http_proxy_is_explicit);
-    pub(crate) fn apply_proxy_to(&self, proxy_config: &mut pacquet_network::ProxyConfig) {
+    pub(crate) fn apply_proxy_to(
+        &self,
+        proxy_config: &mut pacquet_network::ProxyConfig,
+        http_proxy_is_explicit: bool,
+    ) {
         if let Some(value) = self.https_proxy.as_ref().or(self.proxy.as_ref()) {
             proxy_config.https_proxy = Some(value.clone());
         }
         if let Some(value) = &self.http_proxy {
             proxy_config.http_proxy = Some(value.clone());
-        } else if self.https_proxy.is_some() || self.proxy.is_some() {
+        } else if (self.https_proxy.is_some() || self.proxy.is_some()) && !http_proxy_is_explicit {
             proxy_config.http_proxy.clone_from(&proxy_config.https_proxy);
         }
         if let Some(value) = self.no_proxy.as_ref().or(self.noproxy.as_ref()) {

For pnpm/crates/config/src/lib.rs:

         if let Some(global_settings) = global_settings.as_ref() {
             self.package_manager_bootstrap.http_proxy_is_explicit |=
                 has_nonempty_string(global_settings.http_proxy.as_deref());
-            global_settings.apply_proxy_to(&mut self.package_manager_bootstrap.proxy);
+            global_settings.apply_proxy_to(
+                &mut self.package_manager_bootstrap.proxy,
+                self.package_manager_bootstrap.http_proxy_is_explicit,
+            );
         }
         self.http_proxy_is_explicit |= env_http_proxy_is_explicit;
         self.package_manager_bootstrap.http_proxy_is_explicit |= env_http_proxy_is_explicit;
         collect_explicit_settings(&mut self.explicit_settings, &env_settings);
-        env_settings.apply_proxy_to(&mut self.package_manager_bootstrap.proxy);
+        env_settings.apply_proxy_to(
+            &mut self.package_manager_bootstrap.proxy,
+            self.package_manager_bootstrap.http_proxy_is_explicit,
+        );
🤖 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/config/src/workspace_yaml.rs` at line 1, Update
WorkspaceSettings::apply_proxy_to to accept an http_proxy_is_explicit boolean
and only use the current layer’s https_proxy as an http_proxy fallback when it
is false. Pass config.http_proxy_is_explicit from the workspace call site, and
pass self.package_manager_bootstrap.http_proxy_is_explicit in the
global_settings and env_settings apply_proxy_to calls.
🧹 Nitpick comments (1)
pnpm/crates/testing-utils/src/fixtures.rs (1)

4-26: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Restore rustdoc comments for public API contracts.

When minimal_tarball was extracted from tarball_url_dependency.rs, its descriptive rustdoc comment was removed. As per coding guidelines, public API contracts should use rustdoc comments. Please restore the comment for minimal_tarball and add one for the newly introduced sha512_integrity helper.

📝 Proposed documentation
-#[must_use]
-pub fn minimal_tarball(name: &str, version: &str) -> Vec<u8> {
+/// Builds a minimal valid gzipped tarball bytes containing a `package.json`
+/// with the given `name` and `version`.
+#[must_use]
+pub fn minimal_tarball(name: &str, version: &str) -> Vec<u8> {
     use std::io::Write;
 
     let manifest = serde_json::json!({ "name": name, "version": version }).to_string();
     let manifest = manifest.as_bytes();
     let mut builder = tar::Builder::new(Vec::new());
     let mut header = tar::Header::new_gnu();
     header.set_path("package/package.json").expect("set tar entry path");
     header.set_size(manifest.len() as u64);
     header.set_mode(0o644);
     header.set_cksum();
     builder.append(&header, manifest).expect("append package.json to tar");
     let tar_bytes = builder.into_inner().expect("finish tar");
 
     let mut encoder = flate2::write::GzEncoder::new(Vec::new(), flate2::Compression::default());
     encoder.write_all(&tar_bytes).expect("gzip tar");
     encoder.finish().expect("finish gzip")
 }
 
+/// Computes an SSRI SHA-512 integrity string for the provided byte slice.
 #[must_use]
 pub fn sha512_integrity(bytes: &[u8]) -> String {
🤖 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/testing-utils/src/fixtures.rs` around lines 4 - 26, Add rustdoc
comments directly above the public functions minimal_tarball and
sha512_integrity. Restore minimal_tarball’s descriptive contract from its former
location and document sha512_integrity’s purpose and returned SHA-512 integrity
format, without changing their implementations.

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.

Outside diff comments:
In `@pnpm/crates/config/src/workspace_yaml.rs`:
- Line 1: Update WorkspaceSettings::apply_proxy_to to accept an
http_proxy_is_explicit boolean and only use the current layer’s https_proxy as
an http_proxy fallback when it is false. Pass config.http_proxy_is_explicit from
the workspace call site, and pass
self.package_manager_bootstrap.http_proxy_is_explicit in the global_settings and
env_settings apply_proxy_to calls.

---

Nitpick comments:
In `@pnpm/crates/testing-utils/src/fixtures.rs`:
- Around line 4-26: Add rustdoc comments directly above the public functions
minimal_tarball and sha512_integrity. Restore minimal_tarball’s descriptive
contract from its former location and document sha512_integrity’s purpose and
returned SHA-512 integrity format, without changing their implementations.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 5c26dc67-c068-4a53-b4d4-c17d4fb65354

📥 Commits

Reviewing files that changed from the base of the PR and between b25e845 and 5544af6.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock, !Cargo.lock
📒 Files selected for processing (20)
  • .changeset/tidy-wolves-proxy.md
  • pnpm/crates/cli/src/cli_args/cli_command.rs
  • pnpm/crates/cli/src/cli_args/config/tests.rs
  • pnpm/crates/cli/src/cli_args/dispatch.rs
  • pnpm/crates/cli/src/cli_args/tests.rs
  • pnpm/crates/cli/src/config_overrides.rs
  • pnpm/crates/cli/src/config_overrides/tests.rs
  • pnpm/crates/cli/tests/auth.rs
  • pnpm/crates/cli/tests/tarball_url_dependency.rs
  • pnpm/crates/config/src/env_overlay.rs
  • pnpm/crates/config/src/lib.rs
  • pnpm/crates/config/src/npmrc_auth.rs
  • pnpm/crates/config/src/tests.rs
  • pnpm/crates/config/src/workspace_yaml.rs
  • pnpm/crates/config/src/workspace_yaml/tests.rs
  • pnpm/crates/network/src/tests.rs
  • pnpm/crates/package-manager/src/install_package_from_registry/tests.rs
  • pnpm/crates/testing-utils/Cargo.toml
  • pnpm/crates/testing-utils/src/fixtures.rs
  • pnpm/plans/TEST_PORTING.md

Copilot AI review requested due to automatic review settings July 19, 2026 20:46

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.

@zkochan

zkochan commented Jul 19, 2026

Copy link
Copy Markdown
Member Author

Addressed the outside-diff CodeRabbit findings in 83f13015eb:

  • YAML proxy application now preserves an explicit HTTP proxy from lower-priority npmrc/global/workspace layers when a higher layer sets only HTTPS proxy, across normal and bootstrap configs.
  • Added global, workspace, and PNPM_CONFIG_HTTPS_PROXY regression coverage; disabling the provenance guard makes all three tests fail.
  • Restored the public contracts for the shared tarball and integrity fixtures.

Validated with the 21 proxy-related config tests, focused Clippy, repository-wide Dylint, and the full pre-push suite.


Written by an agent (Codex, GPT-5).

Comment thread .changeset/tidy-wolves-proxy.md Resolved
@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 83f1301

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

@zkochan
zkochan merged commit 5e0788a into main Jul 19, 2026
33 checks passed
@zkochan
zkochan deleted the stage-6 branch July 19, 2026 20:53
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