fix(get-pnpm): download the binary from registries without version documents #18145
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #18145"
general
weight: 0.35
MikaelEdebro
Summary
Behind an Azure Artifacts feed, the
pnpmpackage cannot download its native binary on first run. That is the path Corepack takes, and so does Dependabot, which runs pnpm through Corepack and setsCOREPACK_NPM_REGISTRYto the configured feed. Every Dependabot update job in a pnpm 12 repository that uses an Azure feed fails:Azure Artifacts differs from npm in two ways:
| Request | npm | Azure Artifacts |
| --- | --- | --- |
| Version document
/<name>/<version>| 200 | 404, for every package, e.g.lodash/4.17.21|| Package document
/<name>| 200 | 200, withdist.tarballanddist.integrity||
dist.signatures| present | stripped everywhere; no/-/npm/v1/keyseither |The
integritythe feed serves is identical to npm's, because the feed mirrors the tarball unchanged.Changes in
get-pnpm:fetchVersionMeta: when the version document is a 404, the version is read from the package document. If it is not there either, the original 404 is thrown.fetchSignatures: when neither document carries signatures,downloadPnpmExecutabletakes npm's signatures for<name>@<version>from registry.npmjs.org.- No credentials are sent there.
- The signatures still have to cover the checksum the mirror served, and the tarball is still checked against that checksum. So only the signature, never the binary, comes from npm. This is the same reasoning as the existing Artifactory fallback.
- If npm cannot be reached, for example on an air-gapped network, the package is refused as unsigned, exactly as before.
-
downloadPnpm(the installer) is unchanged; it gets only the 404 fallback.Tested against a real Azure Artifacts feed, with npm's pinned signing keys:
Could not download …/@pnpm/exe.darwin-arm64/12.18.0: 404 Not Found--versionprints12.18.0.No existing issue covers this. pnpm/pnpm#16655 / pnpm/pnpm#16657 made the first-run download use the configured registry; this makes it work against one that is Azure Artifacts.
Squash Commit Body
Checklist
already linked to it solves it.
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-5).
<!-- codesmith:footer -->
---
<a href="https://backend.blacksmith.sh/track/enable-autofix?expires=1797409272&installation_model_id=426870&pr_number=18145&ref=codesmith_pr_footer&repository=pnpm%2Fpnpm&return_to=https%3A%2F%2Fgithub.com%2Fpnpm%2Fpnpm%2Fpull%2F18145&signature=a6170ef3de5612d79dd088b02b6aed48e2a9e9bfe4481f9b956a9a4a709eb01d"><picture><source media="(prefers-color-scheme: dark)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-light.svg"><img alt="Autofix with [code]smith" src="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png" width="190" height="28"></picture></a>
<sup><a href="https://app.blacksmith.sh/pnpm/codesmith/pnpm/pr/18145?autoLogin=true&ref=codesmith_pr_footer">Open in [code]smith</a> · Need help on this PR? Tag <code>@codesmith-bot</code> with what you need.</sup>
<!-- codesmith:autofix:disabled -->
<!-- /codesmith:footer -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
New Features
First-run downloads can use version information from a package document when a registry returns 404 for a separate version document.
If the configured registry has no npm signatures, signature lookup can use
registry.npmjs.orgor a specified npm registry. Registry credentials are not sent to that signature source.Bug Fixes
Downloads are refused when the executable’s checksum cannot be verified against an available npm signature.
Documentation
* Documented version-document fallback and signature lookup behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->