ci(test): use prebuilt @pnpm/pnpr from npm instead of building locally#11964
Conversation
The e2e/integration test harness spawns `pnpm-registry` as a faster verdaccio replacement. CI used to install Rust and build the crate from source on every test job — adding several minutes per platform. `@pnpm/pnpr` now publishes the prebuilt binary to npm, and `pnpm install` already pulls in the matching `@pnpm/pnpr.<platform>-<arch>` package via optionalDependencies. The Jest globalSetup resolves that binary through `@pnpm/pnpr/bin/pnpr`'s own module path (the wrapper carries the platform packages as siblings in its `node_modules`, not on the parent chain of this file). - Add `@pnpm/pnpr` to `pnpm-workspace.yaml` catalog and depend on it from `@pnpm/jest-config`. - Replace `resolvePnpmRegistryBin`'s `$CARGO_TARGET_DIR` lookup with `require.resolve` through the npm-installed wrapper. The `PNPM_REGISTRY_BIN` env var is still honored as an escape hatch for contributors who want to point at a locally-built Rust binary. - Remove the "Install Rust toolchain" + "Build pnpm-registry" steps from `.github/workflows/test.yml`. --- Written by an agent (Claude Code, claude-opus-4-7).
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
💤 Files with no reviewable changes (1)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🧰 Additional context used🧠 Learnings (2)📚 Learning: 2026-05-05T23:03:04.286ZApplied to files:
📚 Learning: 2026-05-14T09:04:00.133ZApplied to files:
🔇 Additional comments (3)
📝 WalkthroughWalkthroughThe PR removes the Rust toolchain build step from CI tests and replaces local pnpm-registry binary discovery with a pre-built binary from the new Changespnpm-registry binary source migration
Possibly Related PRs
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Integrated-Benchmark Report (Linux)Scenario: Isolated linker: fresh restore, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.06483593648,
"stddev": 0.13168923896082896,
"median": 2.01345316998,
"user": 2.76415074,
"system": 3.4983873799999996,
"min": 1.9342898949799998,
"max": 2.3160731669800003,
"times": [
1.9983054039800001,
2.01860553398,
2.0005702319800003,
2.02952299498,
2.0083008059800003,
2.0327878419800003,
2.30244821998,
2.3160731669800003,
2.0074552699800003,
1.9342898949799998
]
},
{
"command": "pacquet@main",
"mean": 1.9931997980799998,
"stddev": 0.03958784291836677,
"median": 1.98627692548,
"user": 2.771042239999999,
"system": 3.4231242799999997,
"min": 1.92519006998,
"max": 2.0706390159800003,
"times": [
2.01809194598,
2.03094429098,
1.98322596898,
1.9705596969799999,
1.96803788698,
1.98011920098,
1.92519006998,
2.0706390159800003,
1.98932788198,
1.99586202198
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.63415250638,
"stddev": 0.026589139071216874,
"median": 0.6274837423799999,
"user": 0.3653155,
"system": 1.3296928000000001,
"min": 0.61472975838,
"max": 0.70723820238,
"times": [
0.70723820238,
0.63255298838,
0.62015188638,
0.62678666838,
0.63242182538,
0.62818081638,
0.61810009838,
0.62473102338,
0.63663179638,
0.61472975838
]
},
{
"command": "pacquet@main",
"mean": 0.65653877228,
"stddev": 0.021138033981784,
"median": 0.6491286538800001,
"user": 0.3663286,
"system": 1.3415807,
"min": 0.63519784338,
"max": 0.70282983138,
"times": [
0.68036319538,
0.64177536738,
0.64501955838,
0.63519784338,
0.70282983138,
0.65145542138,
0.65913811138,
0.64680188638,
0.63866264338,
0.66414386438
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.2469317573799996,
"stddev": 0.03009514424174808,
"median": 2.2517030684800003,
"user": 3.7872970399999994,
"system": 3.0968587999999997,
"min": 2.18859837348,
"max": 2.28780362748,
"times": [
2.25602138148,
2.27885741348,
2.28780362748,
2.24738475548,
2.26342006648,
2.18859837348,
2.22682162748,
2.2247066064800003,
2.26790379048,
2.2277999314800003
]
},
{
"command": "pacquet@main",
"mean": 2.26545327098,
"stddev": 0.03869259103151394,
"median": 2.2628823014800004,
"user": 3.7975375399999995,
"system": 3.1336440999999993,
"min": 2.21222634848,
"max": 2.3197765394800003,
"times": [
2.23166860248,
2.22013389448,
2.24289685048,
2.3197765394800003,
2.30675070748,
2.2878363154800003,
2.26301819548,
2.2627464074800003,
2.21222634848,
2.30747884848
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.4259473543600003,
"stddev": 0.016934238214531487,
"median": 1.42818536466,
"user": 1.72365502,
"system": 1.8431851599999998,
"min": 1.3853996666600001,
"max": 1.4476586056600003,
"times": [
1.4476586056600003,
1.42141743666,
1.3853996666600001,
1.4357654426600002,
1.4270998106600001,
1.4151655206600002,
1.43199512266,
1.4394838576600002,
1.4262171616600001,
1.4292709186600001
]
},
{
"command": "pacquet@main",
"mean": 1.43121886666,
"stddev": 0.033781708342958634,
"median": 1.42822169666,
"user": 1.7304909199999998,
"system": 1.81145526,
"min": 1.40014601266,
"max": 1.5176732856600001,
"times": [
1.43091789166,
1.4267736906600001,
1.5176732856600001,
1.4315441206600001,
1.4246103116600002,
1.40014601266,
1.4059287656600001,
1.4004172896600002,
1.4445075956600002,
1.4296697026600003
]
}
]
} |
|
| Branch | pr/11964 |
| Testbed | pacquet |
Click to view all benchmark results
| Benchmark | Latency | Benchmark Result milliseconds (ms) (Result Δ%) | Upper Boundary milliseconds (ms) (Limit %) |
|---|---|---|---|
| isolated-linker.fresh-install.cold-cache.cold-store | 📈 view plot 🚷 view threshold | 2,246.93 ms(-21.93%)Baseline: 2,878.14 ms | 3,453.77 ms (65.06%) |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot 🚷 view threshold | 1,425.95 ms(-28.19%)Baseline: 1,985.75 ms | 2,382.90 ms (59.84%) |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot 🚷 view threshold | 2,064.84 ms(-0.89%)Baseline: 2,083.39 ms | 2,500.07 ms (82.59%) |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot 🚷 view threshold | 634.15 ms(-4.07%)Baseline: 661.07 ms | 793.29 ms (79.94%) |
Summary
The e2e/integration test harness spawns
pnpm-registryas a faster verdaccio replacement. Until now, CI installed the Rust toolchain and rancargo build --release -p pnpm-registry --lockedon every test job, adding a few minutes per platform.@pnpm/pnpris now publishing prebuilt binaries to npm via #11963, so the cargo build is redundant.pnpm installalready pulls in the matching@pnpm/pnpr.<platform>-<arch>package via optionalDependencies; the Jest globalSetup now resolves the binary out of that.Changes
pnpm-workspace.yaml: add@pnpm/pnprto the catalog pinned at0.0.0-26052601.__utils__/jest-config/package.json: depend on@pnpm/pnprviacatalog:.__utils__/jest-config/with-registry/globalSetup.js: replace the\$CARGO_TARGET_DIRlookup withrequire.resolve('@pnpm/pnpr.\${platform}-\${arch}/pnpr[.exe]'). Resolution goes through the@pnpm/pnprwrapper's own module path because the platform sub-packages live in the wrapper'snode_modules, not on the parent chain ofglobalSetup.js.PNPM_REGISTRY_BINis still honored as the escape hatch for contributors who want to test in-progress changes to the Rust crate..github/workflows/test.yml: drop theInstall Rust toolchainandBuild pnpm-registrysteps.Verification
Ran
cache/commands' test suite locally on darwin-arm64 — globalSetup spawned the binary from@pnpm/pnpr.darwin-arm64@0.0.0-26052601, the server reportedpnpm-registry listening listen=127.0.0.1:53469, and the suite passed.Test plan
testmatrix (ubuntu + windows, multiple Node versions) all passtestjobs before vs. after — expect to save the time previously spent onInstall Rust toolchain+Build pnpm-registryWritten by an agent (Claude Code, claude-opus-4-7).
Summary by CodeRabbit