Skip to content

fix(git-fetcher): say which dependency a git clone failed for, and how to fix it - #13759

Merged
zkochan merged 5 commits into
mainfrom
git-fetch-error-hint
Aug 10, 2026
Merged

zkochan merged 5 commits into
mainfrom
git-fetch-error-hint

Conversation

@zkochan

@zkochan zkochan commented Aug 10, 2026 •

Copy link
Copy Markdown
Member

Summary

Follow-up to closing pnpm/pnpm#13747. The resolver bug behind pnpm/pnpm#13743 is fixed and the reporter's lockfile has a supported repair (pnpm update <the git deps>) — what was missing is any way to find that out from the failure. This PR fixes the message, not the behavior: nothing changes about what gets fetched.

The failure the reporter hit was a raw execa error:

[ERROR] Command failed with exit code 128: git clone '[email protected]:logux/client.git' /home/runner/setup-pnpm/node_modules/.bin/store/v11/tmp/_tmp_aPUZzB

Cloning into '...'...
ssh: connect to host github.com port 22: Connection refused
fatal: Could not read from remote repository.

No package name, no pnpm error code, and no indication that the SSH URL came from a lockfile entry written before pnpm/pnpm#13290 shipped — the actual cause, and one the resolver fix can't reach retroactively because resolution is skipped while the lockfile is up to date.

Now (verified end-to-end, TypeScript CLI on the left, pacquet identical):

[ERR_PNPM_GIT_FETCH_FAILED] Failed to fetch "@logux/core" from the git repository
"[email protected]:logux/core.git": fatal: Could not read from remote repository.
...

The lockfile records an SSH remote for this dependency, so fetching it needs an SSH key
for github.com.

If its specifier does not ask for SSH (for example "github:owner/repo"), the lockfile
entry was written before pnpm v11.21 and can be re-recorded over HTTPS:

    pnpm update @logux/core

"pnpm install --force" and "pnpm install --resolution-only" do not re-resolve git
dependencies, so neither clears it.

Notes on the details:

  • Naming the package is the part that matters most in a workspace — the reporter's repo has four git dependencies across eight projects, and the old error identified none of them. The fetcher gets it from opts.pkg.name (TypeScript) / package_key.name (pacquet); a git dep's package_id is the bare git+…#<commit> and carries no name.
  • The --force / --resolution-only line is not padding. I measured all four commands against a poisoned lockfile: only pnpm update clears the SSH entry. The git resolver returns currentPkg's existing resolution unless update is set, so --resolution-only does not re-run resolution for git deps despite what its help says. Without that line the hint sends people to the two flags that look right and do nothing.
  • Only the transport-touching steps are restated (init / remote / clone / fetch). A failing checkout or rev-parse says nothing about reaching the remote, and its own error already describes it.
  • The SSH hint is attached whenever the recorded remote is an SSH URL, not gated on parsing git's stderr for an auth failure — that would be brittle, and "check your key for this host" is right for any SSH transport failure.
  • pacquet splits Fetch / FetchOverSsh into two variants sharing one code, purely so the derived Diagnostic can carry the help only where it applies.

Left deliberately alone: --resolution-only not honouring its help text for git deps. It's a real bug but a separate one, and noted on the issue.

Squash Commit Body

The failure the reporter of pnpm/pnpm#13743 hit surfaced as a raw execa
error: "Command failed with exit code 128: git clone '[email protected]:...'
/home/runner/.../_tmp_aPUZzB". It named no package, carried no pnpm error
code, and gave no indication that the SSH URL came from a lockfile written
before pnpm/pnpm#13290 shipped - the actual cause, and one the resolver fix
cannot reach retroactively because resolution is skipped while the lockfile
is up to date.

A failed clone or shallow fetch is now ERR_PNPM_GIT_FETCH_FAILED, naming the
package the resolution belongs to. When the recorded remote is an SSH URL,
the error also carries a hint: fetching needs a key for that host, an entry
written before v11.21 can be re-recorded over HTTPS with pnpm update, and
--force / --resolution-only will not do it (the git resolver returns the
locked resolution unless update is set).

Only the transport-touching steps are restated. A failing checkout or
rev-parse says nothing about reaching the remote.

Nothing changes about what gets fetched.

Related to pnpm/pnpm#13743.

Checklist

  • I checked the referenced issue and verified that none of the PRs
    already linked to it solves it.
  • 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.

Written by an agent (Claude Code, claude-opus-5[1m]).


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

  • Bug Fixes
    • Improved Git dependency fetch errors by identifying the affected package and repository.
    • Added clearer SSH-specific guidance, including SSH key requirements and instructions for correcting stale lockfile entries with pnpm update.
    • HTTPS fetch failures now provide relevant error details without displaying SSH-only guidance.
    • Sensitive repository credentials are now redacted from multiline error messages.
    • Added clearer messaging when Git is not installed or cannot be found.

…w to fix it

The failure the reporter of #13743 hit surfaced as a raw execa
error: "Command failed with exit code 128: git clone '[email protected]:...'
/home/runner/.../_tmp_aPUZzB". It named no package, carried no pnpm error
code, and gave no indication that the SSH URL came from a lockfile written
before #13290 shipped - the actual cause, and one the resolver fix
cannot reach retroactively because resolution is skipped while the lockfile
is up to date.

A failed clone or shallow fetch is now ERR_PNPM_GIT_FETCH_FAILED, naming the
package the resolution belongs to. When the recorded remote is an SSH URL,
the error also carries a hint: fetching needs a key for that host, an entry
written before v11.21 can be re-recorded over HTTPS with pnpm update, and
--force / --resolution-only will not do it (the git resolver returns the
locked resolution unless update is set).

Only the transport-touching steps are restated. A failing checkout or
rev-parse says nothing about reaching the remote.

Related to #13743.
…lper

The inline .catch() left the awaited value as GitFetcherResult | PnpmError,
which the repo-wide lint:ts pass rejects even though the per-package build
accepted it.
Copilot AI lite review requested due to automatic review settings August 10, 2026 10:30

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 10, 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: df73e8b0-f83b-4830-a55d-f722f22dc073

📥 Commits

Reviewing files that changed from the base of the PR and between c712691 and fa64639.

