GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||
GeezerVison is showing github.com — Fix pnpm trustLockfile env override ignored (#1514) by mikolalysenko · Pull Request #1533 · SocketDev/socket-patch Conversation
|
| Issue | Regression test | Red without fix | Green with fix |
|---|---|---|---|
| #1514 | hosted::engine::tests::issue_1514_a_trust_lockfile_env_override_is_respected (lowercase and uppercase variable, existing trustLockfile: true, member lock; controls: true, npm spelling, pnpm 10 pin) |
failed: ["pnpm-lock.yaml", "pnpm-workspace.yaml"] written |
ok |
| #1514 | utils::pnpm_workspace::tests::the_environment_sets_trust_lockfile_only_for_pnpm_11_and_newer |
n/a (new API) | ok |
| #1514 | e2e e2e_redirect_pnpm_build::pnpm11_trust_lockfile_env_override_is_respected (real pnpm 11.28.5, SOCKET_PATCH_PNPM_E2E_REQUIRED=1) |
failed: rewrittenFiles: ["pnpm-workspace.yaml"], "installs need no extra flags" |
ok; control re-run without the variable heals the key |
Run locally:
cargo fmt --all -- --check: okcargo clippy --workspace --all-features -- -D warnings: okcargo test -p socket-patch-core --all-features --lib: 6484 passed. 4 failed, all of them read-only-permission tests (copy_tree::relax_loop_must_not_traverse_symlinked_root, vlt_heal::an_unremovable_hidden_lock_keeps_every_store_entry, pypi_poetry::wire_write_failure_maps_error_and_leaves_lock_untouched, pypi_requirements::wire_failure_rolls_back_already_written_files). They can't fail as root, which is how the sandbox runs, and they are unrelated to this diff.cargo test -p socket-patch-cli --all-features --lib --bins: 920 passede2e_redirect_pnpm_build -- --ignored pnpm11_: 4 passedcargo test --workspace build ran out of sandbox disk while linking the CLI integration binaries. CI covers those.npm/, pypi/, gem/) changes are needed: this is engine-only.pnpm_config_trust_lockfile=0 coercion. The value is read with the repo's existing env convention (PnpmSetting::as_bool, the npm-config reader: only ''/false/null/undefined are false), the same as every other pnpm env setting here. Changing that convention for one key would make them disagree.pnpm_config_trust_lockfile=false env override and says "installs need no extra flags", but the next frozen install fails with ERR_PNPM_TARBALL_URL_MISMATCH #1514 verified that PNPM_CONFIG_TRUST_LOCKFILE=false makes pnpm 12.11.2 fail on Linux, so it is honoured.npm_config_allow_remote precedent (CLI_CONTRACT), and the warning says plainly that nothing was written and why.std::env in view_setting. The injection keeps the engine testable and lets the in-memory engine opt out. Moving lockfile/gitBranchLockfile onto it is a separate refactor.🤖 Generated with Claude Code
https://claude.ai/code/session_018Vu8yCCshtPxwd4jscWRAU
Generated by Claude Code
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Assisted-by: Claude Code:claude-opus-5-5
pnpm 11 and 12 read pnpm_config_trust_lockfile (or its uppercase spelling) ahead of pnpm-workspace.yaml. With it set to false, a hosted scan still wrote trustLockfile: true there and said installs need no extra flags, so every install in that environment failed with ERR_PNPM_TARBALL_URL_MISMATCH. The scan now treats a non-true value of that variable as an explicit user setting, like trustLockfile: false in the file: on a project whose pnpm is 11 or newer (or unknown) it writes nothing and the trust warning names the variable and the remedies (unset it or set it to true for installs, or use --mode vendored). The in-memory engine sees no environment and is unchanged. Fixes #1514 Assisted-by: Claude Code:claude-opus-5-5
Assisted-by: Claude Code:claude-opus-5-5
Review follow-ups for the trustLockfile env override: - The trust check now reads the project's pnpm major through the same helper as the lockfile setting (#1460) instead of a second copy, and the env reader reuses the existing variable lookup. - A project pinned to pnpm 9.0-10.4, or with a keyless workspace file that lists members, keeps its more specific guidance; the override only replaces the generic write. - A workspace member scanned with the override set is no longer refused with advice to add trustLockfile: true to the root file, which the variable would override anyway; the scan pins the member lock and its warning names the variable. Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 2dc1100. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Final reviewer: sent to the merge queue (squash). Approved by Tanmay Singla (@Tanmay182003) on the current head 2dc1100, Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Hosted pnpm 11/12 scan ignores apnpm_config_trust_lockfile=false env override and says "installs need no extra flags", but the next frozen install fails with ERR_PNPM_TARBALL_URL_MISMATCH
There was an error while loading. Please reload this page.