Repository navigation
Fix bun.lockb nightly e2e reaching the live blob API - #1905
Mikola Lysenko (mikolalysenko) wants to merge 1 commit into
Conversation
The nightly e2e-extended leg (bun 1.4.2) failed on 2026-10-31 in binary_shared_bundled_record_hosted_pin_is_managed: rollback aborted with missing_blob instead of the expected partialFailure. In the `bundled` shape a never-patched minimist copy sits inside bparent/node_modules. Its bytes match neither patch hash, so the rollback missing-blob gate downloads the before-blob. That download goes through the patch API, which --patch-server-url does not redirect, so the test hit the live public proxy and passed or failed depending on whether it served minimist's original index.js blob. Point the helper's rollback at the mock API (--api-url/--api-token/ --org, like the vendor runs) and have the mock serve the original blob. The test no longer touches the network here and fails 0/10 locally, where it failed 12/12 before. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011f9aeTDP8aDQggoVbvbiTk
|
bugbot run 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 6286b0c. Configure here.
|
CI status for head 6286b0c:
Generated by Claude Code |
|
[burn-down agent] Labeled Ready for review at
Generated by Claude Code |
Final review briefWhat it does: Test-only fix for the nightly Risk: low. One test file. The other tests in this file already pass the same flags. Look here:
Verified: Read the full diff. The blob route matches the client's Changes I made: none. Open questions: the dispatch run left a failed Auto-merge is armed, so approving sends it straight to the merge queue. Generated by Claude Code |
Problem
The nightly
e2e-extended (ubuntu-latest, e2e_bun_lockb, 1.4.2, …)leg failed on main on 2026-10-31 (run 41173651959, job 124456920432) inbinary_shared_bundled_record_hosted_pin_is_managed. It passed the night before at almost the same code (run 41009903891). The only commit between the two runs was #1796, which touches Python only. Rollback aborted withrollback_failed/missing_blob("Before blob could not be downloaded … Blob not found on server") where the test expectspartialFailure.Locally (bun 1.4.4, no route to the public patch proxy) the test failed 12/12.
Root cause
In the
bundledshape, Bun installs a second minimist@1.2.2 copy insidebparent/node_modulesthat the patch never touches. Itsindex.jsmatches neither patch hash. Rollback's missing-blob gate probes every physical copy, so it queues a download of the before-blob for that copy. That download goes through the patch API client, and--patch-server-urldoes not redirect it. The test was therefore fetching from the livepatches-api.socket.dev, and the result depended on what that server returned that night.Fix
This is a test-only change in
crates/socket-patch-cli/tests/e2e_bun_lockb.rs:rollback_refuses_binary_hosted_pin_then_checkoutnow passes--api-url <mock> --api-token fake --org <ORG>, as the vendor runs in the same file already do.mock_api_patchserves the originalindex.jsat/v0/orgs/{ORG}/patches/blob/{beforeHash}.With the blob available, the bundled copy reports
hash_mismatchand the top-level copy reportsalready_original. That matches what the test's own comments describe. The assertions are unchanged.Proof
binary_shared_bundled_record_hosted_pin_is_managedandnative_binary_hosted_vendored_takeover_roundtrippassed 10/10 together. The fulle2e_bun_lockb --include-ignoredsuite has 22 passing. The two failures,native_binary_alias_and_transitive(bun install of the fixture fails) andworkspace_text_migration_heals_on_rerun, fail identically on unmodified main in this sandbox (local bun 1.4.4, no registry access). They are environmental here and both pass in CI.native_binary_alias_and_transitive(itscopy_already_original=falsepath), only runs in the 1.0.36 and 1.1.45 e2e-extended legs. I am dispatching CI on this branch so those legs run.cargo clippy -p socket-patch-cli --test e2e_bun_lockb -- -D warnings: clean.cargo fmtwas run on the touched file only.Nothing was removed or moved.
Not in this PR
The other two nightly reds on main (Windows
crawler_maven_e2e, macOSe2e_golang_workspace_build) are already fixed by #1852 and #1894, which are waiting for review.A product question I noticed and did not change here: the rollback blob gate's comment says a locally-drifted copy never needs its blob, but
verify_file_rollbackchecks for the blob before it compares the afterHash. As a result, offline rollback aborts on a drifted or bundled copy. Several unit and integration tests deliberately encode the current behaviour, so changing it needs an owner's decision.Generated by Claude Code
Note
Low Risk
Test-only harness changes in
e2e_bun_lockb.rs; no product code paths modified.Overview
Fixes flaky/failing
e2e_bun_lockbrollback legs where rollback’s before-blob fetch used the patch API (not--patch-server-url), so tests sometimes hit the live blob service and gotmissing_blobinstead of the expectedpartialFailure.rollback_refuses_binary_hosted_pin_then_checkoutnow passes--api-url,--api-token, and--orgto the mock, matching other runs in the same file.mock_api_patchadds a GET handler for/v0/orgs/{ORG}/patches/blob/{beforeHash}that returns the fixture’s originalindex.js, so the bundled-layout nested minimist copy can satisfy rollback’s missing-blob gate without leaving the mock server.Production CLI behavior is unchanged; assertions are unchanged.
Reviewed by Cursor Bugbot for commit 6286b0c. Configure here.
Generated by Claude Code