Skip to content

Make pnpm CoW e2e independent of the live patch catalog - #1364

Merged
Mikola Lysenko (mikolalysenko) merged 2 commits into
mainfrom
ci-janitor/hermetic-pnpm-safety
Oct 9, 2026
Merged

Mikola Lysenko (mikolalysenko) merged 2 commits into
mainfrom
ci-janitor/hermetic-pnpm-safety

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

e2e (*, e2e_safety_pnpm) is a required leg on ubuntu (PR + merge queue), Windows and macOS (main/merge queue). It fetched the live minimist@1.2.2 patch with socket-patch get <uuid> and pinned that patch's after-hash. When production republished the patch on 2026-10-09 (#1293), 3 of its 4 tests failed in every run until the repin (#1301) landed:

Root cause

The suite tests the copy-on-write defense against a real pnpm store. It does not test the patch catalog, but it still depended on the catalog's exact contents.

Fix

Keep the real pnpm install (hardlinked shared store). Instead of get, stage a synthetic manifest and after-hash blob under proj_a/.socket/: the patched bytes are the pristine index.js plus a marker line. Then run socket-patch apply --offline. This is the same pattern e2e_safety_cow.rs already uses. BEFORE_HASH stays pinned, because published npm tarballs are immutable. Every CoW, inode-identity, frozen-reinstall and layout-note assertion is unchanged. The layout-note test now also asserts that the file was actually patched.

The live catalog keeps its coverage in e2e_npm, e2e_hosted_production and e2e_vendored_production, which #1301 repinned.

Proof

  • cargo test -p socket-patch-cli --test e2e_safety_pnpm -- --ignored passes 4/4 locally (pnpm 10, Linux).
  • Ran the built test binary 20 more times in a loop: 0 failures.
  • cargo clippy -p socket-patch-cli --test e2e_safety_pnpm -- -D warnings is clean, and rustfmt was run on the touched file only.

Where the tests run

No test was removed or moved. The same matrix rows still run them: e2e ubuntu on PRs, e2e-windows and e2e-macos. No workflow changes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UcDQZrWwmbg27Ut4sxrtLw


Generated by Claude Code

e2e_safety_pnpm proves apply's copy-on-write keeps a shared pnpm
store intact. It fetched the live minimist@1.2.2 patch with
`socket-patch get` and pinned its patched hash, so when production
republished that patch on 2026-10-09 (#1293) all three apply tests
failed in every CI and merge_group run on ubuntu, macOS and Windows
until the repin (#1301) landed.

Stage a synthetic manifest + after-hash blob for the real pnpm
install instead (pristine index.js + a marker line) and run
`apply --offline`, the same pattern e2e_safety_cow.rs uses. Every
CoW, inode and layout-note assertion is unchanged. The live patch
catalog keeps its coverage in e2e_npm and e2e_hosted_production.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UcDQZrWwmbg27Ut4sxrtLw
@mikolalysenko Mikola Lysenko (mikolalysenko) added the ci-janitor Opened by the CI janitor routine (flakes, redundant tests, CI perf) label Oct 9, 2026
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

bugbot run


Generated by Claude Code

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for 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 24c8b2c. Configure here.

@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

ci-ok failed on 24c8b2c because the CI run 37976351039 was cancelled from outside the run at 19:47:48Z, not because a test failed. 53 jobs passed and 41 were cancelled mid-flight. No job failed, and no newer run exists on this SHA, so this is not a change-caused failure (most likely a runner-backlog cleanup). I re-ran the failed and cancelled jobs once.


Generated by Claude Code

@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

On head 8c3671e (main merged in), e2e (ubuntu-latest, e2e_gradle_discovery_build e2e_gradle_agent_build e2e_redirect_gradle_build, …) failed because its Depot runner was lost mid-test, not because of a test assertion. The log shows The runner has received a shutdown signal 5 seconds into the second suite, then Step canceled by GitHub. This PR changes only e2e_safety_pnpm.rs and touches no Gradle code. I'll re-run the failed jobs once when the rest of run 37998395296 finishes.


Generated by Claude Code

@mikolalysenko
Mikola Lysenko (mikolalysenko) added this pull request to the merge queue Oct 9, 2026
Merged via the queue into main with commit 24888e8 Oct 9, 2026
96 of 100 checks passed
@mikolalysenko
Mikola Lysenko (mikolalysenko) deleted the ci-janitor/hermetic-pnpm-safety branch October 9, 2026 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-janitor Opened by the CI janitor routine (flakes, redundant tests, CI perf)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants