Skip to content

Fix nightly bun.lockb e2e for the hosted-pin eject - #1772

Closed
Mikola Lysenko (mikolalysenko) wants to merge 1 commit into
mainfrom
ci-janitor/bun-lockb-offline-eject
Closed

Mikola Lysenko (mikolalysenko) wants to merge 1 commit into
mainfrom
ci-janitor/bun-lockb-offline-eject

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

The nightly CI run on main (run 40639505834, 2026-10-28 05:42 UTC, head b787454) is red on three e2e_bun_lockb legs, a new failure that started with #1648:

leg failing test error
e2e_bun_lockb, 1.0.36 native_binary_hosted_vendored_takeover_roundtrip expected redirect_revert_failed, got offline_eject_unavailable (e2e_bun_lockb.rs:928)
e2e_bun_lockb, 1.1.45 same same
e2e_bun_lockb, 1.4.2 binary_shared_bundled_record_hosted_pin_is_managed patch_fetch_failed / eject_refused: the eject asked the real API for the mock's patch

Nightly on main has also been red every day since 10-22, but each earlier day had a different cause (Windows path forms, gem, pdm vex). This PR fixes only today's new e2e_bun_lockb regression.

Root cause

#1648 changed plain vendor with a hosted pin in scope from a per-purl takeover into an eject: it fetches the hosted patch record from the API (patches/view), and an --offline run is refused up front with offline_eject_unavailable. #1648 updated the PR-tier tests for the same paths (vendor_eject_bun_lockb.rs, mode_migration_bun.rs, …). It missed e2e_bun_lockb.rs, whose tests are #[ignore] (they need a real Bun) and run only in the nightly e2e-extended legs. So the PR and merge-queue CI passed, and main's nightly broke.

Fix

Test-only. In crates/socket-patch-cli/tests/e2e_bun_lockb.rs, the tests now assert #1648's contract the same way vendor_eject_bun_lockb.rs already does:

  • The offline vendor over a binary hosted pin (dry and wet) must fail with error.code == offline_eject_unavailable and the "re-run without --offline" remedy, and still write nothing.
  • The online vendor (both tests) gets --api-url/--org/--api-token pointing at the wiremock, which already serves /v0/orgs/{ORG}/patches/view/{uuid}. The vendor still keeps --patch-server-url, so the hosted URL in the lock is recognized.
  • The takeover-advisory assertion becomes the eject contract: no vendor_takeover_reverted_redirect and no redirect_revert_failed (the same check as takeover_vendors_over_a_hosted_bun_lockb_and_reverts_exactly).

No assertion was dropped without replacement. Everything after the eject (ledger original, exact revert, offline re-vendor, outage rerun, VEX matrices, rollback refusal) is unchanged.

Proof (local, with the exact nightly Bun releases)

SOCKET_PATCH_BUN_LOCKB_{READER,VERSION,REQUIRED,EXTENDED,PRODUCTION} set as the nightly legs set them:

  • 1.0.36, --include-ignored: 23 passed. 1 failed: native_binary_alias_and_transitive, because this sandbox gets a 403 from api.github.com for a git dependency. It passes in CI.
  • 1.1.45, --include-ignored: 22 passed. native_binary_hosted_vendored_takeover_roundtrip now passes; before this PR it failed exactly as in CI.
  • 1.4.2, the nightly filter: 5 passed. binary_shared_bundled_record_hosted_pin_is_managed now gets past the eject. It then fails later, in its rollback leg, because this sandbox can't reach patches-api.socket.dev/patch/blob/…. The same test fails the same way locally at fix: vendor hosted patches directly from lockfiles #1648's parent (8244b94), yet that leg was green in CI on 10-27. So it is environmental. This leg is confirmed only by the next nightly (or a workflow_dispatch of CI on this branch, if a reviewer wants it before merging).
  • cargo fmt is clean on the touched file. cargo clippy -p socket-patch-cli --test e2e_bun_lockb -- -D warnings reports nothing in this file; its existing warnings are all in tests/prebuilt_common/mod.rs.

Where the tests run

Unchanged: nightly e2e-extended (e2e_bun_lockb × Bun 1.0.36 / 1.1.45 / 1.4.2 / 1.3.14). Nothing was added, removed or moved.

Not in this PR (same nightly run, for follow-up)

  • mode_migration_vlt vlt_pinned_matrix_migration_{dry_run_parity,hosted_then_vendored} fails on 6 legs (Linux, Windows, macOS). It looks like the same fix: vendor hosted patches directly from lockfiles #1648 eject fallout in another #[ignore] suite.
  • coverage-docker (deno) failed on a network blip: curl https://deno.land/install.sh exited with 56.

Generated by Claude Code


Note

Low Risk
Test-only updates to e2e assertions and CLI flags in ignored nightly tests; no runtime behavior changes.

Overview
Updates nightly-only e2e_bun_lockb.rs expectations to match #1648’s hosted-pin eject behavior (already covered in PR-tier tests like vendor_eject_bun_lockb.rs).

Offline vendor over a binary hosted pin (dry and wet) now asserts a top-level offline_eject_unavailable error and a “re-run without --offline” message, instead of a redirect_revert_failed event—still requiring exit code 1 and no filesystem writes.

Online vendor in native_binary_hosted_vendored_takeover_roundtrip and binary_shared_bundled_record_hosted_pin_is_managed adds --api-url / --org / --api-token aimed at the wiremock so eject can fetch patches/view locally. Comments and assertions drop the retired takeover contract: responses must not mention vendor_takeover_reverted_redirect or redirect_revert_failed.

No production code changes; rest of each test flow is unchanged.

Reviewed by Cursor Bugbot for commit b5fad72. Configure here.


Generated by Claude Code

#1648 made plain `vendor` with a hosted pin in scope eject the
lockfile's hosted patch: it fetches the patch record from the API and
refuses an --offline run up front with `offline_eject_unavailable`.
It updated the PR-tier tests (vendor_eject_bun_lockb.rs) but not
e2e_bun_lockb.rs, whose tests are #[ignore] and run only in the
nightly e2e-extended legs, so the 1.0.36, 1.1.45 and 1.4.2
e2e_bun_lockb legs have failed on main since it landed.

Assert the new contract: the offline vendor is refused with
`offline_eject_unavailable`; the online vendor is pointed at the mock
API (--api-url/--org/--api-token) so the eject can fetch the record,
and it reports no per-purl takeover advisory.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011f9aeSVRFUn2uamhKgw5V5
@mikolalysenko Mikola Lysenko (mikolalysenko) added the ci-janitor Opened by the CI janitor routine (flakes, redundant tests, CI perf) label Oct 28, 2026
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

bugbot run


Generated by Claude Code

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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

@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

Burn-down agent: closing as a duplicate of #1771.

Both PRs fix the same nightly e2e_bun_lockb regression from #1648 (issue #1770), and both change only crates/socket-patch-cli/tests/e2e_bun_lockb.rs in the same way: the offline vendor expects offline_eject_unavailable, and the online ejects point --api-url/--org/--api-token at the mock. #1771 also asserts that the offline refusal makes no request and that each online eject reads the pin's record view from the mock, so it covers everything here. It is green on d80f222 and its author already asked for one of the two to be closed. The branch is kept; reopen this one if #1771 is dropped.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-janitor Opened by the CI janitor routine (flakes, redundant tests, CI perf)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants