GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — test(hosted): isolate package-manager caches in the production e2e suite by jdalton · Pull Request #144 · SocketDev/socket-patch Conversation
|
| Order | What runs | Why it has to be there |
|---|---|---|
| 1 | the existing ambient-env scrubs | they iterate the parent environment, so running them later would strip the sandbox values right back out |
| 2 | cache_env::isolate(&mut cmd) |
this PR |
| 3 | the per-leg env entries the caller passes |
Command's env ops are keyed by name and last-write-wins, so the caller still gets the final say |
Step 3 is what keeps the deliberately-cold legs cold. Several legs pass an empty cache directory on purpose, to prove a fresh checkout installs the patched bytes rather than a warm host copy of the pristine one. Those values are applied last, so they still win.
Expect hosted-e2e to be red on this PR. It was already red before this change existed, and it will stay red until the registry side clears. Please do not read it as a signal about this diff.
The failing leg is gem_bundler_hosted_redirect_and_known_install_defect. Bundler falls back from the compact index to the dependency API against Socket's gem patch-registry, and gets back a body it cannot unmarshal:
ArgumentError: marshal data too short
The test is written to tolerate one specific known server defect — APIResponseMismatchError — and to report anything else as a new regression. This is a different error, so the test flags it. Thirteen of the suite's fourteen legs pass.
Three runs say it is not the code:
| Run | What the file looked like | Result |
|---|---|---|
| Job 91472097503 | with this one-line change | that leg fails; 13 of 14 pass |
| Job 91471604467 | restored byte-identical to main |
fails the same way |
| Job 91508490068 — #143's current head | byte-identical to main, on a branch that no longer touches the file at all |
fails the same way; 13 of 14 pass |
The last green run of hosted-e2e on main was 31 July. So the code is not the variable — something moved on the server between then and now.
Unblocking the check itself is not something this PR can do. It needs either the gem patch-registry fix, or a repo admin setting the documented escape hatch (HOSTED_E2E_DISABLED = true under Settings → Secrets and variables → Actions → Variables, then re-running the failed job, and deleting the variable afterwards to re-arm).
Worth knowing before anyone suggests a path filter or an if:. The job carries explicit invariants in ci.yml, and they are there for good reasons:
| Invariant | Why |
|---|---|
no job-level if: |
a skipped required check is ambiguous to branch protection and wedges the PR at "Expected — waiting for status" |
no needs: |
an upstream failure would skip the job, same wedge |
| no matrix, no rename | branch protection matches the check name hosted-e2e exactly |
no continue-on-error |
a bypass has to be visible, not silent |
So the job always runs and always lands on success or failure. The kill switch gates the steps, never the job.
Ran — cargo check --workspace --all-targets on this branch. Clean. The mod cache_env; declaration resolves because #143 supplies the file.
Ran — cargo fmt --check. No diff in this file. (Two unrelated pre-existing diffs show up in src/commands/lock_cli.rs and src/lib.rs; both reproduce on main.)
Ran — cargo clippy --workspace --all-targets. No new warnings from this file.
Did not run — the suite itself. It contacts production Socket endpoints and real package registries for every ecosystem. Driving that traffic from a laptop to verify a cache path is not a reasonable trade, so CI is the check here.
Trade-off — the sandbox is a stable directory under the OS temp dir, not a fresh one per run, so the fixture packages are not re-downloaded on every run. That is the same trade-off #143 makes and the same directory it uses; the details are in that PR.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
e2e_hosted_production.rs drives a real install for every ecosystem it covers — npm, pnpm, yarn, bun, go, pip, gem, bundler, composer, nuget — through one `tool()` helper. That helper pins a private cache per leg for the toolchains each leg names, but everything it does not name still resolves out of the caller's home directory. Corepack is the big one: the first `pnpm`/`yarn` invocation downloads a whole package manager into ~/.cache/node/corepack. `cache_env::isolate()` is the same one-liner the rest of the CLI integration suites use. It goes in before the per-leg `env` entries so those still win, which is what keeps the deliberately-cold reinstall legs cold. Split out of the sibling change that isolates the other suites, because this file's CI leg (`hosted-e2e`) is currently red for an unrelated server-side reason and should not hold that PR up.
#142 + #143 + #144, plus review fixes) (#146) Squashes jdalton's cache-isolation stack — #142 (setup-matrix per-case HOME), #143 (cache_env::isolate() across the Rust integration suites), #144 (hosted production suite) — and folds in the fixes from a 13-agent adversarial review of the stack: - e2e_hosted_production.rs: widen the gem leg's known-defect matcher to the post-depscan#23630 registry signature (compact index 404s as not_built; the /api/v1/dependencies fallback serves an empty 200 body, which dies as "marshal data too short" under bundler 2.x classic Marshal and as "undefined method 'bytes' for nil" under SafeMarshal rubies). This unblocks the hosted-e2e required check, red on every branch since the 2026-08-02 deploy. Verified live: the leg passes against the current production registry. Also isolate the has_command probe (the corepack-download leak the stack closes everywhere else). - e2e_npm.rs: partial COREPACK_HOME/npm_config_cache pin on the binary runner — the macOS global auto-discovery test spawns the CLI, whose yarn/pnpm prefix probes downloaded ~900 corepack files into the real home (full isolate() would defeat the test; same trade-off as global_packages_e2e.rs). - e2e_vendor_gem_build.rs, e2e_vendor_pypi_build.rs: isolate the bundler/ruby/python/uv availability probes so probe and fixture install answer for the same environment. - run-case.sh: export MAVEN_OPTS=-Duser.home so maven actually follows the case home (the JVM derives user.home from passwd, not $HOME — mvn kept writing the real ~/.m2 while the verify helper scanned the empty fake one); preserve rbenv/pyenv/nvm/volta/asdf/sdkman roots and copy ~/.tool-versions so --host runs still launch their toolchains. - cache_env.rs: document why GEM_HOME/GEM_PATH are deliberately not pinned and the --install-dir/BUNDLE_PATH invariant that keeps that safe. Co-authored-by: jdalton <[email protected]> Co-authored-by: Claude Fable 5 <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.