Repository navigation
Conversation
A `userAgent` in a repository's pnpm-workspace.yaml had its `${VAR}`
placeholders resolved and sent as the User-Agent header to the registry,
which the same file can choose with a literal `registry:`. That let a
repository deliver an installer's environment variable (a token, say) to
a host it names, without any lifecycle script.
`userAgent` now joins the request settings whose placeholders are dropped
when the file is repository-controlled: `REQUEST_SCALAR_KEYS` in v11, and
the filtered scalars of `substitute_env_untrusted` in v12. Trusted sources
(the global config and the environment overlay) still expand it.
Closes #15415
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Warning Review limit reachedNext included review available in 3 minutes. View limit detailsLimit details: You’ve used all 10 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository: pnpm/pnpm/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: pnpm/pnpm/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (5)
Included review availability: Your plan provides up to 10 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe Rust and TypeScript configuration paths now filter environment-variable placeholders in workspace ChangesWorkspace
Estimated code review effort: 2 (Simple) | ~10 minutes Assessment against linked issues
Suggested labels: Merge Risk: ⚪ Minimal · up to Project-controlled userAgent placeholders are filtered while trusted configuration retains expansion. No actionable merge-blocking risk is established. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Micro-Benchmark ResultsLinux |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #15419 +/- ##
==========================================
+ Coverage 91.76% 91.78% +0.01%
==========================================
Files 1408 1408
Lines 189627 190236 +609
==========================================
+ Hits 174019 174600 +581
- Misses 15608 15636 +28 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Same-run regression checkHEAD and main are measured on the same runner. The tolerance is 5% of the main median or 2 ms, whichever is larger. A regression requires both the median slowdown and the gap between the fastest retained HEAD sample and slowest retained main sample to exceed this tolerance, after trimming up to 10% from each tail. Suspected regressions are rerun once with target order reversed and only fail if reproduced. This conservative noise guard is not a statistical confidence interval. Inconclusive rows do not fail the check. They remain visible for performance review. Bencher retains absolute minimum timings for historical tracking; historical alerts do not gate this PR. Sequential measurements can still be affected by runner drift.
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; the linked-workspace scenario compares current Rust against main Rust. Bencher consumes pacquet@HEAD and pnpr@HEAD. The tables below show mean ± σ. Bencher tracks absolute minimum latency; PR regression checks compare HEAD and main samples from the same runner. Historical timing alerts do not gate PRs. Scenario: Isolated linker: fresh restore, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.54713077098,
"stddev": 0.12876206490842146,
"median": 2.49538093818,
"user": 2.23491688,
"system": 1.8521191799999996,
"min": 2.42030838468,
"max": 2.75539080568
},
{
"command": "pacquet@main",
"mean": 2.54147798428,
"stddev": 0.12157786564553462,
"median": 2.50874998668,
"user": 2.1660473799999997,
"system": 1.94079388,
"min": 2.4331602926800002,
"max": 2.8277024126800003
},
{
"command": "pnpr@HEAD",
"mean": 1.40278968848,
"stddev": 0.0801441651711667,
"median": 1.3821412031800002,
"user": 1.6182579799999999,
"system": 1.5911641799999996,
"min": 1.3223274096800002,
"max": 1.5917312036800002
},
{
"command": "pnpr@main",
"mean": 1.4698248392800004,
"stddev": 0.08648990494118,
"median": 1.4563618061799999,
"user": 1.5951882799999997,
"system": 1.5480049799999995,
"min": 1.36464523168,
"max": 1.68832058468
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.40769519434,
"stddev": 0.04850250508570887,
"median": 0.42551673234000004,
"user": 0.4243513,
"system": 0.8116604800000001,
"min": 0.34000613134,
"max": 0.46400297334
},
{
"command": "pacquet@main",
"mean": 0.44987632884,
"stddev": 0.09861395941782271,
"median": 0.42789417234000005,
"user": 0.4747179,
"system": 0.8393909799999999,
"min": 0.34362790934000004,
"max": 0.6611349583400001
},
{
"command": "pnpr@HEAD",
"mean": 0.4897481839400001,
"stddev": 0.06595225741566921,
"median": 0.47121536284000004,
"user": 0.5097463999999999,
"system": 0.8595478799999998,
"min": 0.40487009434000004,
"max": 0.6243246443400001
},
{
"command": "pnpr@main",
"mean": 0.44495625394000005,
"stddev": 0.04911970533571454,
"median": 0.44791425884,
"user": 0.4505685,
"system": 0.8107840799999998,
"min": 0.36699386134,
"max": 0.5218093353400001
}
]
}Scenario: Isolated linker: repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.019112922037647057,
"stddev": 0.0040271743110353465,
"median": 0.01876991492,
"user": 0.009577875721925127,
"system": 0.010641711443850269,
"min": 0.011302458920000001,
"max": 0.02939015692
},
{
"command": "pacquet@main",
"mean": 0.018507218399166664,
"stddev": 0.004380062813213448,
"median": 0.01815460092,
"user": 0.00983052166666667,
"system": 0.009764655833333337,
"min": 0.010775122920000001,
"max": 0.03526964992000001
},
{
"command": "pnpr@HEAD",
"mean": 0.013802391040171691,
"stddev": 0.0026511206511207423,
"median": 0.01323791292,
"user": 0.007019492875536485,
"system": 0.007689224892703864,
"min": 0.00933018692,
"max": 0.02251766092
},
{
"command": "pnpr@main",
"mean": 0.013647856193631841,
"stddev": 0.0024671726605117656,
"median": 0.013291523920000001,
"user": 0.007353698905472635,
"system": 0.007171864676616922,
"min": 0.009449716920000002,
"max": 0.02258571492
}
]
}Scenario: Isolated linker: repeat install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.0194496477653125,
"stddev": 0.0032375545187204487,
"median": 0.018661620320000002,
"user": 0.011075719375000003,
"system": 0.009507079687500003,
"min": 0.014038443820000001,
"max": 0.03283524882
},
{
"command": "pacquet@main",
"mean": 0.019513006256974795,
"stddev": 0.002486979379841812,
"median": 0.01924989282,
"user": 0.0106970868907563,
"system": 0.009916572268907565,
"min": 0.01476004682,
"max": 0.02543596982
},
{
"command": "pnpr@HEAD",
"mean": 0.018867386584705888,
"stddev": 0.0026498615216286646,
"median": 0.01856932232,
"user": 0.010322227647058825,
"system": 0.00963121764705882,
"min": 0.01304445982,
"max": 0.027955943820000002
},
{
"command": "pnpr@main",
"mean": 0.017275702695000002,
"stddev": 0.0022633372946521567,
"median": 0.017134237320000002,
"user": 0.009824952105263157,
"system": 0.008566698026315793,
"min": 0.010469633820000001,
"max": 0.023647496820000002
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.7695718511600007,
"stddev": 0.06648895276967365,
"median": 2.7734328798600005,
"user": 2.7555619399999998,
"system": 2.22311886,
"min": 2.67730541986,
"max": 2.88567418986
},
{
"command": "pacquet@main",
"mean": 2.71880333446,
"stddev": 0.05123112620503673,
"median": 2.7180266628600003,
"user": 2.5582411399999994,
"system": 2.0945730599999997,
"min": 2.6428727318600003,
"max": 2.82732412486
},
{
"command": "pnpr@HEAD",
"mean": 1.5701201019599997,
"stddev": 0.05372948100306479,
"median": 1.5567279463600001,
"user": 1.5279314400000001,
"system": 1.6907991599999996,
"min": 1.48593803286,
"max": 1.66310057186
},
{
"command": "pnpr@main",
"mean": 1.56337131566,
"stddev": 0.129524249008444,
"median": 1.53195156136,
"user": 1.51371464,
"system": 1.62347766,
"min": 1.41781662286,
"max": 1.8231940068599999
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.54161781042,
"stddev": 0.1370710760577367,
"median": 0.50994200012,
"user": 0.7878376799999999,
"system": 0.9497916999999999,
"min": 0.39626519362,
"max": 0.81609622062
},
{
"command": "pacquet@main",
"mean": 0.46901590702000007,
"stddev": 0.07039835294679508,
"median": 0.45245158562000004,
"user": 0.66784828,
"system": 0.8723725,
"min": 0.41523533662,
"max": 0.66171223362
},
{
"command": "pnpr@HEAD",
"mean": 0.37975504522,
"stddev": 0.06040351874805461,
"median": 0.38504466262000003,
"user": 0.32936518000000004,
"system": 0.6792737999999999,
"min": 0.29754089862000005,
"max": 0.48610744962
},
{
"command": "pnpr@main",
"mean": 0.31356984532000004,
"stddev": 0.018793101175142556,
"median": 0.30507847812,
"user": 0.25797758000000004,
"system": 0.5735662,
"min": 0.29556340962000005,
"max": 0.33707094562
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.7735657961600002,
"stddev": 0.14842564400241778,
"median": 1.70730754556,
"user": 1.1713050199999997,
"system": 1.12272868,
"min": 1.66270648256,
"max": 2.08539243956
},
{
"command": "pacquet@main",
"mean": 1.79780644896,
"stddev": 0.09649374359392131,
"median": 1.76703760006,
"user": 1.22729772,
"system": 1.1820672799999998,
"min": 1.70687651456,
"max": 2.00940306756
},
{
"command": "pnpr@HEAD",
"mean": 0.33643650926,
"stddev": 0.024514917101107193,
"median": 0.33879683656000004,
"user": 0.26535102000000005,
"system": 0.6352451799999999,
"min": 0.30210819956,
"max": 0.36699243656
},
{
"command": "pnpr@main",
"mean": 0.38440975976,
"stddev": 0.040618819442760495,
"median": 0.38166363756,
"user": 0.34078712,
"system": 0.6598088799999999,
"min": 0.32693864356,
"max": 0.46904002256
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.42906787434,
"stddev": 0.05782462765637326,
"median": 0.43486437114,
"user": 0.4412412,
"system": 0.15516977999999998,
"min": 0.35528343264,
"max": 0.5443332186400001
},
{
"command": "pacquet@main",
"mean": 0.39139977504,
"stddev": 0.031058893779597575,
"median": 0.38229477164000003,
"user": 0.41609949999999996,
"system": 0.13502108,
"min": 0.36142463164,
"max": 0.46571942364
},
{
"command": "pnpr@HEAD",
"mean": 0.11772168344952384,
"stddev": 0.00929461470874168,
"median": 0.11791196664,
"user": 0.05356844285714286,
"system": 0.021628622857142857,
"min": 0.10272668464000001,
"max": 0.13427466964
},
{
"command": "pnpr@main",
"mean": 0.11893751482181819,
"stddev": 0.009525790698308337,
"median": 0.11894739064000001,
"user": 0.0522878,
"system": 0.023311389090909088,
"min": 0.10272975964000002,
"max": 0.13489902164
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.7368785980533333,
"stddev": 0.047980265530710595,
"median": 0.73737259472,
"user": 0.776706011111111,
"system": 0.17142406666666665,
"min": 0.66675426272,
"max": 0.8302300737200001
},
{
"command": "pacquet@main",
"mean": 0.7861535430533334,
"stddev": 0.07755387695573013,
"median": 0.78049913672,
"user": 0.8091812333333332,
"system": 0.1789302888888889,
"min": 0.66524479272,
"max": 0.9256299827200001
},
{
"command": "pnpm@HEAD",
"mean": 3.844772072164444,
"stddev": 0.16976591965791418,
"median": 3.8371329997199997,
"user": 6.02873401111111,
"system": 0.28089506666666664,
"min": 3.5771786287199996,
"max": 4.13764805072
}
]
}Scenario: Isolated linker: linked-workspace resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.24312619031000005,
"stddev": 0.02582121066194975,
"median": 0.23392394256000001,
"user": 0.18428892666666663,
"system": 0.12276495333333333,
"min": 0.21637360806000003,
"max": 0.28479544406
},
{
"command": "pacquet@main",
"mean": 0.2531014554236364,
"stddev": 0.043122307321372046,
"median": 0.24312493406000002,
"user": 0.19806803272727275,
"system": 0.1152565290909091,
"min": 0.21406088906,
"max": 0.35339148006
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 5.02617749764,
"stddev": 0.4128671080033859,
"median": 4.94136074724,
"user": 2.60529832,
"system": 2.20350616,
"min": 4.62906771024,
"max": 5.94448766024
},
{
"command": "pacquet@main",
"mean": 5.259883600340001,
"stddev": 0.4854621795214033,
"median": 5.121713035739999,
"user": 3.0089235199999997,
"system": 2.5055638599999996,
"min": 4.75958825024,
"max": 6.35519803924
},
{
"command": "pnpr@HEAD",
"mean": 3.6303625866399996,
"stddev": 0.16203932199259102,
"median": 3.56348580624,
"user": 1.8465496199999998,
"system": 1.83274526,
"min": 3.43883303024,
"max": 3.92347936324
},
{
"command": "pnpr@main",
"mean": 3.66059065094,
"stddev": 0.20303068999716298,
"median": 3.5799330622400003,
"user": 1.8130501199999998,
"system": 1.8129029600000002,
"min": 3.44958602124,
"max": 4.04114127924
}
]
}Scenario: GVS linker: fresh restore, hot cache + hot storeSame install as the isolated fresh-restore hot/hot scenario, into the shared virtual store, the layout pnpm 12 installs into by default. Scenarios run on separate machines, so compare main and branch within each table.
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.14394763463333332,
"stddev": 0.01649643726059238,
"median": 0.1413166928,
"user": 0.17406840666666668,
"system": 0.13919106666666667,
"min": 0.1256751238,
"max": 0.20188139580000003
},
{
"command": "pacquet@main",
"mean": 0.18564876394285718,
"stddev": 0.01799188248013204,
"median": 0.18490333630000003,
"user": 0.21565581142857143,
"system": 0.18111032857142856,
"min": 0.1556181818,
"max": 0.2204327768
},
{
"command": "pnpr@HEAD",
"mean": 0.1883378957166667,
"stddev": 0.020456117542201516,
"median": 0.19014261780000002,
"user": 0.20990990666666665,
"system": 0.17172306666666667,
"min": 0.1531622528,
"max": 0.21653099680000001
},
{
"command": "pnpr@main",
"mean": 0.18547835637142862,
"stddev": 0.029362377845692168,
"median": 0.18720796480000002,
"user": 0.21557616857142853,
"system": 0.15194839999999998,
"min": 0.14257260980000003,
"max": 0.22714524680000003
}
]
} |
|
PR Summary by QodoProtect project userAgent from environment-variable expansion
AI Description
Diagram
High-Level Assessment
Files changed (5)
|
Code Review by Qodo
1.
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Qodo findings:
Written by an agent (Claude Code, claude-opus-5-5). |
|
Code review by qodo was updated up to the latest commit 992cc61 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Dismissed because a newer commit was pushed; Greptile will re-review the current head.
|
Code review by qodo was updated up to the latest commit c646edd |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
…m#15419) A `userAgent` in a repository's pnpm-workspace.yaml had its `${VAR}` placeholders resolved and sent as the User-Agent header to the registry, which the same file can choose with a literal `registry:`. That let a repository deliver an installer's environment variable (a token, say) to a host it names, without any lifecycle script. `userAgent` now joins the request settings whose placeholders are dropped when the file is repository-controlled: `REQUEST_SCALAR_KEYS` in v11, and the filtered scalars of `substitute_env_untrusted` in v12. Trusted sources (the global config and the environment overlay) still expand it. Closes pnpm#15415
Summary
A
userAgentset in a repository'spnpm-workspace.yamlhad its${VAR}placeholders resolved against the installer's environment and sent as theUser-Agentheader to a registry that the same file can name. This PR treatsuserAgentlike the request-destination settings: a placeholder in it is dropped when the file is repository-controlled. It stays expanded from trusted sources.userAgentis added to the scalar set gated byexpandRequestDestinationEnv. The set is renamedREQUEST_SCALAR_KEYSbecause it now covers "what goes with a request" as well as "where it goes".user_agentmoves out ofsubstitute_env_scalarsintosubstitute_env_trusted, andsubstitute_env_untrusteddrops it when it holds a placeholder. It shares the filter loop withpnprServerand the proxies.The issue also asks for a review of other settings that go out with a request. I checked the string settings both stacks expand from a project file (
scriptShell,nodeOptions, the directory settings,npmrcAuthFile). None of them is sent in a request, and auth values are already gated separately. So this PR only coversuserAgent.Closes #15415
Squash Commit Body
Checklist
already linked to it solves it.
are implemented in every affected version.
pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
🤖 Generated with Claude Code
Written by an agent (Claude Code, claude-opus-5-5).
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
userAgentsettings are now ignored by default, preventing installer environment values from being included in request headers. LiteraluserAgentvalues remain unchanged.userAgentsettings are still expanded.