Repository navigation
CI: hermetic spawns in scan/vendor tests (#823) - #1448
Merged
Mikola Lysenko (mikolalysenko) merged 3 commits intoOct 12, 2026
Merged
Conversation
Assisted-by: Claude Code:claude-opus-5-5
This was referenced Oct 12, 2026
13 scan, vendor and vex test files started socket-patch with a bare Command::new and their own SOCKET_* scrub. The copies disagreed, and most of scan_vendor_e2e's spawns plus every spawn in the two requirements-lock scan suites scrubbed nothing. A developer shell with SOCKET_API_URL, SOCKET_JSON or SOCKET_DRY_RUN set failed 28 of their tests on main. Every spawn now goes through tests/common/hermetic.rs, and the files leave PENDING_RAW_SPAWNS (126 -> 113) so the ratchet keeps them hermetic. Refs #823. Assisted-by: Claude Code:claude-opus-5-5
The run helpers' comments still said every ambient SOCKET_* var is removed. The hermetic builder instead keeps telemetry opt-outs and forces SOCKET_NO_CONFIG, SOCKET_NO_UPDATE_CHECK and telemetry off. Assisted-by: Claude Code:claude-opus-5-5
Collaborator
Author
|
BugBot review Generated by Claude Code |
Mikola Lysenko (mikolalysenko)
marked this pull request as ready for review
October 12, 2026 21:12
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 9330762. Configure here.
Tanmay Singla (Tanmay182003)
approved these changes
Oct 12, 2026
Collaborator
Author
|
Ready for review (burn-down agent)
Generated by Claude Code |
Mikola Lysenko (mikolalysenko)
deleted the
agent/fix-ci-hermetic-scan-vendor
branch
October 12, 2026 22:57
This was referenced Oct 13, 2026
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 5 of the hermetic-spawn migration; the issue stays open for the remaining files).
What was wrong
13 test files (
scan_*, top-levelvendor_*,vex_terminal_output) spawnedsocket-patchwith a bareCommand::newand their ownSOCKET_*scrub. The copies disagreed, and many spawns scrubbed nothing:scan_vendor_e2eonly setSOCKET_TELEMETRY_DISABLED.scan_requirements_lock_onlyandscan_vendor_requirements_unwiredscrubbed noSOCKET_*var at all.vex_terminal_output,vendor_eject*,scan_rollout_e2eandvendor_jvm_clialso removedSOCKET_NO_CONFIG. So a developer who ransocket logincould have their real token picked up through the config fallback.Change (test-only)
tests/common/hermetic.rs(hermetic_command/hermetic::binary_command). The hand-rolled loops and the redundant telemetry and no-config sets are gone. Env the tests inject themselves (SOCKET_MAX_NEW_PATCHES,SOCKET_PATCH_FAILPOINT,SOCKET_VENDOR_URL,SOCKET_API_URL,extra_env) is still applied after the builder, so it wins.PENDING_RAW_SPAWNS(126 → 113 on main), so the ratchet inspawn_env_hygienekeeps them hermetic.hermetic.rsis untouched. Whichever merges second rebases cleanly.Evidence
cargo test -p socket-patch-cli --all-featuresover the 14 changed targets: 272/272 pass.SOCKET_DRY_RUN=true SOCKET_JSON=true SOCKET_SILENT=true SOCKET_API_TOKEN=hostile SOCKET_API_URL=http://127.0.0.1:1 SOCKET_PROXY_URL=http://127.0.0.1:1 SOCKET_NO_CONFIG=0 SOCKET_ORG_SLUG=hostile SOCKET_ECOSYSTEMS=cargo SOCKET_OFFLINE=true) over the 13 suites:scan_requirements_lock_only10/10,scan_vendor_e2e14/58,scan_vendor_requirements_unwired4/4.spawn_env_hygiene14/14, includingno_new_bare_binary_spawns.cargo fmt --all -- --checkis clean. The changed code is test-only and CI'scargo clippy --workspacedoesn't lint test targets. Running clippy on these test targets reports the same errors as main, all in the sharedprebuilt_common/andcommon/jvm_envhelpers./code-review high
No correctness findings. Fixed: stale "every ambient
SOCKET_*var scrubbed" doc comments in thevendor_eject*helpers. Not fixed here:Extra::Venvremoves onlyVIRTUAL_ENV, but the Python crawler also falls back toCONDA_PREFIX. Soscan_requirements_lock_onlyandscan_vendor_requirements_unwiredstill remove both by hand, and that stays correct. WideningExtra::Venvchanges every suite that uses it, so it belongs in its own change. I'll note it on Spawn every CLI test child through one hermetic Command builder; 10 test files inherit ambient SOCKET_* today #823.vex_terminal_output::cli()is now a one-line wrapper aroundhermetic::binary_command(). I kept it to keep the diff small, since it has many call sites.Follow-ups for #823: the 113 remaining
PENDING_RAW_SPAWNSfiles (mostlye2e_*,in_process_*,vex_*,vlt_*), the PTY spawns, andExtra::VenvcoveringCONDA_PREFIX.🤖 Generated with Claude Code
https://claude.ai/code/session_01YZvGQWp5o1nrjdaai8HpoG
Generated by Claude Code