Repository navigation
CI: hermetic spawns in NuGet/PyPI suites (#823) - #1498
Merged
Mikola Lysenko (mikolalysenko) merged 3 commits intoOct 13, 2026
Merged
Conversation
Assisted-by: Claude Code:claude-opus-5-5
5 tasks
The NuGet and PyPI e2e suites started socket-patch with a bare Command::new and their own partial SOCKET_* scrubs, so a developer's ambient SOCKET_* settings, real `socket login` config or activated venv could change what the tests exercised. They now spawn through the shared hermetic builder, scrub VIRTUAL_ENV, and leave the spawn-hygiene ratchet's pending list (26 -> 22). Refs #823 Assisted-by: Claude Code:claude-opus-5-5
Mikola Lysenko (mikolalysenko)
force-pushed
the
agent/fix-ci-hermetic-nuget-pypi
branch
from
October 13, 2026 18:54
e96beaf to
878effa
Compare
The seed-leak test kept its own copy of the hostile seed list, so the new SOCKET_SAVE_ONLY seed went unchecked; it now iterates the shared list. The PyPI lifecycle runner also points HOME at the stand-in like the shared runner, so the developer's user site stays out of scans. Refs #823 Assisted-by: Claude Code:claude-opus-5-5
Mikola Lysenko (mikolalysenko)
marked this pull request as ready for review
October 13, 2026 19:05
Collaborator
Author
|
BugBot review 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 a62c897. Configure here.
Tanmay Singla (Tanmay182003)
approved these changes
Oct 13, 2026
Collaborator
Author
|
Ready for review (burn-down agent)
Generated by Claude Code |
This was referenced Oct 13, 2026
Mikola Lysenko (mikolalysenko)
deleted the
agent/fix-ci-hermetic-nuget-pypi
branch
October 13, 2026 22:59
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 12; the issue stays open for the remaining
PENDING_RAW_SPAWNSfiles)What
The four NuGet / PyPI suites still on
PENDING_RAW_SPAWNSstartedsocket-patchwith a bareCommand::newand their own partialSOCKET_*handling, which had drifted fromtests/common/hermetic.rs:e2e_nuget.rs: removed six named vars. Any other ambientSOCKET_*reached the child. WithSOCKET_ECOSYSTEMS=npmin the shell,scan_discovers_legacy_packagesandscan_discovers_global_cache_packagesfail onmain(No npm packages found.). Nothing forced the config layer or update notifier off either. Its scans are unscoped, so an activated venv or the developer'sHOME(~/.m2, user site) could also change the counts these tests assert.e2e_nuget_dotnet_build.rs: had a private sweep plus hand-set opt-outs, with no update-check opt-out.e2e_pypi.rs: removed the flag-bound vars by name, but every otherSOCKET_*, the opt-outs andVIRTUAL_ENVwere unhandled.e2e_pypi_multi_copy.rs: had a private sweep plus hand-set opt-outs, with no telemetry opt-out. It keeps its own PythonDISCOVERY_VARSscrub.All four now spawn through
hermetic::command, and the three that run unscoped scans addExtra::Venv.e2e_nugetande2e_pypialso calljvm_env::isolate_cli, the stand-inHOMEthatcommon::run_bin_with_envalready uses. The files leavePENDING_RAW_SPAWNS(26 -> 22), so thespawn_env_hygieneratchet keeps them hermetic.SOCKET_SAVE_ONLYjoinsHOSTILE_SEEDS, carrying over the seede2e_pypiused to set itself.command_never_leaks_its_hostile_seedsnow iteratesHOSTILE_SEEDSinstead of a hand copy, so a new seed can't go unchecked (found by/code-review high).Test-only change; no product code touched. No file overlap with #1495, which removes other lines from the same
PENDING_RAW_SPAWNSlist. Whichever PR lands second needs a trivial rebase of that list.CI cost
No workflow change. A lean PR run keeps the same job count and job-minutes before and after, because these suites already run in the same jobs.
Test evidence
cargo fmt --all -- --check: clean.cargo clippy -p socket-patch-cli --all-features --tests: identical warning set toorigin/main(pre-existingduplicate_mod/needless_borrow/type_complexityin test code).main: withSOCKET_ECOSYSTEMS=npm SOCKET_DRY_RUN=true SOCKET_CLI_API_TOKEN=x SOCKET_NO_CONFIG=0 VIRTUAL_ENV=<venv with six>exported,cargo test -p socket-patch-cli --all-features --test e2e_nuget -- --include-ignoredgives 20 passed, 2 failed (scan did not print a Found N packages line; output was: No npm packages found.).SOCKET_SAVE_ONLY=true,-- --include-ignored: e2e_nuget 22/22, e2e_pypi_multi_copy 3/3, e2e_nuget_dotnet_build 22/22 (no local .NET SDK, so the SDK legs skip; lean CI's.NET 10leg runs them), spawn_env_hygiene 15/15, e2e_pypi 20 passed. The 5 live-APIe2e_pypitests fail here only because the sandbox proxy blockspatches-api.socket.dev. The error shows the child correctly chose the public proxy despite the ambientSOCKET_CLI_API_TOKEN. CI doesn't run those tests either (ci.yml: live-API smoke suites are on demand only)./code-review high
Fixed: the seed-leak test not checking the new seed,
e2e_pypinot pinningHOME, and the mixedcommon::hermetic_command/hermetic::naming.Not fixed:
e2e_pypi_multi_copy'sDISCOVERY_VARS(CONDA_PREFIX,WORKON_HOME,PIPENV_*,PYTHON*) intoExtra::Venv. That widens a scrub used by about 20 other suites, some of which set those vars themselves, so it belongs in its own change.runhelpers throughcommon::run_with_env. The shared runner takes noExtrascrubs, and adding a parameter touches every caller.🤖 Generated with Claude Code
https://claude.ai/code/session_01DhzwitYXkXnY84GVNR1PgP
Generated by Claude Code