📒 Files selected for processing (4)
  • .changeset/git-fetch-failure-hint.md
  • pnpm/crates/git-fetcher/src/fetcher/tests.rs
  • pnpm11/fetching/git-fetcher/src/index.ts
  • pnpm11/fetching/git-fetcher/test/index.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • .changeset/git-fetch-failure-hint.md
  • pnpm11/fetching/git-fetcher/test/index.ts
  • pnpm11/fetching/git-fetcher/src/index.ts

📝 Walkthrough

Walkthrough

Git fetchers now report package-aware ERR_PNPM_GIT_FETCH_FAILED errors. SSH failures include host details and remediation guidance. Rust and TypeScript implementations sanitize failure output, parse SSH hosts, wire package names, and add tests and patch release notes.

Changes

Git fetch diagnostics

Layer / File(s) Summary
Multiline error sanitization
pnpm/crates/network/src/auth.rs, pnpm/crates/network/src/auth/tests.rs, pnpm/crates/network/src/lib.rs, pnpm11/core/error/src/index.ts, pnpm11/core/error/test/index.ts
Sanitization preserves safe line breaks and collapses output when multiline credential redaction could expose credentials.
Rust fetch error classification
pnpm/crates/git-fetcher/src/error.rs, pnpm/crates/git-fetcher/src/fetcher.rs, pnpm/crates/deps-restorer/src/install_package_by_snapshot.rs, pnpm/crates/git-fetcher/src/fetcher/tests.rs, pnpm/crates/git-fetcher/Cargo.toml
Transport failures now include package, repository, stderr, and SSH host details when applicable. The install path supplies the package name. Tests cover host parsing and SSH versus HTTPS failures.
TypeScript fetch diagnostics and release notes
pnpm11/fetching/git-fetcher/src/index.ts, pnpm11/fetching/git-fetcher/test/index.ts, .changeset/git-fetch-failure-hint.md
TypeScript fetch failures include sanitized details, missing-git handling, and conditional SSH remediation. Tests cover IPv6 hosts, credential redaction, and error codes. Patch release notes document the changes.

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

Sequence Diagram(s)

sequenceDiagram
  participant PackageInstall
  participant GitFetcher
  participant Git
  participant ErrorReporter
  PackageInstall->>GitFetcher: fetch package repository
  GitFetcher->>Git: clone or fetch
  Git-->>GitFetcher: success or transport failure
  GitFetcher->>ErrorReporter: report sanitized package-aware error
Loading

Possibly related PRs

  • pnpm/pnpm#13059: Modifies Git dependency resolution and package-name propagation.
  • pnpm/pnpm#13726: Shares SSH URL and host parsing, including bracketed IPv6 and scp-style references.
  • pnpm/pnpm#13747: Also modifies SSH failure handling in the Git fetchers.

Suggested labels: product: pacquet, product: pnpm@11

✨ 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 git-fetch-error-hint

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


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(git-fetcher): include package name + SSH lockfile remediation on clone failures

🐞 Bug fix 🧪 Tests 📝 Documentation 🕐 20-40 Minutes

Grey Divider

AI Description

• Wrap git clone/shallow-fetch failures in ERR_PNPM_GIT_FETCH_FAILED with dependency name.
• Add SSH-specific hint explaining required keys and the lockfile re-record fix via pnpm update.
• Add Rust+TS regression tests covering SSH vs HTTPS failure messaging.
Diagram

graph TD
  A["pnpm deps-restorer"] --> B["Rust git-fetcher"] --> C["git CLI"] --> D["ERR_PNPM_GIT_FETCH_FAILED"]
  E["pnpm11 TS git-fetcher"] --> C --> D
  F["changeset release note"] --> D
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Auto-rewrite SSH lockfile entries during install
  • ➕ Resolves the failure without requiring a follow-up pnpm update
  • ➕ Reduces user confusion for legacy lockfiles
  • ➖ Behavior change with risk: could unexpectedly change transport/security expectations
  • ➖ Needs careful gating (only when specifier implies HTTPS) and lockfile write permissions
2. Warn earlier during lockfile validation/resolution
  • ➕ Surfaces the root cause before attempting git operations
  • ➕ Could point to remediation without waiting for a transport error
  • ➖ Harder to guarantee correctness because resolution is skipped when lockfile is current
  • ➖ Still needs package attribution plumbing to be actionable
3. Share one SSH-host parser/hint generator across Rust and TS
  • ➕ Reduces drift between implementations
  • ➕ Single source of truth for edge cases (scp-like refs, ports, Windows paths)
  • ➖ Non-trivial cross-language sharing; likely more complexity than benefit for small logic

Recommendation: Current approach is the best tradeoff for a follow-up fix: it keeps behavior unchanged, makes the failing dependency immediately identifiable, and provides a proven remediation path (pnpm update) only when the lockfile remote is SSH. Consider the auto-rewrite option only if the project wants an explicit behavior change in a future PR.

Files changed (7) +350 / -8

Bug fix (4) +154 / -7
install_package_by_snapshot.rsThread package name into Rust GitFetcher calls +2/-0

Thread package name into Rust GitFetcher calls

• Captures the dependency name from the package key and passes it into the Rust GitFetcher. Enables downstream error reporting to name the dependency associated with a git transport failure.

pnpm/crates/deps-restorer/src/install_package_by_snapshot.rs

error.rsAdd ERR_PNPM_GIT_FETCH_FAILED error variants with SSH-specific help +33/-0

Add ERR_PNPM_GIT_FETCH_FAILED error variants with SSH-specific help

• Adds Fetch and FetchOverSsh variants to report transport failures with package and repo context. FetchOverSsh includes a diagnostic help message describing SSH key requirements and the pnpm update remediation for pre-v11.21 lockfile entries.

pnpm/crates/git-fetcher/src/error.rs

fetcher.rsMap transport GitExec failures to named Fetch/FetchOverSsh errors +52/-1

Map transport GitExec failures to named Fetch/FetchOverSsh errors

• Extends GitFetcher with package_name and wraps init/remote/clone/fetch failures into ERR_PNPM_GIT_FETCH_FAILED. Adds SSH host detection for ssh:// and scp-like remotes to decide when to attach remediation guidance.

pnpm/crates/git-fetcher/src/fetcher.rs

index.tsWrap git clone/fetch failures as ERR_PNPM_GIT_FETCH_FAILED with hint +67/-6

Wrap git clone/fetch failures as ERR_PNPM_GIT_FETCH_FAILED with hint

• Adds try/catch around init/remote/fetch/clone and throws a PnpmError with code GIT_FETCH_FAILED and package context when available. Adds logic to extract a concise failure detail and to generate an SSH remediation hint for legacy lockfile SSH remotes.

pnpm11/fetching/git-fetcher/src/index.ts

Tests (2) +189 / -1
tests.rsAdd SSH host parsing and transport-failure regression tests (Rust) +120/-1

Add SSH host parsing and transport-failure regression tests (Rust)

• Updates existing test fixtures to supply package_name. Adds unit tests for ssh_repo_host parsing and integration-style tests using a failing git shim to assert FetchOverSsh vs Fetch behavior.

pnpm/crates/git-fetcher/src/fetcher/tests.rs

index.tsAdd TS tests asserting package-naming and SSH/HTTPS hint behavior +69/-0

Add TS tests asserting package-naming and SSH/HTTPS hint behavior

• Introduces new Jest tests covering SSH clone failures (must include dependency name and hint) and HTTPS failures (no hint). Adds a typed helper to capture the failing error and a helper to disable SSH via GIT_SSH_COMMAND.

pnpm11/fetching/git-fetcher/test/index.ts

Documentation (1) +7 / -0
git-fetch-failure-hint.mdAdd changeset documenting git fetch failure naming and SSH remediation +7/-0

Add changeset documenting git fetch failure naming and SSH remediation

• Introduces a patch changeset for @pnpm/fetching.git-fetcher, pacquet, and pnpm. Describes the new ERR_PNPM_GIT_FETCH_FAILED messaging and the pnpm update remediation for legacy SSH lockfile entries.

.changeset/git-fetch-failure-hint.md

@greptile-apps

greptile-apps Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Reviews (2): Last reviewed commit: "fix(git-fetcher): keep the fallback deta..." | Re-trigger Greptile

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

🧹 Nitpick comments (1)
pnpm11/fetching/git-fetcher/src/index.ts (1)

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

Use string operations for the fixed prefix.

The git+ prefix is fixed text. Replace the regular expression with startsWith() and slice().

As per coding guidelines, “Prefer plain string operations over custom regular expressions.”

Proposed refactor
-  const sshUrl = repo.replace(/^git\+/, '')
+  const sshUrl = repo.startsWith('git+') ? repo.slice(4) : repo
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm11/fetching/git-fetcher/src/index.ts` at line 135, Update the repo URL
normalization near sshUrl to use startsWith('git+') and slice() to remove the
fixed prefix, preserving URLs that do not begin with git+ and avoiding the
regular expression.

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/git-fetcher/src/fetcher.rs`:
- Around line 226-230: Update the SSH authority parsing in the fetcher’s
repository-host extraction logic to preserve bracketed IPv6 hosts, extracting
the complete [2001:db8::1] value before removing an optional port while
retaining existing userinfo and hostname handling. Add matching Rust and
TypeScript parity tests covering bracketed IPv6 SSH URLs and verify both
implementations produce identical user-visible host values.

In `@pnpm/crates/git-fetcher/src/fetcher/tests.rs`:
- Around line 1293-1300: Extend the SSH and HTTPS failure tests around
GitFetcherError to assert the public diagnostic contract: Diagnostic::code()
equals ERR_PNPM_GIT_FETCH_FAILED, err.to_string() includes the package and
repository context, and SSH output includes the rendered remediation help. Log
the multiline SSH help before asserting equality, and verify the HTTPS error has
no help.

In `@pnpm11/fetching/git-fetcher/src/index.ts`:
- Around line 100-103: Update gitFailureDetail so it falls back to err.message
when the trimmed stderr is empty, not only when stderr is nullish. Preserve the
trimmed stderr when it contains meaningful text.
- Around line 45-46: Sanitize all Git-controlled values before constructing the
GIT_FETCH_FAILED PnpmError: apply the existing display-boundary
credentials/control-character sanitizer to resolution.repo,
gitFailureDetail(err), and the value returned by sshRemediationHint. Ensure both
the error message and hint passed to PnpmError are sanitized before printError
displays them.

In `@pnpm11/fetching/git-fetcher/test/index.ts`:
- Around line 351-395: Add a gitShallowHosts regression test in
pnpm11/fetching/git-fetcher/test/index.ts around lines 351-395 that forces git
fetch to fail and verifies ERR_PNPM_GIT_FETCH_FAILED, package context, and the
expected SSH hint behavior. Update .changeset/git-fetch-failure-hint.md line 7
to describe both clone and shallow fetch failures instead of clone failures
only.

---

Nitpick comments:
In `@pnpm11/fetching/git-fetcher/src/index.ts`:
- Line 135: Update the repo URL normalization near sshUrl to use
startsWith('git+') and slice() to remove the fixed prefix, preserving URLs that
do not begin with git+ and avoiding the regular expression.
🪄 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: 7aaa2b27-45c0-4b88-9650-1b99d47873be

📥 Commits

Reviewing files that changed from the base of the PR and between 9463e98 and 23d30d4.

📒 Files selected for processing (7)
  • .changeset/git-fetch-failure-hint.md
  • pnpm/crates/deps-restorer/src/install_package_by_snapshot.rs
  • pnpm/crates/git-fetcher/src/error.rs
  • pnpm/crates/git-fetcher/src/fetcher.rs
  • pnpm/crates/git-fetcher/src/fetcher/tests.rs
  • pnpm11/fetching/git-fetcher/src/index.ts
  • pnpm11/fetching/git-fetcher/test/index.ts

Comment thread pnpm/crates/git-fetcher/src/fetcher.rs Resolved
@qodo-code-review

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

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Action required

1. Unredacted fetch diagnostics ✓ Resolved 🐞 Bug ⛨ Security
Description
The new git-fetch failure paths in both pacquet-git-fetcher (Rust) and pnpm11 (TS) capture and later
display the repo URL and raw git stderr/detail without redaction or control-character sanitization,
enabling credential leakage (userinfo in URLs) and ANSI/control-character injection in diagnostics
and CI logs. This is inconsistent with existing code that already uses
redact_and_sanitize/redactAndSanitize for git/subprocess errors but does not apply it in these new
code paths.
Code

pnpm/crates/git-fetcher/src/fetcher.rs[R210-213]

