feat(pacquet/cli): accept --config.<key>=<value> overrides#11806
Conversation
When pnpm delegates `install` to the pacquet binary it forwards the user's `pnpm install` flags verbatim, including pnpm's `--config.<key>=<value>` universal syntax (handled by npm-conf upstream). Pacquet's clap parser previously rejected those tokens with `unexpected argument '--config.registry'`, causing the delegated install to fail. Strip every `--config.*` token out of argv before clap parses it and layer the values onto `Config` after `.npmrc`/yaml have been applied, mirroring pnpm 11's `CLI > yaml > .npmrc > defaults` precedence. Only `registry` is wired in for now (matches the immediate test gap); unknown keys are accepted silently so a pnpm-side key pacquet hasn't ported yet doesn't break the delegation. Malformed tokens (`--config.foo`, `--config.=value`) are dropped on the same path so clap never sees them either.
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 selected for processing (3)
📜 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). (7)
🧰 Additional context used📓 Path-based instructions (1)pacquet/**/*.rs📄 CodeRabbit inference engine (pacquet/AGENTS.md)
Files:
🧠 Learnings (2)📚 Learning: 2026-05-20T19:40:55.051ZApplied to files:
📚 Learning: 2026-05-20T23:07:58.444ZApplied to files:
🔇 Additional comments (3)
📝 WalkthroughWalkthroughThis PR introduces a CLI-level configuration override layer that allows users to pass ChangesCLI Config Override Layer
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested labels
🚥 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)
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 #11806 +/- ##
==========================================
+ Coverage 87.39% 87.43% +0.04%
==========================================
Files 200 201 +1
Lines 23514 23598 +84
==========================================
+ Hits 20550 20634 +84
Misses 2964 2964 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Integrated-Benchmark Report (Linux)Scenario: Frozen Lockfile
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.40036829344,
"stddev": 0.1050268168315364,
"median": 2.36897585904,
"user": 2.8754877799999994,
"system": 3.6314742800000004,
"min": 2.27853064104,
"max": 2.60403851004,
"times": [
2.33981549504,
2.60403851004,
2.41556580704,
2.56647584304,
2.32734825104,
2.34096298004,
2.38591875204,
2.39299368904,
2.35203296604,
2.27853064104
]
},
{
"command": "pacquet@main",
"mean": 2.37670238114,
"stddev": 0.06689583633200591,
"median": 2.35052987454,
"user": 2.8304281799999993,
"system": 3.6187403800000006,
"min": 2.31026659704,
"max": 2.49392200704,
"times": [
2.33250612504,
2.49392200704,
2.32566927004,
2.43570805604,
2.34426598004,
2.36820337204,
2.32404801004,
2.47564062504,
2.31026659704,
2.35679376904
]
},
{
"command": "pnpm",
"mean": 4.638177689040001,
"stddev": 0.025402036915555325,
"median": 4.6325438190399995,
"user": 7.87704288,
"system": 4.092197779999999,
"min": 4.6076446000399995,
"max": 4.6968055700399995,
"times": [
4.62686984504,
4.62122116804,
4.6968055700399995,
4.64941399504,
4.61853495804,
4.65922256104,
4.6076446000399995,
4.6369765550399995,
4.63367973804,
4.631407900039999
]
}
]
}Scenario: Frozen Lockfile (Hot Cache)
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.7207035657,
"stddev": 0.05499984079967497,
"median": 0.7045185462000001,
"user": 0.40093378,
"system": 1.5993881399999998,
"min": 0.6899391507000001,
"max": 0.8756594627000001,
"times": [
0.8756594627000001,
0.7068872407000001,
0.7148025217000001,
0.7135381087000001,
0.7050089567000001,
0.6899391507000001,
0.7039254707000001,
0.7001156597000001,
0.7040281357000001,
0.6931309497000001
]
},
{
"command": "pacquet@main",
"mean": 0.7422501401000001,
"stddev": 0.0552734612472116,
"median": 0.7140919757000002,
"user": 0.39151798000000004,
"system": 1.60983604,
"min": 0.7089095457000001,
"max": 0.8687884647000002,
"times": [
0.7602359867000001,
0.7098102817,
0.7093322177000001,
0.8101704147000001,
0.7181213997000001,
0.7089095457000001,
0.7175089317000001,
0.8687884647000002,
0.7106750197000001,
0.7089491387000001
]
},
{
"command": "pnpm",
"mean": 2.532829624,
"stddev": 0.12378924192489676,
"median": 2.5181609416999997,
"user": 2.9862776799999997,
"system": 2.20655244,
"min": 2.3231411667,
"max": 2.7568331787,
"times": [
2.5140825636999997,
2.5176544837,
2.5080767137,
2.7568331787,
2.5672360036999997,
2.5632470597,
2.3878281047,
2.3231411667,
2.6715295657,
2.5186673997
]
}
]
} |
Summary
--config.<key>=<value>tokens out of argv before clap parses, and layers the values ontoConfigafter.npmrc/pnpm-workspace.yamlhave been applied — matching pnpm 11'sCLI > yaml > .npmrc > defaultsprecedence.registryis wired in for now; unknown keys are accepted silently (forward-compat with future pnpm keys); malformed tokens (--config.foo,--config.=value) are dropped so clap never sees them.ConfigOverrideslives inpacquet/crates/cli/src/config_overrides.rswith 5 unit tests covering the happy path, unknown-key tolerance, malformed-token dropping, last-value-wins, and the no-op case.Context
When pnpm delegates
installto pacquet (viaconfigDependencies) it forwards the user'spnpm installflags verbatim, including pnpm's--config.<key>=<value>universal syntax (npm-conf upstream). Pacquet's clap parser previously rejected those witherror: unexpected argument '--config.registry' found, which broke the e2epnpm install --config.registry=…path on the JS side (the failing case being added in #11774 —pnpm/test/install/pacquet.ts).A companion change on the JS side (filed separately) tightens
runPacquet.ts's command-token detection so that a leading--config.*doesn't causeinstallto be re-forwarded as a positional. Both changes are needed for the JS test to flip green end-to-end; this PR is the pacquet half.Test plan
cargo nextest run -p pacquet-cli(92 tests pass, including 5 newconfig_overridestests)cargo clippy -p pacquet-cli --all-targets --locked -- --deny warnings(clean)cargo fmt --check(clean)pnpm install --config.registry=…e2e test inpnpm/test/install/pacquet.tsgoes green end-to-end.Written by an agent (Claude Code, claude-opus-4-7).
Summary by CodeRabbit
--config.<key>=<value>arguments, enabling users to customize configuration values directly from the command line without modifying config files.