GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — CI: hermetic spawns in gem/vendor suites (#823) by mikolalysenko · Pull Request #1505 · SocketDev/socket-patch

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Oct 13, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

LLM Description written by Claude Code:claude-opus-5-5

Refs #823 (slice 14; the issue stays open for the remaining PENDING_RAW_SPAWNS files)

What

Three suites still on PENDING_RAW_SPAWNS started socket-patch with a bare Command::new and their own SOCKET_* sweeps, which had drifted from tests/common/hermetic.rs. Those sweeps let an ambient SOCKET_NO_CONFIG through and never forced the update check off. None of the suites guarded Bundler's environment:

  • e2e_gem.rs: its unscoped scans assert the exact purl set the gem crawler sends upstream. The crawler reads BUNDLE_PATH, BUNDLE_APP_CONFIG, the user's ~/.bundle/config and the gem env homes. With an ambient BUNDLE_PATH pointing at a store that holds a gem, or a HOME whose .bundle/config sets one, scan_discovers_vendored_gems and scan_discovers_gems_with_gemspec both fail on main (left: Some(3), right: Some(2)).
  • vendor/vendor_gem_lockfile_only_e2e.rs and vendor/vendor_rerun_no_network_e2e.rs had the same partial sweeps, kept the real HOME, and scrubbed gem state only partly (BUNDLE_PATH / GEM_HOME by name, no GEM_PATH).

All three now spawn through hermetic::command with Extra::Bundle. Their gem-crawling CLI children also drop GEM_HOME / GEM_PATH and get the stand-in HOME from jvm_env::isolate_cli. e2e_gem and vendor_rerun_no_network_e2e add Extra::Venv. The bundle install child in e2e_gem scrubs SOCKET_* and BUNDLE_* before setting its own BUNDLE_PATH. The two cargo-only spawns in vendor_rerun_no_network_e2e already pin CARGO_HOME, so they only move to hermetic::command. The three files leave PENDING_RAW_SPAWNS, so the spawn_env_hygiene ratchet keeps them hermetic.

This PR doesn't touch common/hermetic.rs, so it doesn't overlap with #1498 / #1502 there. All three PRs remove different lines from PENDING_RAW_SPAWNS, so whichever lands later needs a trivial rebase of that list.

Test-only change; no product code touched.

CI cost

No workflow change. A lean PR run has the same job count (~28 Linux jobs) and job-minutes before and after, because these suites already run in the same jobs.

Test evidence

  • cargo fmt --all -- --check: clean. cargo clippy --workspace --all-features -- -D warnings: clean. Clippy on the e2e_gem / vendor / spawn_env_hygiene test targets reports only existing lints in files this PR doesn't touch (prebuilt_common/mod.rs, e2e_golang_redirect.rs, duplicate-module warnings).
  • Red on main (cargo test -p socket-patch-cli --all-features --test e2e_gem):
    • BUNDLE_PATH=<store holding rogue-9.9.9>: 21 passed, 2 failed (scan_discovers_gems_with_gemspec, scan_discovers_vendored_gems).
    • HOME=<home whose .bundle/config sets BUNDLE_PATH to that store>: the same 2 failed.
  • Green on this branch, under each of: no override; BUNDLE_PATH=<store>; BUNDLE_APP_CONFIG=<config dir>; HOME=<that home>; GEM_HOME/GEM_PATH=<store>; and SOCKET_ECOSYSTEMS=npm SOCKET_NO_CONFIG=0 SOCKET_DRY_RUN=true SOCKET_CLI_API_TOKEN=x VIRTUAL_ENV=<dir>:
    • --test e2e_gem: 23 passed (3 live-API tests ignored, as in CI)
    • --test vendor -- vendor_gem_lockfile_only_e2e vendor_rerun_no_network_e2e: 20/20
    • --test spawn_env_hygiene: 15/15
  • The 3 ignored e2e_gem tests need the live Socket API and Bundler. CI runs them on demand only (ci.yml:1169-1178), and they weren't run here. Their only change is the hermetic env on the CLI child, plus the SOCKET_* / BUNDLE_* scrub on the bundle install child that runs before it sets BUNDLE_PATH.
  • CI on abd04cc: green (run 38470744989), mergeable state clean. Cursor Bugbot reports no issues.

/code-review high

  • Fixed: the vendor suites kept the real HOME, so ~/.bundle/config and ~/.gem could still reach the crawl. GEM_PATH was never removed. The e2e_gem doc comment claimed more isolation than the code gave.
  • Not fixed:
    • Folding e2e_gem's private run / assert_run_ok into common::run_bin_with_env with an extras parameter. That touches every caller of the shared runner, so it belongs in its own change. Earlier slices made the same call.
    • Moving the gem-home and HOME handling into Extra::Bundle. Extra::Bundle also scrubs real bundle children, and those need an ambient GEM_HOME on version-managed Rubies (rvm, chruby). Doing that would also put a third PR on hermetic.rs while CI: hermetic spawns in NuGet/PyPI suites (#823) #1498 and CI: hermetic spawns in Cargo/Composer suites (#823) #1502 edit it. The removal stays on the CLI children.

🤖 Generated with Claude Code

https://claude.ai/code/session_01J5o3ceqEyqmPQbY2WJMEB1


Note

Low Risk
Changes are limited to test harness environment scrubbing; no runtime CLI or production behavior is modified.

Overview
Gem and vendor CLI tests now spawn through the shared hermetic helper instead of bare Command::new plus hand-rolled SOCKET_* loops, so behavior matches tests/common/hermetic.rs (forced opt-outs, no drift on SOCKET_NO_CONFIG / update checks).

In e2e_gem, the CLI run helper uses hermetic::command with Extra::Bundle and Extra::Venv, clears GEM_HOME / GEM_PATH, and stand-in HOME via jvm_env::isolate_cli so unscoped scan assertions on exact PURL sets cannot pick up the developer’s Bundler or gem homes. bundle install scrubs SOCKET_* and BUNDLE_* before pinning BUNDLE_PATH on the fixture.

vendor_gem_lockfile_only_e2e and vendor_rerun_no_network_e2e get the same hermetic spawn for vendor (plus bundle/venv scrub and gem-home isolation where the crawlers read Ruby/Python state). Cargo-only vendor paths in the rerun suite only switch to hermetic::command while still setting CARGO_HOME.

Those three files are removed from PENDING_RAW_SPAWNS in spawn_env_hygiene.rs, tightening the ratchet that forbids new bare binary spawns. Test-only; no product code changes.

Reviewed by Cursor Bugbot for commit abd04cc. Configure here.


Generated by Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@claude
Start hermetic gem/vendor spawns for #823
6039962
Assisted-by: Claude Code:claude-opus-5-5
@mikolalysenko Mikola Lysenko (mikolalysenko) mentioned this pull request Oct 13, 2026
Swarm health manager log #1382
Open
Claude (claude) added 2 commits October 13, 2026 21:16
@claude
Spawn gem and vendor test children hermetically
402664c
e2e_gem, vendor_gem_lockfile_only_e2e and vendor_rerun_no_network_e2e
started socket-patch with a bare Command::new and their own SOCKET_*
sweeps, which let an ambient SOCKET_NO_CONFIG through and never forced
the update check off. None of them scrubbed Bundler's environment: an
ambient BUNDLE_PATH, or a ~/.bundle/config that sets one, adds the
developer's gems to the crawl, so both gem scan tests fail on main
(3 gems found instead of 2).

All three now spawn through hermetic::command with Extra::Bundle;
e2e_gem's unscoped scans also scrub an activated venv and use the
stand-in HOME, and its bundle install child scrubs BUNDLE_* before
setting its own BUNDLE_PATH. The files leave PENDING_RAW_SPAWNS, so
the spawn_env_hygiene ratchet keeps them hermetic.

Refs #823

Assisted-by: Claude Code:claude-opus-5-5
@claude
Isolate HOME and gem homes for gem CLI children
abd04cc
The ruby crawler also reads the user's ~/.bundle/config and the
`gem env` homes (GEM_HOME, GEM_PATH, ~/.gem). The two vendor suites kept
the real HOME, and none of the three removed GEM_PATH, so a developer's
global bundler path or gem home could still change which gem store
these tests crawl. Give the vendor suites' CLI children the stand-in
HOME e2e_gem already uses, and remove both gem-home vars from every
gem-crawling CLI child.

Refs #823

Assisted-by: Claude Code:claude-opus-5-5
@mikolalysenko
Mikola Lysenko (mikolalysenko) marked this pull request as ready for review October 13, 2026 21:27
@mikolalysenko

Mikola Lysenko (mikolalysenko) commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator Author

BugBot review


Generated by Claude Code

cursor[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mikolalysenko Mikola Lysenko (mikolalysenko) mentioned this pull request Oct 13, 2026
Spawn every CLI test child through one hermetic Command builder; 10 test files inherit ambient SOCKET_* today #823
Closed
5 tasks
cursor[bot]
cursor Bot reviewed Oct 13, 2026
View reviewed changes

@cursor cursor Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

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 abd04cc. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Tanmay182003
Tanmay Singla (Tanmay182003) approved these changes Oct 13, 2026
View reviewed changes
@mikolalysenko
Mikola Lysenko (mikolalysenko) added this pull request to the merge queue Oct 13, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 13, 2026
@claude
Merge remote-tracking branch 'origin/main' into agent/fix-ci-hermetic…
543f7fe
…-gem-vendor

# Conflicts:
#	crates/socket-patch-cli/tests/spawn_env_hygiene.rs
Tanmay182003
Tanmay Singla (Tanmay182003) approved these changes Oct 13, 2026
View reviewed changes
@mikolalysenko
Mikola Lysenko (mikolalysenko) added this pull request to the merge queue Oct 13, 2026
Merged via the queue into main with commit 7be10d1 Oct 14, 2026
53 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@mikolalysenko
Mikola Lysenko (mikolalysenko) deleted the agent/fix-ci-hermetic-gem-vendor branch October 14, 2026 00:00
This was referenced Oct 14, 2026
CI: hermetic spawns in npm/Bun suites (#823) #1510
Merged
CI performance dashboard #1182
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cursor cursor[bot] cursor[bot] left review comments
@Tanmay182003 Tanmay Singla (Tanmay182003) Tanmay182003 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@mikolalysenko @Tanmay182003 @claude
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.