Repository navigation
CI: hermetic spawns in npm/Bun suites (#823) - #1510
Merged
Mikola Lysenko (mikolalysenko) merged 4 commits intoOct 14, 2026
Merged
Conversation
Assisted-by: Claude Code:claude-opus-5-5
This was referenced Oct 13, 2026
The npm and Bun suites started socket-patch with a bare Command::new and their own SOCKET_* scrubs, which had drifted from tests/common/hermetic.rs. e2e_npm and the Bun redirect suite never forced the config layer or update notifier off, so a developer's `socket login` or an ambient SOCKET_NO_UPDATE_CHECK=0 reached the child; the in-process Bun vendor FIFO helper skipped the stand-in HOME the rest of that file's spawns get through common::run_with_env. All three now start from hermetic::command. The Bun redirect suite keeps its shared bun/npm registry scrub through scrub_ambient_bun_tool_env, the variant that leaves the builder's SOCKET_* opt-outs alone, and the FIFO helper adds jvm_env::isolate_cli to match run_with_env. e2e_npm keeps its partial cache pins so the global auto-discovery test still sees real prefixes. The files leave PENDING_RAW_SPAWNS (15 -> 12), so the ratchet keeps them hermetic. Refs #823 Assisted-by: Claude Code:claude-opus-5-5
From /code-review high: the Bun redirect suite ran its bun fixture installs under the cache sandbox's home but the CLI under the real one, so a registry or scope in the developer's ~/.npmrc would make the two disagree. The CLI now gets the stand-in HOME (jvm_env::isolate_cli), as run_with_env gives every other suite. Its --no-telemetry flag goes: hermetic::command already forces telemetry off, and the flag would override a caller opting back in. e2e_npm's npm installs now drop ambient SOCKET_* vars too (hermetic::scrub_socket_vars), like the package-manager children of the other converted suites. Refs #823 Assisted-by: Claude Code:claude-opus-5-5
Mikola Lysenko (mikolalysenko)
marked this pull request as ready for review
October 14, 2026 00:14
Collaborator
Author
|
BugBot review Generated by Claude Code |
…-npm-bun # Conflicts: # crates/socket-patch-cli/tests/spawn_env_hygiene.rs
Tanmay Singla (Tanmay182003)
approved these changes
Oct 14, 2026
Collaborator
Author
|
bugbot run Generated by Claude Code |
There was a problem hiding this comment.
✅ 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 94e91a1. Configure here.
Collaborator
Author
|
Ready for review at
Slack announcement didn't go out: this session has no Slack send tool. The next run will retry. Generated by Claude Code |
Mikola Lysenko (mikolalysenko)
deleted the
agent/fix-ci-hermetic-npm-bun
branch
October 14, 2026 01:58
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
Refs #823 (slice 15: npm/Bun suites). Uses
Refs, so #823 stays open for the remainingPENDING_RAW_SPAWNSfiles.Summary
e2e_npm.rs,e2e_redirect_bun_build.rsandvendor/in_process_vendor_bun.rsnow spawn socket-patch throughtests/common/hermetic.rsand leavePENDING_RAW_SPAWNS(12 → 9 on main after #1505), so the ratchet inspawn_env_hygiene.rskeeps them hermetic. Test-only; no product code and no workflow changes.Root cause
Each file started the CLI with a bare
Command::newand its ownSOCKET_*scrub, which had drifted from the shared builder:e2e_npmand the Bun redirect suite never forcedSOCKET_NO_CONFIG/SOCKET_NO_UPDATE_CHECKon, so a developer'ssocket loginor an ambientSOCKET_NO_UPDATE_CHECK=0reached the child.bunfixtures under the cache sandbox'sHOMEbut the CLI under the real one, so a registry/scope in the developer's~/.npmrccould make them disagree. The CLI now gets the stand-inHOME(jvm_env::isolate_cli), and its redundant--no-telemetryis gone (the builder forces telemetry off).HOMEthat every other spawn in that file gets viacommon::run_with_env.e2e_npm'snpm installchildren now drop ambientSOCKET_*too (hermetic::scrub_socket_vars).e2e_npmkeeps its realHOMEon purpose (the global auto-discovery test needs real prefixes).Test evidence
PENDING_RAW_SPAWNSremoval and none of the conversions,cargo test -p socket-patch-cli --test spawn_env_hygiene no_new_barefails:These test files spawn the binary with a bare Command::new: ["e2e_npm.rs", "e2e_redirect_bun_build.rs", "vendor/in_process_vendor_bun.rs"].spawn_env_hygiene16/16;vendor95/95;e2e_redirect_bun_build38/38 with real bun 1.4.2 andSOCKET_PATCH_BUN_E2E_REQUIRED=1, also run under hostile ambientSOCKET_ECOSYSTEMS=cargo SOCKET_DRY_RUN=true;e2e_npmnon-ignored 20/20.e2e_npm's 6#[ignore]d live-API tests can't reach patches-api.socket.dev from the agent sandbox (proxy tunnel refused), so they weren't run locally; CI doesn't run them either (opt-in live smoke).cargo fmt --all -- --check,cargo clippy --locked --workspace --all-features -- -D warnings: clean. No new clippy findings in the touched files under--tests.cargo test --workspaceran out of sandbox disk; CI covers it./code-review high
Fixed: CLI vs bun
HOMEmismatch, redundant--no-telemetry, unscrubbednpmchildren. Not fixed:e2e_npm'srunand the FIFOrun_with_deadlineinto a sharedcommonbuilder: a refactor ofcommonoutside this slice. The ratchet already stops new drift in theSOCKET_*handling.isolate_cliviacommon::run_with_env, and the test passes.CI cost
No workflow changes. Lean PR run is the same before and after (~28 Linux jobs, ~8 min).
🤖 Generated with Claude Code
https://claude.ai/code/session_01LsbTgBWpFb9LqLgDdQTsmf
Generated by Claude Code