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
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Oct 13, 2026
* ci(release): publish npm from release.yml, not publish-npm.yml Every socket-patch npm package's trusted publisher is registered against release.yml, and npm allows only one publisher per package. The 5.0.0 release dispatched publish-npm.yml, whose OIDC token named that file, so npm rejected it with E401 before staging anything. Move the npm leg back inline as release.yml's npm-publish job (same steps as publish-npm.yml) and delete publish-npm.yml, so the existing registration keeps working. Add an `npm-retry-version` input that skips the version gate, build, tag, GitHub release and crates.io jobs and re-stages npm from an existing release's assets; this retries 5.0.0 now and replaces the manual Publish npm dispatch. crates.io stays dispatched through publish-cargo.yml, since crates.io allows several publishers per crate. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * chore(release): fold 22 more PRs into the 5.0.0 notes Cover the PRs merged to main after #1432's base (1779317..4cb3643): Cargo source replacement and registry = "crates-io" (#338/#455, #386), pnpm lockfile=false (#1074), berry removed descriptors (#1435), yarnrc ${VAR} reads (#1100), CRLF .npmrc append (#1196), Composer vendor-dir cascade and global home (#439/#686, #586), Go +incompatible vex (#484), gem moved BUNDLE_GEMFILE and commented Gemfile revert (#952, #988), Poetry source = "pypi" (#1282) and Hatch path characters (#547). No entries for #1411 (macOS fix to code #1393 added in this release; the #1393 entry already describes the intended behavior), #1426 (perf regression introduced and fixed within 5.0.0) or the CI/test/bench PRs. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * chore(release): cover #1419, #1434, #1440, #1442, #1444 in the 5.0.0 notes Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * chore(release): 5.0.1 Cut [Unreleased] into [5.0.1] — 2026-10-13 and stamp 5.0.1 with scripts/version-sync.sh. The 5.0.1 notes cover main through 501c6d9 (#1449), i.e. every PR after the v5.0.0 tag (6ad6add): the npm publish fix (5.0.0 never reached npm or crates.io, 5.0.1 is the first v5 there), #1465, #759, #1460, #1462, #1445, #869, #1447, #1450, #1467, and #1449 under Maintenance. CI/test-only PRs (#1448, #1452, #1454, #1457, #1459) have no entries. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * chore(release): 5.0.1 notes for PRs merged since the cut Covers #1469, #1470, #1474, #1475, #1478, #1479, #1480 and #1482; #1484 is CI-only. The notes now cover main through 285a5e8. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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