Skip to content

CI: update bun.lockb offline takeover test (#1770) - #1771

Merged
Mikola Lysenko (mikolalysenko) merged 3 commits into
mainfrom
agent/fix-ci-bun-lockb-offline-takeover
Oct 28, 2026
Merged

Mikola Lysenko (mikolalysenko) merged 3 commits into
mainfrom
agent/fix-ci-bun-lockb-offline-takeover

Conversation

@mikolalysenko

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

Copy link
Copy Markdown
Collaborator

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

Fixes #1770

Summary

The nightly e2e-extended legs e2e_bun_lockb (bun 1.0.36 and 1.1.45) have been red on main since #1648 (run 40639505834). That PR changed hosted → vendored from a "takeover" into an "eject":

  • vendor --offline now refuses up front with offline_eject_unavailable when a hosted pin is in scope.
  • The online eject reads each pin's patch record from the API and reports no vendor_takeover_reverted_redirect event.

#1648 updated the in-process eject tests (vendor_eject_bun_lockb.rs). It missed the real-Bun suite e2e_bun_lockb.rs, whose binary-lock legs run only nightly, so PR and merge-queue CI never saw the failure.

Changes (test-only, crates/socket-patch-cli/tests/e2e_bun_lockb.rs)

  • native_binary_hosted_vendored_takeover_roundtrip: the offline step now asserts exit 1, offline_eject_unavailable with the re-run-online remedy, no files written and no request made, for both the dry run and the real run.
  • Both online ejects (that test and binary_shared_bundled_record_hosted_pin_is_managed) now pass --api-url/--api-token/--org for the mock. Without them the eject fetched the record from the live public patch API (patches-api.socket.dev). The 1.4.2 leg was green only because that live service happened to serve the fixture's uuid.
  • Each online eject now asserts that it read the pin's record view from the mock and reported no takeover-revert event. This replaces the old assertion that such an event was present.

Evidence

On origin/main with bun 1.0.36, native_binary_hosted_vendored_takeover_roundtrip fails with expected redirect_revert_failed, the same panic as the nightly.

With this branch, cargo test -p socket-patch-cli --all-features --test e2e_bun_lockb -- --include-ignored passes that test on bun 1.0.36, 1.1.45 and 1.4.2. These pass too:

  • cargo fmt --all -- --check
  • cargo clippy --locked --workspace --all-features -- -D warnings

Two tests still fail locally only because of this sandbox's network. Both pass in CI on main today.

  • native_binary_alias_and_transitive: GitHub tarball 403 through the proxy.
  • The final rollback in binary_shared_bundled_record_hosted_pin_is_managed: it fetches the before-blob from the live patch API.

CI cost

No workflow change. A lean PR run keeps the same job count and minutes (about 28 Linux jobs, about 8 min). These legs stay nightly-only.

/code-review high

Fixed: weak negative-only assertions, the missing no-request check on the offline refusal, and stale "takeover" comments.

Not fixed:

  • Deduplicating the two eject invocations into a helper. It's style only and would widen the diff.
  • Removing fixture.stage() in the shared test. The later rollback(.., copy_already_original = true) relies on that manifest.
  • The empty "Start fix" commit. It's the claim marker, and the PR is squash-merged.

Follow-up (not in this PR)

rollback_refuses_binary_hosted_pin_then_checkout still downloads the before-blob from the live public patch API. Pointing it at the mock isn't enough, because the mock has no blob route. Making it hermetic is a separate test-harness change.

https://claude.ai/code/session_011f9aeP7z55jFbL75HPMkHJ


Note

Low Risk
Test-only changes to e2e assertions and mock wiring; no production CLI or runtime behavior is modified.

Overview
Updates nightly real-Bun tests in e2e_bun_lockb.rs so hosted → vendored flows match the eject behavior from #1648 (in-process tests were already updated; these legs only run in extended CI).

Offline vendor over a binary hosted pin now expects exit 1, top-level offline_eject_unavailable with a re-run-online message, unchanged project snapshot, and no mock HTTP traffic (dry and wet), instead of redirect_revert_failed in events.

Online eject invocations in native_binary_hosted_vendored_takeover_roundtrip and binary_shared_bundled_record_hosted_pin_is_managed pass --api-url / --api-token / --org so patch records come from the wiremock, not the public API. Assertions now require a /patches/view/ hit via new helper record_views, and explicitly expect no vendor_takeover_reverted_redirect event. Comments are retitled from takeover to eject.

Reviewed by Cursor Bugbot for commit d80f222. Configure here.


Generated by Claude Code

Assisted-by: Claude Code:claude-opus-5-5
The nightly bun 1.0 and 1.1 e2e legs have failed since vendor started
ejecting hosted pins straight from the lockfile (#1648). An offline
vendor now refuses up front with offline_eject_unavailable, and the
online eject reports no separate takeover-revert event, but the
takeover roundtrip test still expected the old behaviour.

Assert the new offline refusal and the eject's events. Also point both
binary-lock eject runs at the mock patch API (--api-url, --api-token,
--org). Without those flags the eject fetched its patch record from the
live public API, so the test depended on that service and on the
fixture uuid existing there.

Assisted-by: Claude Code:claude-opus-5-5
Check that the online eject fetched its patch record view from the
mock server, and that the offline refusal made no request at all, so
the test fails if the eject quietly takes another path. Update the
comments to describe an eject rather than the old takeover.

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

Copy link
Copy Markdown
Collaborator Author

BugBot review


Generated by Claude Code

@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

[agent] Heads-up for the reviewer: #1772 (ci-janitor) fixes the same #1770 failure in the same file with an equivalent change. This PR also asserts the offline refusal makes no request and that the online ejects read the record from the mock (record_views). Both are green with clean Bugbot reviews. Merge one and close the other. Its nightly sibling, mode_migration_vlt, is fixed separately in #1775.


Generated by Claude Code

@mikolalysenko Mikola Lysenko (mikolalysenko) added the Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review label Oct 28, 2026
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

Ready for review at d80f222e (burn-down agent).


Generated by Claude Code

@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

Ready for review at d80f222e (burn-down agent).


Generated by Claude Code

@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

Final review brief

What it does. Test-only fix for the nightly e2e_bun_lockb legs (bun 1.0.36 / 1.1.45), red since #1648 turned hosted → vendored into an eject. The offline step now expects the up-front offline_eject_unavailable refusal (no writes, no requests), and both online ejects now point --api-url/--api-token/--org at the mock instead of silently hitting the live patch API.

Risk: low. One test file changed; no product code. The legs it fixes only run nightly, so PR CI can't prove them — I ran them locally (below).

Look here

Verified

  • Read the full diff; the asserted code offline_eject_unavailable and "re-run without --offline" text match commands/vendor.rs:980, and the shared mock_api mounts the patches/view/<uuid> route both tests rely on.
  • Ran both changed tests with bun 1.4.4 (--include-ignored): native_binary_hosted_vendored_takeover_roundtrip passes; binary_shared_bundled_record_hosted_pin_is_managed passes every new assertion and fails only at its final rollback, which downloads a blob from the live patch API this sandbox can't reach — exactly the case the description lists (pre-existing, follow-up noted).
  • CI 32 passed / 50 skipped of 82 on the head; ci-ok green. Cursor Bugbot: passed, no findings. CHANGELOG.md untouched.

Changes I made: none.

Open questions: none.

Auto-merge (squash) is armed, so approving sends it straight to the merge queue.


Generated by Claude Code

Merged via the queue into main with commit 6e37e68 Oct 28, 2026
82 checks passed
@mikolalysenko
Mikola Lysenko (mikolalysenko) deleted the agent/fix-ci-bun-lockb-offline-takeover branch October 28, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nightly e2e_bun_lockb red: offline takeover test predates #1648

4 participants