Repository navigation
Fix pnpm trust warning for per-member locks (#1268) - #1781
Merged
Mikola Lysenko (mikolalysenko) merged 3 commits intoOct 28, 2026
Merged
Mikola Lysenko (mikolalysenko) merged 3 commits into
Mikola Lysenko (mikolalysenko) merged 3 commits into
Conversation
Assisted-by: Claude Code:claude-opus-5-5
In a pnpm workspace with sharedWorkspaceLockfile: false, hosted mode pins each member's own pnpm-lock.yaml and adds trustLockfile: true to the root pnpm-workspace.yaml. Rollback and remove only looked at the root lock when deciding whether that setting is still needed, so: - restoring a member lock never warned pnpm_trust_lockfile_left, silently leaving pnpm's lockfile tarball check turned off; - restoring the root lock while a member lock stayed hosted reported the setting as unneeded. The cleanup now treats the root lock and every member lock of the workspace as the locks the setting trusts. Fixes #1268 Assisted-by: Claude Code:claude-opus-5-5
Review follow-ups for the member-lock trust cleanup: - when the workspace's member locks cannot be listed, leave the trust setting alone instead of judging it by the root lock only, since a member lock may still be hosted; - only list member locks when the restore actually put a pnpm lock back, so rollbacks of other ecosystems don't walk the workspace; - reuse the new registry mock in the existing pnpm rollback helper. Assisted-by: Claude Code:claude-opus-5-5
Mikola Lysenko (mikolalysenko)
marked this pull request as ready for review
October 28, 2026 13:12
Collaborator
Author
|
BugBot review Generated by Claude Code |
Bugbot is paused — your team has an unpaid invoiceBugbot is paused because your team has an unpaid invoice. Pay it from the billing page in the Cursor dashboard and Bugbot resumes automatically. (requestId: d85e8278-a4c0-408e-b521-b68aa77bce76) |
Bugbot is paused — your team has an unpaid invoiceBugbot is paused because your team has an unpaid invoice. Pay it from the billing page in the Cursor dashboard and Bugbot resumes automatically. (requestId: 309630ee-4b7e-4d75-9859-43ea820c2eb5) |
Tanmay Singla (Tanmay182003)
approved these changes
Oct 28, 2026
Collaborator
Author
|
bugbot run Generated by Claude Code |
Bugbot is paused — your team has an unpaid invoiceBugbot is paused because your team has an unpaid invoice. Pay it from the billing page in the Cursor dashboard and Bugbot resumes automatically. (requestId: 8bbd68d4-d09f-43f4-8996-036914c1c1bb) |
Mikola Lysenko (mikolalysenko)
deleted the
agent/fix-pnpm-member-lock-trust-cleanup
branch
October 28, 2026 14:55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
LLM Description written by Claude Code:claude-opus-5-5
Fixes #1268
What was wrong
In a pnpm workspace with
sharedWorkspaceLockfile: false(or pnpm 9's.npmrcshared-workspace-lockfile=false), hosted mode pins each member's ownpackages/<m>/pnpm-lock.yaml(#1007) and addstrustLockfile: trueto the rootpnpm-workspace.yaml.rollback/removethen decided whether that setting was still needed by looking at the rootpnpm-lock.yamlonly (cleanup_side_configinpatch/redirect/upstream/npm.rs):pnpm_trust_lockfile_leftnever fired and pnpm's lockfile tarball check stayed off with no warning (the reported bug);Fix
New
trusted_pnpm_locks_restoredtreats the root lock plus every member lock thatpnpm_workspace::member_lockslists (the same listing the hosted engine pins from) as the locks the root file trusts. The cleanup runs when the restore staged any of them and none is still hosted. If the member locks can't be listed, it fails closed and leaves the setting alone. The member walk runs only when apnpm-lock.yamlwas actually restored. TheCLI_CONTRACT.mdside-settings sentence now names member locks.Tests (
crates/socket-patch-cli/tests/in_process_redirect_pnpm.rs).npmrc(pnpm 9)issue_1268_rollback_of_a_member_lock_warns_trust_lockfile_left(realscan --mode hosted, thenrollback --json)[reinstall_required]issue_1268_member_lock_still_hosted_keeps_trust_without_warning(scoped rollback)pnpm_trust_lockfile_leftLocal evidence
cargo fmt --all -- --check,cargo clippy --workspace --all-features -- -D warnings: cleancargo test -p socket-patch-cli --all-features --test in_process_redirect_pnpm: 41 passedcargo test -p socket-patch-cli --all-features --test in_process_rollback_hosted: 41 passedcargo test -p socket-patch-cli --all-features --test e2e_redirect_pnpm_build -- --ignored --skip pnpm_pinned_matrix(real pnpm 7–11 via corepack): 11 passedcargo test -p socket-patch-core --all-features --lib: 6800 passed. The 4 failures, and 3 inin_process_redirect, are chmod-based write-failure tests that can't fail when the sandbox runs as root (uid 0). They don't touch this code. The fullcargo test --workspaceran out of sandbox disk, so CI covers the rest./code-review highfindings not fixed here--cwd packages/<m>: the cleanup then reads the member directory'spnpm-workspace.yaml, not the root file. This was already the case before this PR, for the root-lock case too. It's a separate shape (resolving the governing root for side settings), so I left it as a follow-up.vendortakeovers call the samerestore_upstream, so they now report the warning for member locks too. That's intended and the same code path, so there's no separate test.https://claude.ai/code/session_011f9aeQF4jrBX48TtNJKzzB
Generated by Claude Code