Repository navigation
fix(git-fetcher): say which dependency a git clone failed for, and how to fix it - #13759
Conversation
…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.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughGit fetchers now report package-aware ChangesGit fetch diagnostics
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
Possibly related PRs
Suggested labels: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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
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. Comment |
PR Summary by Qodofix(git-fetcher): include package name + SSH lockfile remediation on clone failures
AI Description
Diagram
High-Level Assessment
Files changed (7)
|
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (2): Last reviewed commit: "fix(git-fetcher): keep the fallback deta..." | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (1)
pnpm11/fetching/git-fetcher/src/index.ts (1)
135-135: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueUse string operations for the fixed prefix.
The
git+prefix is fixed text. Replace the regular expression withstartsWith()andslice().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
📒 Files selected for processing (7)
.changeset/git-fetch-failure-hint.mdpnpm/crates/deps-restorer/src/install_package_by_snapshot.rspnpm/crates/git-fetcher/src/error.rspnpm/crates/git-fetcher/src/fetcher.rspnpm/crates/git-fetcher/src/fetcher/tests.rspnpm11/fetching/git-fetcher/src/index.tspnpm11/fetching/git-fetcher/test/index.ts
Code Review by Qodo
1.
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
Micro-Benchmark ResultsLinux |
Integrated-Benchmark Report (Linux)Commit: 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
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
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
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
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
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
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
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
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
]
}
]
} |
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.
`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.
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
Code review by qodo was updated up to the latest commit fa64639 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
| Project | pnpm's project |
| Branch | pr/13759 |
| Testbed | pnpr |
⚠️ 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-thresholdsflag.
Click to view all benchmark results
| Benchmark | Latency | milliseconds (ms) |
|---|---|---|
| isolated-linker.fresh-install.cold-cache.cold-store | 📈 view plot | 1,407.97 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 295.99 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 290.25 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 86.12 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,339.56 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,452.35 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 262.03 ms |
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:
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):
Notes on the details:
opts.pkg.name(TypeScript) /package_key.name(pacquet); a git dep'spackage_idis the baregit+…#<commit>and carries no name.--force/--resolution-onlyline is not padding. I measured all four commands against a poisoned lockfile: onlypnpm updateclears the SSH entry. The git resolver returnscurrentPkg's existing resolution unlessupdateis set, so--resolution-onlydoes 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.init/remote/clone/fetch). A failingcheckoutorrev-parsesays nothing about reaching the remote, and its own error already describes it.Fetch/FetchOverSshinto two variants sharing one code, purely so the derivedDiagnosticcan carry thehelponly where it applies.Left deliberately alone:
--resolution-onlynot honouring its help text for git deps. It's a real bug but a separate one, and noted on the issue.Squash Commit Body
Checklist
already linked to it solves it.
pnpm/port, or the description notes what still needs porting.pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
Written by an agent (Claude Code, claude-opus-5[1m]).
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
pnpm update.