+    let host = ssh_repo_host(repo).map(str::to_string);
+    let (package, repo, stderr) =
+        (package.to_string(), repo.to_string(), stderr.trim().to_string());
+    match host {
Relevance

●●● Strong

Repo has strong accepted precedent to redact/sanitize git-related error output to prevent
leaks/injection.

PR-#13230

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
In the Rust implementation, the new GitFetcherError::Fetch{..} / FetchOverSsh{..} variants store
repo and stderr that are later rendered in user-facing diagnostics, and name_fetch_failure()
populates these fields directly (only trimming stderr) without applying any sanitizer/redactor. In
the pnpm11 TypeScript implementation, the new catch block constructs a
PnpmError('GIT_FETCH_FAILED', ...) whose message and hint interpolate raw resolution.repo and
raw stderr/message detail (via gitFailureDetail(err)) without sanitization. Both repositories
already define and use helpers (pacquet_network::redact_and_sanitize() / redactAndSanitize())
specifically to strip control characters and redact URL credentials in git-related error output,
demonstrating that these new unsanitized interpolations are a regression against established safety
practices.

pnpm/crates/git-fetcher/src/fetcher.rs[195-216]
pnpm/crates/git-fetcher/src/error.rs[47-96]
pnpm/crates/network/src/auth.rs[784-800]
pnpm/crates/cli/src/github_actions.rs[197-203]
pnpm11/fetching/git-fetcher/src/index.ts[29-48]
pnpm11/fetching/git-fetcher/src/index.ts[98-103]
pnpm11/core/error/src/index.ts[104-123]
pnpm11/deps/github-actions/src/index.ts[172-178]
PR-#13230

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

## Issue description
New git-fetch failure error construction paths are storing and interpolating untrusted `repo` URLs and raw git stderr/detail without applying the project’s existing redaction/sanitization helpers, which can leak URL credentials (e.g., `user:pass@`) and allow control-character/ANSI injection into terminal/CI diagnostics.

## Issue Context
- In pacquet-git-fetcher (Rust), `name_fetch_failure()` maps transport failures into `GitFetcherError::Fetch{..}` / `FetchOverSsh{..}` by copying `repo` and `stderr` verbatim (only `.trim()` on stderr), and those fields are later displayed to users.
- In pnpm11 (TypeScript), the `ERR_PNPM_GIT_FETCH_FAILED` error message/hint interpolates raw `resolution.repo` and raw failure detail from `gitFailureDetail(err)`.
- The codebase already provides helpers designed for this exact problem: `pacquet_network::redact_and_sanitize()` (Rust) and `redactAndSanitize()` (TS), and they are used elsewhere for git-related errors to prevent credential leakage and control characters from reaching output.

## Fix Focus Areas
- pnpm/crates/git-fetcher/src/fetcher.rs[195-238]
- pnpm/crates/git-fetcher/src/error.rs[47-96]
- pnpm/crates/git-fetcher/Cargo.toml[13-29]
- pnpm/crates/network/src/auth.rs[784-800]
- pnpm11/fetching/git-fetcher/src/index.ts[34-149]
- pnpm11/core/error/src/index.ts[104-123]
- pnpm11/deps/github-actions/src/index.ts[172-178]

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



Informational

2. Extra per-git-dep allocation 🐞 Bug ➹ Performance
Description
The deps-restorer now allocates package_key.name.to_string() for every git dependency install to
pass package_name into the Rust GitFetcher, even though it’s only needed to enrich errors on the
failure path. This adds small but unnecessary allocation overhead in the install flow.
Code

pnpm/crates/deps-restorer/src/install_package_by_snapshot.rs[R605-608]

                let built = !config.ignore_scripts;
                let files_index_file = git_hosted_store_index_key(&package_id, built);
+                let package_name = package_key.name.to_string();
                let GitFetchOutput { cas_paths, built: _built } = GitFetcher {
Relevance

●● Moderate

Team sometimes rejects micro-optimizing away to_string allocations; precedent shows perf-allocation
suggestions often rejected.

PR-#13368
PR-#13455

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new package_name String is created unconditionally in the git-resolution branch and then only
used to populate the new GitFetcher::package_name field, which exists to identify the dependency
in error messages.

pnpm/crates/deps-restorer/src/install_package_by_snapshot.rs[601-624]
pnpm/crates/git-fetcher/src/fetcher.rs[55-66]

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

### Issue description
`InstallPackageBySnapshot` clones the package name into a new `String` unconditionally for git resolutions (`package_key.name.to_string()`), even though it’s only used to improve error reporting when fetch fails.

### Issue Context
This runs on the install path for each git dependency. The cost is minor relative to cloning/fetching, but it’s still avoidable allocation churn.

### Fix Focus Areas
- pnpm/crates/deps-restorer/src/install_package_by_snapshot.rs[601-631]
- pnpm/crates/git-fetcher/src/fetcher.rs[33-85]

### Possible fixes
- Restructure to borrow `package_key.name` (`&str`) without cloning by ensuring `package_key` is not used across the `await` while the borrow is held (e.g., split the git-fetch branch into its own helper so the borrow ends before later uses).
- Alternatively, change the fetcher API to accept something like `Option<Cow<'a, str>>` or a lazy name provider, so the owned allocation happens only when constructing the error variant on failure.

(Keeping the current allocation is also reasonable if the lifetime/borrow constraints make the refactor invasive; this is a micro-optimization.)

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


3. Rust comments mention old versions ✓ Resolved 📘 Rule violation ⚙ Maintainability
Description
New Rust and TypeScript inline docs/comments use historical, version- or fix-tied phrasing (e.g.,
lockfile written before pnpm v11.21 / predating a resolver fix) instead of describing the current
contract. This violates rule 772199 and risks the documentation becoming stale as behavior and
versions evolve.
Code

pnpm/crates/git-fetcher/src/error.rs[R77-80]

+    /// A lockfile written before pnpm v11.21 could record an SSH URL for
+    /// a dependency whose specifier never asked for SSH, and resolution
+    /// is skipped while that lockfile stays up to date — so the entry
+    /// survives the upgrade that fixed it and the install keeps failing
Relevance

● Weak

Very similar “remove historical version phrasing in doc comments” suggestion was explicitly rejected
previously.

PR-#13662
PR-#13669

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Rule 772199 requires inline comments to describe current behavior only and forbids
historical/temporal phrasing; the cited Rust doc comments and TypeScript JSDoc/test comment
explicitly frame behavior around past versions and fixes using phrases like "written before pnpm
v11.21" and "predates the resolver fix," demonstrating that the added commentary is historical
implementation/migration narrative rather than a description of the present guarantees.

Rule 772199: Comments must describe current behavior, not historical implementations
pnpm/crates/git-fetcher/src/error.rs[77-81]
pnpm/crates/git-fetcher/src/fetcher/tests.rs[1277-1279]
pnpm11/fetching/git-fetcher/src/index.ts[105-113]
pnpm11/fetching/git-fetcher/test/index.ts[352-354]

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

## Issue description
New/modified Rust and TypeScript comments/JSDoc include historical phrasing (e.g., "written before pnpm v11.21", "predates the resolver fix"), which repo rule 772199 disallows for inline source comments because they should describe only the current behavior/contract.

## Issue Context
Inline comments/docstrings should be rewritten to state the present guarantees and behavior without embedding version timelines or historical rationale; if additional explanation is needed, keep remediation guidance in user-facing error/hint text, and move any historical/migration narrative to the PR description or external documentation.

## Fix Focus Areas
- pnpm/crates/git-fetcher/src/error.rs[77-81]
- pnpm/crates/git-fetcher/src/fetcher/tests.rs[1277-1279]
- pnpm11/fetching/git-fetcher/src/index.ts[105-113]
- pnpm11/fetching/git-fetcher/test/index.ts[352-354]

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


Grey Divider

Context used
✅ Compliance rules (platform): 26 rules

Grey Divider

Tip of the day
💡 Did you know, you can reply 'qodo' on any finding to push back, ask questions, or dig deeper

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread pnpm/crates/git-fetcher/src/fetcher.rs Resolved
@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 10, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.12%. Comparing base (9463e98) to head (fa64639).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13759      +/-   ##
==========================================
- Coverage   88.12%   88.12%   -0.01%     
==========================================
  Files         622      622              
  Lines      101125   101169      +44     
==========================================
+ Hits        89118    89154      +36     
- Misses      12007    12015       +8     

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

@github-actions

github-actions Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                                            main                                   pr
-----                                            ----                                   --
lockfile/parse_pnpm_lock                         1.00     11.8±1.22ms    31.7 MB/sec    1.01     11.9±0.43ms    31.4 MB/sec
packument/parse                                  1.00     39.5±1.20µs  1680.3 MB/sec    1.00     39.6±1.12µs  1676.4 MB/sec
tarball/download_dependency                      1.01      3.1±0.21ms  1388.4 KB/sec    1.00      3.1±0.33ms  1405.6 KB/sec
tarball_batch/cold_store_many_medium_tarballs    1.06    182.7±4.07ms 87.6 KElem/sec    1.00    171.8±5.20ms 93.1 KElem/sec
workspace_resolution/hoist_heavy                 1.00    237.8±5.45ms        ? ?/sec    1.14    270.9±5.56ms        ? ?/sec

@github-actions

github-actions Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: fa64639937b3

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.533 ± 0.158 2.347 2.727 1.68 ± 0.20
pacquet@main 2.448 ± 0.130 2.330 2.740 1.62 ± 0.18
pnpr@HEAD 1.557 ± 0.175 1.340 1.782 1.03 ± 0.16
pnpr@main 1.507 ± 0.150 1.361 1.812 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.53308909994,
      "stddev": 0.15791487907723403,
      "median": 2.47622886944,
      "user": 1.61469366,
      "system": 1.3301753799999998,
      "min": 2.3473941719400004,
      "max": 2.72659066894,
      "times": [
        2.72659066894,
        2.6935118689400004,
        2.6985447869400003,
        2.4640289609400003,
        2.3770690449400003,
        2.47065091394,
        2.48180682494,
        2.35711897494,
        2.3473941719400004,
        2.7141747829400003
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.44767050944,
      "stddev": 0.1302512622146549,
      "median": 2.4021454989400004,
      "user": 1.6076159599999997,
      "system": 1.2680432799999997,
      "min": 2.33037489794,
      "max": 2.7401231529400003,
      "times": [
        2.41420747694,
        2.3676961749400003,
        2.3444185719400004,
        2.41604230694,
        2.39008352094,
        2.5559521179400004,
        2.7401231529400003,
        2.55619478494,
        2.33037489794,
        2.3616120889400003
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.55704004114,
      "stddev": 0.17530129757355525,
      "median": 1.53472765044,
      "user": 1.1131336599999997,
      "system": 1.11927298,
      "min": 1.33955752094,
      "max": 1.78193421894,
      "times": [
        1.3789942449400001,
        1.55819222794,
        1.33955752094,
        1.38060536194,
        1.42018353294,
        1.70304018294,
        1.78193421894,
        1.51126307294,
        1.7649661999400001,
        1.73166384794
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.5069405285400002,
      "stddev": 0.14965508941567301,
      "median": 1.46506772144,
      "user": 1.0832322599999997,
      "system": 1.16603078,
      "min": 1.36131997594,
      "max": 1.81199709694,
      "times": [
        1.5624052779400002,
        1.61654800694,
        1.37173132794,
        1.42328842294,
        1.5068470199400001,
        1.81199709694,
        1.38799082094,
        1.38577771894,
        1.36131997594,
        1.64149961694
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 245.8 ± 8.8 233.2 257.7 1.00
pacquet@main 258.1 ± 12.3 245.8 286.2 1.05 ± 0.06
pnpr@HEAD 271.9 ± 8.0 262.0 283.6 1.11 ± 0.05
pnpr@main 270.8 ± 7.3 260.6 284.2 1.10 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.24583408575999996,
      "stddev": 0.008847076383936737,
      "median": 0.24734572366000002,
      "user": 0.21946108,
      "system": 0.48243246000000006,
      "min": 0.23315201466000002,
      "max": 0.25765317866,
      "times": [
        0.23668566366000002,
        0.23853580966000001,
        0.23764587466,
        0.23315201466000002,
        0.24974510566,
        0.24494634166,
        0.25765317866,
        0.25038446966,
        0.25368341765999997,
        0.25590898166
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.25812158296,
      "stddev": 0.012295633147623015,
      "median": 0.25661635015999995,
      "user": 0.22434127999999998,
      "system": 0.52866176,
      "min": 0.24581062166,
      "max": 0.28624426166,
      "times": [
        0.25513592566,
        0.25078772966,
        0.25817476166,
        0.26815143366,
        0.24930036766000002,
        0.24596941066000003,
        0.24581062166,
        0.26354454266,
        0.28624426166,
        0.25809677466
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.27194950485999997,
      "stddev": 0.007967712426998166,
      "median": 0.27086587466,
      "user": 0.23900187999999994,
      "system": 0.5181688600000001,
      "min": 0.26202948566,
      "max": 0.28357619366,
      "times": [
        0.28224914266,
        0.26383223466,
        0.27179473966,
        0.26751873166,
        0.27288093766,
        0.26993700966,
        0.28357619366,
        0.26202948566,
        0.26448222866,
        0.28119434466
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.27081868166,
      "stddev": 0.00726473697754052,
      "median": 0.26873647215999996,
      "user": 0.21803067999999998,
      "system": 0.5356225600000001,
      "min": 0.26061326766,
      "max": 0.28418255566,
      "times": [
        0.26752882066,
        0.26395836166,
        0.28118021766,
        0.27301635166,
        0.26061326766,
        0.26947372665999997,
        0.27250703266,
        0.28418255566,
        0.26799921766,
        0.26772726465999996
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.599 ± 0.021 2.566 2.641 1.68 ± 0.16
pacquet@main 2.602 ± 0.015 2.585 2.634 1.68 ± 0.16
pnpr@HEAD 1.703 ± 0.136 1.408 1.879 1.10 ± 0.13
pnpr@main 1.547 ± 0.143 1.426 1.808 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.5993286459999996,
      "stddev": 0.021433860732778698,
      "median": 2.5985362582,
      "user": 1.56559936,
      "system": 1.34276788,
      "min": 2.5664342237,
      "max": 2.6409895797,
      "times": [
        2.6074918807,
        2.6200507887,
        2.6409895797,
        2.5814258467,
        2.5664342237,
        2.6074829936999997,
        2.5909261217,
        2.5940018507,
        2.5814125086999997,
        2.6030706657
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.6018792048,
      "stddev": 0.015425271009766315,
      "median": 2.6003226077,
      "user": 1.5806691599999998,
      "system": 1.29815668,
      "min": 2.5853379957,
      "max": 2.6344765977,
      "times": [
        2.5853379957,
        2.6031865937,
        2.5905013637,
        2.6060865587,
        2.6344765977,
        2.5912349457,
        2.6183251867,
        2.5974586217,
        2.6057380607,
        2.5864461237
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.7033331871999997,
      "stddev": 0.1359635197056152,
      "median": 1.7075902807,
      "user": 1.08458996,
      "system": 1.11715038,
      "min": 1.4079652497000001,
      "max": 1.8788235237000002,
      "times": [
        1.4079652497000001,
        1.7161043577000001,
        1.8660654097000002,
        1.7733736167,
        1.7578651787000001,
        1.6478813377000001,
        1.6990762037,
        1.6014983677,
        1.8788235237000002,
        1.6846786267
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.5469425737000002,
      "stddev": 0.1434311648250491,
      "median": 1.4923927157000003,
      "user": 1.0967960599999997,
      "system": 1.1270618799999998,
      "min": 1.4257067797000003,
      "max": 1.8076739857000002,
      "times": [
        1.4383168587000001,
        1.5017899997000002,
        1.5765517027,
        1.7918533177,
        1.5656987707000003,
        1.4257067797000003,
        1.4497575367000002,
        1.4290813537000002,
        1.8076739857000002,
        1.4829954317000003
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 419.9 ± 12.0 403.6 439.8 1.42 ± 0.07
pacquet@main 399.3 ± 15.5 368.8 420.5 1.35 ± 0.08
pnpr@HEAD 301.2 ± 6.7 290.2 314.0 1.02 ± 0.05
pnpr@main 295.6 ± 12.1 284.0 314.4 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.41994716556,
      "stddev": 0.012016366187158713,
      "median": 0.42085570236000003,
      "user": 0.5160408,
      "system": 0.7187592,
      "min": 0.40357574636,
      "max": 0.43977139936,
      "times": [
        0.43374300536,
        0.40357574636,
        0.43977139936,
        0.41215714936,
        0.42865681636,
        0.41969259136,
        0.42201881336,
        0.42376440136,
        0.40587369436,
        0.41021803836
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.39929954526,
      "stddev": 0.015537776750473164,
      "median": 0.39865979736,
      "user": 0.5253392,
      "system": 0.6514116000000001,
      "min": 0.36883980236,
      "max": 0.42048879136,
      "times": [
        0.40482632236,
        0.36883980236,
        0.40025814736,
        0.39355744636,
        0.42048879136,
        0.38551287536,
        0.41332049036,
        0.41649123236,
        0.39706144736,
        0.39263889736
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.30116566746,
      "stddev": 0.006746229212536621,
      "median": 0.30066703536,
      "user": 0.20910999999999996,
      "system": 0.5231604000000001,
      "min": 0.29024800536,
      "max": 0.31401244636,
      "times": [
        0.31401244636,
        0.30186332336,
        0.30700588936,
        0.30346716536,
        0.29947074736,
        0.30551223635999997,
        0.29653716135999997,
        0.29811942135999997,
        0.29542027836,
        0.29024800536
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.29563839986,
      "stddev": 0.012084973422872522,
      "median": 0.29066468536,
      "user": 0.2002694,
      "system": 0.4955366,
      "min": 0.28395257936,
      "max": 0.31443116436,
      "times": [
        0.28656144336,
        0.28670525335999997,
        0.28682103136,
        0.29105124836,
        0.28395257936,
        0.31035401536,
        0.29294981536,
        0.29027812236,
        0.31443116436,
        0.31327932535999997
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.725 ± 0.015 1.708 1.747 5.52 ± 0.19
pacquet@main 1.726 ± 0.021 1.697 1.757 5.52 ± 0.20
pnpr@HEAD 0.312 ± 0.010 0.296 0.325 1.00
pnpr@main 0.324 ± 0.015 0.297 0.345 1.04 ± 0.06
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.7245811413600003,
      "stddev": 0.015053769042477206,
      "median": 1.7203693044600001,
      "user": 0.75949976,
      "system": 0.7789010599999999,
      "min": 1.7080870564600001,
      "max": 1.7465843544600002,
      "times": [
        1.7465843544600002,
        1.7120971484600003,
        1.72678766746,
        1.7080870564600001,
        1.72110515546,
        1.71558827446,
        1.7083164584600001,
        1.7196334534600002,
        1.74466339746,
        1.74294844746
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.72573496176,
      "stddev": 0.021351163496461517,
      "median": 1.72935085196,
      "user": 0.76655926,
      "system": 0.7473511599999998,
      "min": 1.6965264314600002,
      "max": 1.75708504246,
      "times": [
        1.73695461846,
        1.72174708546,
        1.7477581564600002,
        1.7420770664600003,
        1.75708504246,
        1.7381426054600002,
        1.6965264314600002,
        1.70320134346,
        1.7055241784600002,
        1.70833308946
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.3124733001600001,
      "stddev": 0.010479994129977518,
      "median": 0.31179297346,
      "user": 0.20947546,
      "system": 0.5583784599999999,
      "min": 0.29599241046,
      "max": 0.32544869446,
      "times": [
        0.31933564446,
        0.32368774146,
        0.31197797746000006,
        0.30315490846000004,
        0.30720538246,
        0.32454341846,
        0.32544869446,
        0.31160796946,
        0.30177885446,
        0.29599241046
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.3240758851600001,
      "stddev": 0.01488404573618088,
      "median": 0.32751840496000006,
      "user": 0.23394245999999996,
      "system": 0.54667066,
      "min": 0.29716629146,
      "max": 0.34515307146,
      "times": [
        0.34515307146,
        0.33030820346000006,
        0.29716629146,
        0.32826418046000005,
        0.32677262946,
        0.33150100046000003,
        0.33915332346000004,
        0.30888932546000003,
        0.30834640246000006,
        0.32520442346000006
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 218.3 ± 13.9 196.2 250.2 2.50 ± 0.17
pacquet@main 212.8 ± 17.9 170.4 236.1 2.43 ± 0.21
pnpr@HEAD 87.4 ± 0.7 86.1 89.3 1.00 ± 0.02
pnpr@main 87.4 ± 1.6 85.4 92.9 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.21833455658363637,
      "stddev": 0.013948414174734736,
      "median": 0.21375288722,
      "user": 0.18306336545454546,
      "system": 0.06644165818181819,
      "min": 0.19615236622,
      "max": 0.25019551922,
      "times": [
        0.25019551922,
        0.21007681922000002,
        0.22520321722,
        0.20783807022,
        0.22402965522,
        0.19615236622,
        0.21375288722,
        0.21304241822,
        0.22524463522000002,
        0.21160899522,
        0.22453553922
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.21284215468153841,
      "stddev": 0.01789430905380606,
      "median": 0.21784499922,
      "user": 0.17724335846153846,
      "system": 0.054452224615384605,
      "min": 0.17040159322,
      "max": 0.23610769922,
      "times": [
        0.21695466222,
        0.22306274322,
        0.22240324022,
        0.22728616222,
        0.19727723622,
        0.21686630522,
        0.21784499922,
        0.21388026722,
        0.23610769922,
        0.22071768422000002,
        0.18626101422,
        0.21788440422,
        0.17040159322
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.08744238064424242,
      "stddev": 0.0006600958817277998,
      "median": 0.08733169622,
      "user": 0.0207098806060606,
      "system": 0.009649147878787878,
      "min": 0.08611701722000001,
      "max": 0.08928764122,
      "times": [
        0.08702555922,
        0.08768849822000001,
        0.08683214422,
        0.08751598322000001,
        0.08923501322,
        0.08928764122,
        0.08731159822000001,
        0.08797364522000001,
        0.08708607322,
        0.08700622222000001,
        0.08777585222,
        0.08820748622,
        0.08718514022000001,
        0.08684885622,
        0.08713542622,
        0.08712067822000001,
        0.08764900422,
        0.08767457222000001,
        0.08650526822000001,
        0.08674410822,
        0.08761579122000002,
        0.08774007622,
        0.08692742422000001,
        0.08714635622000001,
        0.08733169622,
        0.08705271022000001,
        0.08703367422000001,
        0.08750603522000001,
        0.08787297622000001,
        0.08809098822000001,
        0.08611701722000001,
        0.08753435822000001,
        0.08782068722000001
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.0874111320987879,
      "stddev": 0.0015784163965166698,
      "median": 0.08716390922000002,
      "user": 0.020627213939393943,
      "system": 0.01012084484848485,
      "min": 0.08535912922000001,
      "max": 0.09290544122000001,
      "times": [
        0.08535912922000001,
        0.08716545222000001,
        0.08717935822000002,
        0.08700116322000001,
        0.08779252422000001,
        0.08771919622000002,
        0.08872194722000001,
        0.08568685622000001,
        0.08694260322000001,
        0.08675851522000001,
        0.08587770522000002,
        0.08911787322,
        0.08646351922,
        0.09056297622000001,
        0.08989306422000001,
        0.08648992922000001,
        0.08777266722000002,
        0.08675036022000002,
        0.08693945722000002,
        0.08680646522000002,
        0.08586619422000001,
        0.08960573222000001,
        0.08655839922000001,
        0.08765223922000001,
        0.08751219622,
        0.08724854922000001,
        0.08564218122000002,
        0.08778005122000002,
        0.08740025522000001,
        0.09290544122000001,
        0.08561618322000002,
        0.08661526522000002,
        0.08716390922000002
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 932.3 ± 220.4 689.2 1301.1 1.00
pacquet@main 965.2 ± 290.7 671.0 1585.9 1.04 ± 0.40
pnpm@HEAD 3076.2 ± 200.7 2831.9 3427.5 3.30 ± 0.81
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.9322697501066666,
      "stddev": 0.22044681365661095,
      "median": 0.9537330634400001,
      "user": 0.9021793955555554,
      "system": 0.14012416,
      "min": 0.6891860604400001,
      "max": 1.3010761364399999,
      "times": [
        0.7007375304400001,
        0.7797356254400001,
        1.1878998374399998,
        0.6891860604400001,
        1.02269723644,
        1.3010761364399999,
        1.0134167964399998,
        0.7419454644400001,
        0.9537330634400001
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.9651884763288889,
      "stddev": 0.2906634577995926,
      "median": 0.8800367104400001,
      "user": 0.9239441733333335,
      "system": 0.1529953822222222,
      "min": 0.6709831944400001,
      "max": 1.58590303944,
      "times": [
        0.9726374414400001,
        0.8800367104400001,
        1.16464006044,
        0.8033415044400001,
        0.6847966174400001,
        0.8007489184400001,
        1.58590303944,
        0.6709831944400001,
        1.12360880044
      ]
    },
    {
      "command": "pnpm@HEAD",
      "mean": 3.076196433995556,
      "stddev": 0.20068323611100797,
      "median": 3.08487853244,
      "user": 4.722541173333333,
      "system": 0.2812996044444444,
      "min": 2.83192194444,
      "max": 3.42750089944,
      "times": [
        3.42750089944,
        3.25440239744,
        3.16108901444,
        3.08487853244,
        3.02352173544,
        3.17042841544,
        2.86068024344,
        2.83192194444,
        2.87134472344
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.552 ± 0.147 4.413 4.831 1.28 ± 0.06
pacquet@main 4.575 ± 0.145 4.445 4.785 1.29 ± 0.06
pnpr@HEAD 3.554 ± 0.128 3.452 3.880 1.00
pnpr@main 3.621 ± 0.146 3.454 3.872 1.02 ± 0.06
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.552038229980001,
      "stddev": 0.14715082427736487,
      "median": 4.49463857578,
      "user": 1.7923188200000002,
      "system": 1.4664331599999998,
      "min": 4.41290554228,
      "max": 4.83075823828,
      "times": [
        4.42686943128,
        4.41290554228,
        4.4688534112800005,
        4.83075823828,
        4.52042374028,
        4.64243040128,
        4.4341804832800005,
        4.60050689128,
        4.74451828728,
        4.43893587328
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.57530011378,
      "stddev": 0.1446314487171311,
      "median": 4.5264594547799994,
      "user": 1.8119876199999996,
      "system": 1.39189686,
      "min": 4.44504135928,
      "max": 4.7848113552800005,
      "times": [
        4.45513237428,
        4.75760462728,
        4.44593811928,
        4.45398000328,
        4.7848113552800005,
        4.76282281928,
        4.59475157028,
        4.44504135928,
        4.46337324428,
        4.58954566528
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.55351611018,
      "stddev": 0.12766599655002556,
      "median": 3.5118469917799997,
      "user": 1.3054255199999998,
      "system": 1.29550496,
      "min": 3.45235447028,
      "max": 3.88027074728,
      "times": [
        3.47549615628,
        3.47368031428,
        3.62138994128,
        3.58198673328,
        3.45235447028,
        3.55340220228,
        3.47288655328,
        3.48157225228,
        3.88027074728,
        3.54212173128
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 3.62139084138,
      "stddev": 0.1462720612288601,
      "median": 3.5882709237799997,
      "user": 1.30581022,
      "system": 1.3270103599999998,
      "min": 3.45366071028,
      "max": 3.87226176328,
      "times": [
        3.87226176328,
        3.48322306428,
        3.45366071028,
        3.50183155328,
        3.50775993528,
        3.6605202932800003,
        3.74953228128,
        3.8085769652800003,
        3.59044352828,
        3.58609831928
      ]
    }
  ]
}

@github-actions

github-actions Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13759
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,566.43 ms
(-2.20%)Baseline: 2,624.09 ms
3,148.90 ms
(81.50%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
1,708.09 ms
(-2.27%)Baseline: 1,747.69 ms
2,097.23 ms
(81.44%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
403.58 ms
(-7.12%)Baseline: 434.51 ms
521.41 ms
(77.40%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
196.15 ms
(-8.77%)Baseline: 215.02 ms
258.02 ms
(76.02%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,347.39 ms
(-2.69%)Baseline: 2,412.17 ms
2,894.60 ms
(81.10%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
4,412.91 ms
(-2.11%)Baseline: 4,508.18 ms
5,409.82 ms
(81.57%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
233.15 ms
(-13.67%)Baseline: 270.06 ms
324.08 ms
(71.94%)
isolated-linker.peer-heavy-resolve.hot-cache.offline📈 view plot
🚷 view threshold
689.19 ms
(-0.26%)Baseline: 690.99 ms
829.19 ms
(83.12%)
🐰 View full continuous benchmarking report in Bencher

Review follow-ups on the new ERR_PNPM_GIT_FETCH_FAILED message.

A repository URL from the lockfile can carry `user:pass@` credentials, and
git echoes it straight back through stderr, so both now go through the
redact-and-sanitize path the repo already uses for untrusted URL-bearing
text. Only the interpolated values are sanitized: stripping control
characters from the whole message would collapse the deliberately
multi-line hint.

That collapsing is also why `redactAndSanitizeMultiline` /
`redact_and_sanitize_multiline` join their single-line siblings. Subprocess
stderr is worth reading as more than one line, but a newline can fall
inside a `user:pass@` authority - git prints such a URL back verbatim,
password included - so line breaks survive only when keeping them redacts
exactly as much as collapsing would.

A missing `git` executable no longer arrives as a fetch failure carrying
irrelevant SSH-key advice. It becomes ERR_PNPM_GIT_FETCHER_GIT_NOT_FOUND,
the code and message pacquet already used, so the two stacks agree.

`ssh_repo_host` keeps the brackets on an IPv6 literal instead of truncating
at the first colon inside the address, matching what `URL.hostname` hands
the TypeScript side for the same reference.
Copilot AI review requested due to automatic review settings August 10, 2026 12:17

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.

`stderr?.trim()` yields an empty string, not `undefined`, so the nullish
fallback kept it and the user got a failure with no detail at all.

Also covers the shallow-fetch branch in both stacks. It shares the catch
with the clone branch today, so the tests guard the boundary rather than
distinct logic, and the changeset no longer says "clone" for a change that
restates `git fetch` failures too.
Copilot AI review requested due to automatic review settings August 10, 2026 12:19

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 fa64639

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

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13759
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,407.97 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
295.99 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
290.25 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
86.12 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,339.56 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
3,452.35 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
262.03 ms
🐰 View full continuous benchmarking report in Bencher

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants