Skip to content

fix(cli): refuse machine-level settings in a project manifest - #16366

Merged
zkochan merged 3 commits into
pnpm:mainfrom
tunglambk:fix/config-set-not-a-project-setting
Sep 29, 2026
Merged

zkochan merged 3 commits into
pnpm:mainfrom
tunglambk:fix/config-set-not-a-project-setting

Conversation

@tunglambk

@tunglambk tunglambk commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

pnpm config set --location=project writes any key it accepts into pnpm-workspace.yaml, including machine-level settings such as stateDir, scope, or configDir. The reader then reports those keys as ones a project manifest cannot carry and ignores them, so the write quietly does nothing, and the documented ERR_PNPM_CONFIG_SET_NOT_A_PROJECT_SETTING is never raised.

On current main:

$ printf 'storeDir: ~/store\n' > pnpm-workspace.yaml
$ pnpm config set --location=project stateDir /tmp/somewhere; echo $?
0
$ cat pnpm-workspace.yaml
stateDir: /tmp/somewhere
storeDir: ~/store

docs/cli/config.md says the command "fails with ERR_PNPM_CONFIG_SET_NOT_A_PROJECT_SETTING, naming where the setting belongs when it belongs somewhere". pnpm 11 already does this in config/commands/src/configSet.ts, with a test for each of config-dir, pnpmHomeDir, and state-dir. This is v12-only, so nothing changes in v11.

The write path now checks is_refused_by_a_project_manifest before writing to the workspace manifest and raises that error with where_refused_key_belongs as the help text. validate_workspace_key also accepts a refused key, so pnpm config delete can still clear one a hand-edited manifest carries; a removal skips the new check. A removal also clears the spelling the user gave and the kebab-case one, since a hand-edited manifest may carry state-dir rather than stateDir, matching pnpm 11.

$ pnpm config set --location=project stateDir /tmp/somewhere; echo $?
Error: ERR_PNPM_CONFIG_SET_NOT_A_PROJECT_SETTING
  × The key "stateDir" cannot be set in a project's pnpm-workspace.yaml
  help: Set it for the machine instead: pnpm config set --global state-dir
1

set_refuses_a_machine_level_key_in_the_project_manifest is the regression test and fails on main; delete_clears_a_machine_level_key_from_the_project_manifest and delete_clears_every_spelling_of_a_machine_level_key guard the delete path. config_set_refuses_a_machine_level_key_in_the_project_manifest in pnpm/crates/cli/tests/suite/config_get_set.rs runs the command and checks the exit status and the help text. Both are in pnpm/crates/cli/src/cli_args/config/tests.rs.

I couldn't run the husky pre-push hook here: it runs through corepack, whose cache directory under /home/tunglpb/.cache/node/corepack isn't writable in this environment, so the push used --no-verify. I ran the Rust steps it covers by hand: cargo clippy -p pnpm-cli --all-targets -- -D warnings, RUSTDOCFLAGS='-D warnings' cargo doc -p pnpm-cli --no-deps --all-features --document-private-items, cargo dylint --all -- --all-targets --workspace, typos pnpm pnpr, and the focused nextest run all pass. The pinned formatter (node pnpm/scripts/rustfmt.mjs) couldn't run locally because its cached build isn't present, but the Rust CI / Format job passed. Two config tests fail in this sandbox on unmodified main too, for environment reasons: ci_detection::tests::every_ci_info_vendor_is_detected (no installed ci-info) and store_path::tests::host_can_link_between_dirs_same_volume_is_true (link(2) is denied here).

Squash Commit Body

pnpm config set --location=project wrote a machine-level setting such as
stateDir or scope into pnpm-workspace.yaml, even though the reader then
reports it as a setting a project manifest cannot carry and ignores it.
The documented ERR_PNPM_CONFIG_SET_NOT_A_PROJECT_SETTING was never raised.

The write path now rejects a refused key with that code and names where the
setting belongs. validate_workspace_key accepts a refused key, so pnpm
config delete can still clear one a hand-edited manifest already carries.
A removal also clears the kebab-case spelling of the key, as pnpm 11
does, since the reader refuses a machine-level key under either spelling.

Checklist

  • New features are implemented only in the Rust pnpm v12 CLI. Bug fixes are implemented in every affected version.
  • Added a changeset (pnpm changeset) if this PR changes any published package. Keep it short and written for pnpm users — it becomes a release note.
  • Added or updated tests.

Written by an agent (DeepSeek Harness, deepseek-v4.1-flash).

Summary by CodeRabbit

  • Bug Fixes
    • pnpm config set --location=project now rejects machine-level settings that cannot be stored in a project manifest and explains where they belong.
    • Rejected settings leave the project’s workspace configuration unchanged.
    • pnpm config delete now clears alternate camel-case and kebab-case spellings of the requested setting from project configuration, while preserving unrelated settings. This keeps deletions effective even when a setting was entered using a different spelling.

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: pnpm/pnpm/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: e93ab7cd-3050-4746-9405-5ec29605b3f9

📥 Commits

Reviewing files that changed from the base of the PR and between fab5aeb and 843e11a.

📒 Files selected for processing (1)
  • pnpm/crates/cli/tests/suite/config_get_set.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.


📝 Walkthrough

Walkthrough

Project-manifest config writes now reject refused machine-level settings and leave the workspace file unchanged. Deleting a setting removes alternate spellings and preserves unrelated entries.

Changes

Project config key handling

Layer / File(s) Summary
Validate and update project-manifest settings
pnpm/crates/cli/src/cli_args/config.rs, pnpm/crates/cli/src/cli_args/config/values.rs, pnpm/crates/cli/src/cli_args/config/tests.rs, pnpm/crates/cli/tests/suite/config_get_set.rs, .changeset/config-set-refuses-machine-level-keys.md
Workspace-key validation accepts refused keys so project writes can return SetNotAProjectSetting for non-null values. Null values clear alternate key spellings. Tests cover rejected writes and deletion of alternate spellings while preserving unrelated settings. The changeset documents the stated config set and config delete behavior.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested labels: product: pacquet

Merge Risk: ⚪ Minimal · up to 843e1

The change rejects machine-level project settings and allows existing entries to be deleted. No actionable merge-blocking risk is identified; merge after normal checks pass.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 843e1

The change strengthens separation between project and machine settings on the existing CLI path. No new privilege boundary or attack path was established. Alias deletion can partially complete after a file-update failure, and incomplete coverage limits confidence in the overall assessment.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The inspected exposure is a local CLI configuration operation against its resolved filesystem target. The changed test does not establish new remote reachability, tenant scope, or elevated authority.

Trust Boundaries and Controls

  • observed — CLI-provided keys and values pass through key validation and value casting before the project-only refusal check. A refused non-null value returns an error before the manifest writer is called; null/delete follows the cleanup path instead.

Resilience and Maintainability Implications

  • inferred — Without concurrent modification, retrying deletion can finish partial alias cleanup: missing fields produce an unchanged result, and subsequent operations remove remaining spellings. This is retry-based recovery, not rollback of the entire deletion sequence.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov-commenter

codecov-commenter commented Sep 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.16%. Comparing base (ec65716) to head (843e11a).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #16366   +/-   ##
=======================================
  Coverage   92.16%   92.16%           
=======================================
  Files        1516     1516           
  Lines      204072   204106   +34     
=======================================
+ Hits       188089   188124   +35     
+ Misses      15983    15982    -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Same-run regression check

HEAD 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.

Scenario Engine main median HEAD median Change Tolerance Result
isolated-fresh-restore-cold-cache-cold-store pacquet 2628.15 ms 2793.25 ms 6.3% 131.41 ms Inconclusive (overlapping samples)
isolated-fresh-restore-cold-cache-cold-store pnpr 1469.91 ms 1489.27 ms 1.3% 73.50 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pacquet 276.66 ms 247.39 ms -10.6% 13.83 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pnpr 259.02 ms 293.91 ms 13.5% 12.95 ms Inconclusive (overlapping samples)
isolated-repeat-install-hot-cache-hot-store pacquet 12.90 ms 11.29 ms -12.5% 2.00 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pnpr 11.37 ms 13.21 ms 16.2% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pacquet 10.48 ms 12.03 ms 14.8% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pnpr 9.99 ms 9.97 ms -0.2% 2.00 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pacquet 2994.35 ms 2822.39 ms -5.7% 149.72 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pnpr 1640.33 ms 1695.63 ms 3.4% 82.02 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pacquet 672.70 ms 653.38 ms -2.9% 33.63 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pnpr 440.60 ms 439.59 ms -0.2% 22.03 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pacquet 1669.53 ms 1708.95 ms 2.4% 83.48 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pnpr 290.31 ms 297.12 ms 2.3% 14.52 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pacquet 292.18 ms 318.76 ms 9.1% 14.61 ms Inconclusive (overlapping samples)
isolated-fresh-resolve-hot-cache-offline pnpr 128.02 ms 107.59 ms -16.0% 6.40 ms Within tolerance
isolated-peer-heavy-resolve-hot-cache-offline pacquet 220.37 ms 253.09 ms 14.8% 11.02 ms Inconclusive (overlapping samples)
isolated-linked-workspace-resolve-hot-cache-offline pacquet 189.77 ms 200.56 ms 5.7% 9.49 ms Inconclusive (overlapping samples)
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pacquet 4688.38 ms 4629.61 ms -1.3% 234.42 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pnpr 3418.78 ms 3431.00 ms 0.4% 170.94 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pacquet 298.06 ms 170.43 ms -42.8% 14.90 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pnpr 334.57 ms 431.33 ms 28.9% 16.73 ms Inconclusive (overlapping samples)

Integrated-Benchmark Report (Linux)

Commit: fab5aeb52d98

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.832 ± 0.114 2.694 3.020 1.91 ± 0.21
pacquet@main 2.656 ± 0.106 2.516 2.819 1.80 ± 0.20
pnpr@HEAD 1.479 ± 0.151 1.298 1.656 1.00
pnpr@main 1.485 ± 0.141 1.318 1.692 1.00 ± 0.14
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.8320110071799998,
      "stddev": 0.11405739640693299,
      "median": 2.79324532898,
      "user": 2.2676125799999998,
      "system": 1.87712766,
      "min": 2.69399221198,
      "max": 3.01964813298
    },
    {
      "command": "pacquet@main",
      "mean": 2.65556554838,
      "stddev": 0.10646511864427925,
      "median": 2.6281534779799998,
      "user": 2.00761538,
      "system": 1.65034436,
      "min": 2.51620758898,
      "max": 2.81933067798
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.4789836937799998,
      "stddev": 0.1512908531265938,
      "median": 1.48927161898,
      "user": 1.3043565799999999,
      "system": 1.37363866,
      "min": 1.29783220698,
      "max": 1.65613877298
    },
    {
      "command": "pnpr@main",
      "mean": 1.48460762338,
      "stddev": 0.14121559562765915,
      "median": 1.46991046298,
      "user": 1.2989676799999998,
      "system": 1.37504696,
      "min": 1.31814135798,
      "max": 1.69186495798
    }
  ]
}

Scenario: Isolated linker: fresh restore, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 261.1 ± 35.8 237.9 353.7 1.00
pacquet@main 291.7 ± 45.5 244.7 397.3 1.12 ± 0.23
pnpr@HEAD 295.2 ± 37.9 246.2 387.3 1.13 ± 0.21
pnpr@main 278.7 ± 34.5 246.4 347.9 1.07 ± 0.20
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.26109227246000005,
      "stddev": 0.03581241151603727,
      "median": 0.24738507876000002,
      "user": 0.30125501999999993,
      "system": 0.5828425599999999,
      "min": 0.23786532426,
      "max": 0.35366347126000003
    },
    {
      "command": "pacquet@main",
      "mean": 0.29169997376,
      "stddev": 0.04547958496553499,
      "median": 0.27666149826,
      "user": 0.33666092,
      "system": 0.61685926,
      "min": 0.24467054826,
      "max": 0.3973035152600001
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.29519301266,
      "stddev": 0.03788291961960042,
      "median": 0.29390952926,
      "user": 0.31684431999999996,
      "system": 0.6378873599999999,
      "min": 0.24622735926,
      "max": 0.38733373126000004
    },
    {
      "command": "pnpr@main",
      "mean": 0.27874743356000004,
      "stddev": 0.034495692578082486,
      "median": 0.2590195417600001,
      "user": 0.31078991999999994,
      "system": 0.60556856,
      "min": 0.24635052026,
      "max": 0.34792665026
    }
  ]
}

Scenario: Isolated linker: repeat install, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 11.5 ± 1.3 8.8 16.1 1.00
pacquet@main 13.3 ± 2.6 9.1 21.0 1.15 ± 0.26
pnpr@HEAD 13.7 ± 3.4 8.5 22.0 1.19 ± 0.32
pnpr@main 11.6 ± 1.5 9.0 17.7 1.01 ± 0.17
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.011497945811707334,
      "stddev": 0.001257391283541814,
      "median": 0.01128559158,
      "user": 0.006188001138211384,
      "system": 0.006603026991869916,
      "min": 0.00876931758,
      "max": 0.016066210580000004
    },
    {
      "command": "pacquet@main",
      "mean": 0.01326438215254902,
      "stddev": 0.0025902030038392025,
      "median": 0.01290340758,
      "user": 0.007614513333333332,
      "system": 0.007103647529411765,
      "min": 0.00913909758,
      "max": 0.020963019580000002
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.01368032403454545,
      "stddev": 0.0034176876550452285,
      "median": 0.01321438358,
      "user": 0.00743618606060606,
      "system": 0.00767564193939394,
      "min": 0.00848329058,
      "max": 0.022022566580000003
    },
    {
      "command": "pnpr@main",
      "mean": 0.01158888451525181,
      "stddev": 0.001498575021006143,
      "median": 0.011368285580000002,
      "user": 0.006200597266187052,
      "system": 0.006661335971223021,
      "min": 0.00900092058,
      "max": 0.01770176358
    }
  ]
}

Scenario: Isolated linker: repeat install, cold cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 12.2 ± 1.2 9.6 17.4 1.21 ± 0.17
pacquet@main 10.7 ± 1.2 8.5 15.2 1.06 ± 0.16
pnpr@HEAD 10.2 ± 1.1 8.5 14.6 1.01 ± 0.15
pnpr@main 10.1 ± 1.0 8.3 13.5 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.012200329056208528,
      "stddev": 0.0011649740801973362,
      "median": 0.01203223726,
      "user": 0.006847069004739336,
      "system": 0.0067395814218009446,
      "min": 0.00960996526,
      "max": 0.01740363226
    },
    {
      "command": "pacquet@main",
      "mean": 0.010714453624999998,
      "stddev": 0.0012137664072284808,
      "median": 0.010479076260000001,
      "user": 0.006002065,
      "system": 0.005913299299999997,
      "min": 0.00846742826,
      "max": 0.015191888260000001
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.01023483909116883,
      "stddev": 0.0010740300257872206,
      "median": 0.00996838826,
      "user": 0.006419405887445887,
      "system": 0.0049089541991342,
      "min": 0.00849625126,
      "max": 0.014609040260000001
    },
    {
      "command": "pnpr@main",
      "mean": 0.010100552239674794,
      "stddev": 0.0010082067324029167,
      "median": 0.009987499260000001,
      "user": 0.005711338048780486,
      "system": 0.005453533495934958,
      "min": 0.00833583226,
      "max": 0.01352096126
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + cold store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.835 ± 0.173 2.543 3.088 1.71 ± 0.17
pacquet@main 3.020 ± 0.163 2.847 3.269 1.82 ± 0.18
pnpr@HEAD 1.681 ± 0.113 1.506 1.814 1.01 ± 0.11
pnpr@main 1.659 ± 0.136 1.500 1.897 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.8349536339999997,
      "stddev": 0.1728370462838892,
      "median": 2.822388519,
      "user": 2.867669,
      "system": 2.17762046,
      "min": 2.5432686275000003,
      "max": 3.0877132675000003
    },
    {
      "command": "pacquet@main",
      "mean": 3.0197093819,
      "stddev": 0.16298548716535988,
      "median": 2.9943482175000002,
      "user": 3.2806267999999994,
      "system": 2.4407125599999997,
      "min": 2.8470643985,
      "max": 3.2686030465
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.6810448119,
      "stddev": 0.11327091897847709,
      "median": 1.695628658,
      "user": 1.7526758999999998,
      "system": 1.77796976,
      "min": 1.5058689564999999,
      "max": 1.8141837214999998
    },
    {
      "command": "pnpr@main",
      "mean": 1.6592457265,
      "stddev": 0.1359571432710574,
      "median": 1.6403300719999998,
      "user": 1.5838819999999998,
      "system": 1.6507602600000002,
      "min": 1.5002971725,
      "max": 1.8965961395
    }
  ]
}

Scenario: Isolated linker: fresh install, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 656.0 ± 31.8 612.6 712.7 1.50 ± 0.10
pacquet@main 672.1 ± 38.0 603.3 745.1 1.54 ± 0.12
pnpr@HEAD 437.3 ± 21.6 406.5 472.5 1.00
pnpr@main 441.2 ± 10.0 425.6 455.3 1.01 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.6560336708600001,
      "stddev": 0.031832834191415464,
      "median": 0.6533781647600001,
      "user": 0.93046104,
      "system": 1.1141272799999997,
      "min": 0.6126420452600001,
      "max": 0.7126977692600001
    },
    {
      "command": "pacquet@main",
      "mean": 0.6721167477600001,
      "stddev": 0.037959144783804716,
      "median": 0.67269685176,
      "user": 0.9621531399999999,
      "system": 1.1179411799999999,
      "min": 0.6032663272600001,
      "max": 0.7451103052600001
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.43728349226,
      "stddev": 0.02161344319137024,
      "median": 0.43959322776000004,
      "user": 0.42764664,
      "system": 0.9084085799999999,
      "min": 0.40654186926,
      "max": 0.47249319726000005
    },
    {
      "command": "pnpr@main",
      "mean": 0.44117663886000014,
      "stddev": 0.01003712117267021,
      "median": 0.44060469576000005,
      "user": 0.44785094000000003,
      "system": 0.9104056799999999,
      "min": 0.42557702126,
      "max": 0.45531861926000006
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + hot store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.745 ± 0.076 1.684 1.905 5.87 ± 0.44
pacquet@main 1.677 ± 0.043 1.628 1.763 5.64 ± 0.37
pnpr@HEAD 0.298 ± 0.006 0.289 0.307 1.00 ± 0.06
pnpr@main 0.297 ± 0.018 0.271 0.327 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.74483506694,
      "stddev": 0.07590018772710139,
      "median": 1.7089530158400001,
      "user": 1.12225112,
      "system": 1.01561212,
      "min": 1.68415042384,
      "max": 1.90476887984
    },
    {
      "command": "pacquet@main",
      "mean": 1.6771379353400004,
      "stddev": 0.04333376766296385,
      "median": 1.66953168084,
      "user": 1.0024434199999999,
      "system": 0.93308562,
      "min": 1.62779295784,
      "max": 1.7629358458400002
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.2978062764400001,
      "stddev": 0.00613152772715852,
      "median": 0.29712206834,
      "user": 0.2729600199999999,
      "system": 0.56841012,
      "min": 0.28899026484,
      "max": 0.30695927484
    },
    {
      "command": "pnpr@main",
      "mean": 0.29718300874,
      "stddev": 0.01804922162201394,
      "median": 0.29031370584,
      "user": 0.24441001999999998,
      "system": 0.5696066199999998,
      "min": 0.27087101084,
      "max": 0.32715560984000003
    }
  ]
}

Scenario: Isolated linker: fresh resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 316.6 ± 19.7 274.1 337.7 2.94 ± 0.22
pacquet@main 298.8 ± 21.7 274.4 337.7 2.77 ± 0.23
pnpr@HEAD 107.8 ± 4.6 99.1 117.5 1.00
pnpr@main 127.7 ± 8.1 113.9 145.5 1.18 ± 0.09
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.31664775424,
      "stddev": 0.019668098253334692,
      "median": 0.31875665424000005,
      "user": 0.31664598,
      "system": 0.13732189999999997,
      "min": 0.27413061774,
      "max": 0.33771499274000005
    },
    {
      "command": "pacquet@main",
      "mean": 0.29878731134000003,
      "stddev": 0.021734314574007547,
      "median": 0.29217878674000003,
      "user": 0.28561607999999994,
      "system": 0.12076309999999998,
      "min": 0.27441400574,
      "max": 0.33774802074000004
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.10783894769999999,
      "stddev": 0.004621294991306896,
      "median": 0.10758525474000001,
      "user": 0.04968555999999999,
      "system": 0.02072842,
      "min": 0.09912508774,
      "max": 0.11753665774000001
    },
    {
      "command": "pnpr@main",
      "mean": 0.1277254811490909,
      "stddev": 0.008064174903037577,
      "median": 0.12801628224,
      "user": 0.06792047999999998,
      "system": 0.02683368181818182,
      "min": 0.11387720274,
      "max": 0.14551060274000002
    }
  ]
}

Scenario: Isolated linker: peer-heavy resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 253.0 ± 17.1 228.5 285.2 1.15 ± 0.09
pacquet@main 220.5 ± 7.7 209.7 229.3 1.00
pnpm@HEAD 3166.3 ± 554.0 2531.7 4377.8 14.36 ± 2.56
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.2530360731711111,
      "stddev": 0.017120279822708306,
      "median": 0.25308590906,
      "user": 0.2565501288888889,
      "system": 0.05577441555555555,
      "min": 0.22845805706000002,
      "max": 0.28515868506
    },
    {
      "command": "pacquet@main",
      "mean": 0.22046543739333335,
      "stddev": 0.007738981311090049,
      "median": 0.22037095406,
      "user": 0.2283351288888889,
      "system": 0.048630304444444446,
      "min": 0.20972352406000003,
      "max": 0.22930589506000001
    },
    {
      "command": "pnpm@HEAD",
      "mean": 3.166256251837778,
      "stddev": 0.5540329971684244,
      "median": 3.1027525070600004,
      "user": 4.686789684444444,
      "system": 0.2513506377777778,
      "min": 2.5317207870600003,
      "max": 4.37776611606
    }
  ]
}

Scenario: Isolated linker: linked-workspace resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 202.1 ± 6.4 191.7 217.5 1.05 ± 0.05
pacquet@main 192.4 ± 7.4 186.2 209.2 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.2020646262169231,
      "stddev": 0.006449526936476392,
      "median": 0.20056281114000002,
      "user": 0.15629420923076923,
      "system": 0.08277203076923076,
      "min": 0.19174936314000002,
      "max": 0.21752752514
    },
    {
      "command": "pacquet@main",
      "mean": 0.19240144556857144,
      "stddev": 0.007443425682384573,
      "median": 0.18977334464,
      "user": 0.14733608285714284,
      "system": 0.07597522857142856,
      "min": 0.18616518314000002,
      "max": 0.20921309314000003
    }
  ]
}

Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.709 ± 0.184 4.556 5.118 1.36 ± 0.07
pacquet@main 4.693 ± 0.157 4.481 4.905 1.36 ± 0.06
pnpr@HEAD 3.485 ± 0.125 3.391 3.744 1.01 ± 0.05
pnpr@main 3.454 ± 0.107 3.379 3.730 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.70864905296,
      "stddev": 0.18369493151682884,
      "median": 4.62960648716,
      "user": 2.4479504199999997,
      "system": 1.8866191999999997,
      "min": 4.55608552116,
      "max": 5.11838023116
    },
    {
      "command": "pacquet@main",
      "mean": 4.692729014259999,
      "stddev": 0.1570153117581765,
      "median": 4.68838020666,
      "user": 2.09730952,
      "system": 1.8155935999999997,
      "min": 4.48083529316,
      "max": 4.90536056816
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.4853508144600007,
      "stddev": 0.12533780110803705,
      "median": 3.43100151466,
      "user": 1.46503392,
      "system": 1.3800827,
      "min": 3.3912101631600002,
      "max": 3.7436761861600005
    },
    {
      "command": "pnpr@main",
      "mean": 3.4537502731600007,
      "stddev": 0.10720254489658075,
      "median": 3.41878185966,
      "user": 1.4343630199999997,
      "system": 1.4044107000000001,
      "min": 3.3787283941600004,
      "max": 3.72963619316
    }
  ]
}

Scenario: GVS linker: fresh restore, hot cache + hot store

Same 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.

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 176.8 ± 32.2 137.7 257.7 1.00
pacquet@main 295.5 ± 74.5 161.8 411.7 1.67 ± 0.52
pnpr@HEAD 428.7 ± 47.8 354.0 504.0 2.42 ± 0.52
pnpr@main 330.5 ± 29.8 275.7 381.0 1.87 ± 0.38
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.17683387788857144,
      "stddev": 0.03216824242141381,
      "median": 0.17042826496000002,
      "user": 0.2222469371428571,
      "system": 0.15134650857142856,
      "min": 0.13774386296,
      "max": 0.25773345296
    },
    {
      "command": "pacquet@main",
      "mean": 0.29552870727249997,
      "stddev": 0.07449718634793143,
      "median": 0.29806498396000003,
      "user": 0.350557205,
      "system": 0.21446832999999998,
      "min": 0.16181416496,
      "max": 0.41168779096
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.42873521426000005,
      "stddev": 0.04783404133200341,
      "median": 0.43132685696000006,
      "user": 0.47728048,
      "system": 0.26905408000000003,
      "min": 0.35401364096000004,
      "max": 0.50402388596
    },
    {
      "command": "pnpr@main",
      "mean": 0.33050446946,
      "stddev": 0.029781008704632482,
      "median": 0.33457110746,
      "user": 0.38194278000000004,
      "system": 0.25621768,
      "min": 0.27574260496,
      "max": 0.38102993196
    }
  ]
}

@tunglambk
tunglambk force-pushed the fix/config-set-not-a-project-setting branch from eb0de20 to 4450445 Compare September 29, 2026 02:22
@tunglambk
tunglambk marked this pull request as ready for review September 29, 2026 02:35
@tunglambk
tunglambk requested a review from zkochan as a code owner September 29, 2026 02:35
Copilot AI balanced review requested due to automatic review settings September 29, 2026 02:35
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Sep 29, 2026
pnpm config set --location=project wrote a machine-level setting such as
stateDir or scope into pnpm-workspace.yaml, even though the reader then
reports it as a setting a project manifest cannot carry and ignores it.
The documented ERR_PNPM_CONFIG_SET_NOT_A_PROJECT_SETTING was never raised.

The write path now rejects a refused key with that code and names where the
setting belongs. validate_workspace_key accepts a refused key, so pnpm
config delete can still clear one a hand-edited manifest already carries.
Copilot AI balanced review requested due to automatic review settings September 29, 2026 22:58
@zkochan
zkochan force-pushed the fix/config-set-not-a-project-setting branch from 4450445 to d4fd273 Compare September 29, 2026 22:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@qodo-code-review

qodo-code-review Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. CLI rejection lacks end-to-end coverage ✓ Resolved
Description
set_refuses_a_machine_level_key_in_the_project_manifest calls config_set directly, so it never
checks whether the command-line path displays the new diagnostic. If argument dispatch or error
rendering fails for pnpm config set --location=project, these assertions still pass without
verifying the nonzero exit status or displayed help text.
Code

pnpm/crates/cli/src/cli_args/config/tests.rs[R501-504]

+        let err = config_set(
+            &config,
+            tmp.path(),
+            flags(false, Some(ConfigLocation::Project), false),
Relevance

●● Moderate

Evidence is mixed: similar CLI-output coverage requests were accepted, but a recent internal-vs-CLI
request was rejected.

PR-#15049
PR-#13977
PR-#15337

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Rule 3365266 requires a real CLI invocation when a change affects CLI output. The added regression
test invokes the internal function, while the new error includes user-facing diagnostic text; the
existing suite demonstrates where CLI invocations are tested.

pnpm/crates/cli/src/cli_args/config/tests.rs[501-518]
pnpm/crates/cli/src/cli_args/config.rs[164-168]
pnpm/crates/cli/tests/suite/config_get_set.rs[10-30]
Skill: review-code

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The regression test calls an internal function and does not verify that the CLI renders the new error.

## Fix Focus Areas
- pnpm/crates/cli/src/cli_args/config/tests.rs[501-518]
- pnpm/crates/cli/tests/suite/config_get_set.rs[10-30]

## Recommended Fix
Add a test in the existing CLI suite that runs `pnpm config set --location=project stateDir /tmp/somewhere` and asserts a nonzero exit status, the error code and help text on stderr, and an unchanged workspace manifest.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
✅ Compliance rules (platform): 63 rules
✅ Skills: review-code
✅ Cross-repo context — repo relationships
  Explored: repo: pnpm/meta-updater (sha: c9936b78) — View relationship
  Explored: repo: pnpm/patch-package (sha: c97a62ea) — View relationship
  Explored: repo: pnpm/update (sha: fcaa952e) — View relationship
  Explored: repo: pnpm/setup (sha: fbda4c85) — View relationship
  Explored: repo: pnpm/logger (sha: 3c7188c0) — View relationship
  Explored: repo: pnpm/npm-package-arg (sha: c8d9ad1f) — View relationship
  Explored: repo: pnpm/colorize-semver-diff (sha: f562fa5c) — View relationship
  Explored: repo: pnpm/tabtab (sha: 3ee4b503) — View relationship
  Explored: repo: pnpm/semver-diff (sha: 24114e4e) — View relationship
  Explored: repo: pnpm/nopt (sha: 7f8522c6) — View relationship
  Explored: repo: pnpm/exec (sha: d9dca8d2) — View relationship
  Explored: repo: pnpm/normalize-registry-url (sha: 64f7a931) — View relationship
  Explored: repo: pnpm/parse-npm-tarball-url (sha: c2118132) — View relationship
  Explored: repo: pnpm/ramda (sha: 50c6b571) — View relationship
  Explored: repo: pnpm/symlink-dir (sha: bfbaef3f) — View relationship
  Explored: repo: pnpm/node-semver-rs (sha: 3d74d6b7) — View relationship
  Explored: repo: pnpm/cmd-shim (sha: 83f9b944) — View relationship
  Explored: repo: pnpm/node-byline (sha: ac1e6211) — View relationship
  Explored: repo: pnpm/npm-lifecycle (sha: 178f3d50) — View relationship
  Explored: repo: pnpm/hosted-git-info (sha: d3229cc6) — View relationship
  Explored: repo: pnpm/which (sha: 036b4d90) — View relationship
  Explored: repo: pnpm/get.pnpm.io (sha: 916ce9e8) — View relationship
  Explored: repo: pnpm/pnpm.io (sha: 94842f51) — View relationship
Review mode: 🚀 Fast: This is a localized regression-test-only change with no runtime, security, performance, or contract implementation impact.

Grey Divider

Tip of the day
💡 Did you know, you can add REVIEW.md to your repo root and Qodo follows it on every PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Previous reviews

Review updated until commit 843e11a

Results up to commit d4fd273 ⚖️ Balanced


🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Remediation recommended
1. CLI rejection lacks end-to-end coverage ✓ Resolved
Description
set_refuses_a_machine_level_key_in_the_project_manifest calls config_set directly, so it never
checks whether the command-line path displays the new diagnostic. If argument dispatch or error
rendering fails for pnpm config set --location=project, these assertions still pass without
verifying the nonzero exit status or displayed help text.
Code

pnpm/crates/cli/src/cli_args/config/tests.rs[R501-504]

+        let err = config_set(
+            &config,
+            tmp.path(),
+            flags(false, Some(ConfigLocation::Project), false),
Relevance

●● Moderate

Evidence is mixed: similar CLI-output coverage requests were accepted, but a recent internal-vs-CLI
request was rejected.

PR-#15049
PR-#13977
PR-#15337

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Rule 3365266 requires a real CLI invocation when a change affects CLI output. The added regression
test invokes the internal function, while the new error includes user-facing diagnostic text; the
existing suite demonstrates where CLI invocations are tested.

pnpm/crates/cli/src/cli_args/config/tests.rs[501-518]
pnpm/crates/cli/src/cli_args/config.rs[164-168]
pnpm/crates/cli/tests/suite/config_get_set.rs[10-30]
Skill: review-code

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The regression test calls an internal function and does not verify that the CLI renders the new error.

## Fix Focus Areas
- pnpm/crates/cli/src/cli_args/config/tests.rs[501-518]
- pnpm/crates/cli/tests/suite/config_get_set.rs[10-30]

## Recommended Fix
Add a test in the existing CLI suite that runs `pnpm config set --location=project stateDir /tmp/somewhere` and asserts a nonzero exit status, the error code and help text on stderr, and an unchanged workspace manifest.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

A hand-edited pnpm-workspace.yaml may carry a machine-level key in
kebab-case, such as state-dir, and the reader's warning names that
spelling. pnpm config delete removed only the camelCase key, so the
refused setting stayed in the file. A removal now also clears the
spelling the user gave and the kebab-case one, as pnpm 11 does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings September 29, 2026 23:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit fab5aeb

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

Run pnpm config set --location=project with a machine-level key and
check the exit status, the error code, the help text naming where the
setting belongs, and that pnpm-workspace.yaml is left as it was.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings September 29, 2026 23:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 843e11a

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants