Skip to content

Fix nightly gem e2e red on bundler 1.17/2.1 CRLF arm - #1995

Closed
Mikola Lysenko (mikolalysenko) wants to merge 1 commit into
mainfrom
ci-janitor/crlf-gem-source-block-era
Closed

Mikola Lysenko (mikolalysenko) wants to merge 1 commit into
mainfrom
ci-janitor/crlf-gem-source-block-era

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Tonight's scheduled CI run on main (41585451732, head 3eb2ec1) fails two e2e-extended gem legs for the first time:

  • e2e-extended (ubuntu-latest, e2e_redirect_gem_build e2e_vendor_gem_build, 3.1, 2.1.4)
  • e2e-extended (ubuntu-latest, e2e_redirect_gem_build e2e_vendor_gem_build, 3.1, 1.17.3)

Both fail only on gem_hosted_redirect_keeps_a_crlf_gemfile_crlf, in the crlf-gemfile-source-block arm, at the rollback assertion with hosted_wiring_contested / patched_ref_unattributable. The message reads "GEM section lists 2 remotes (a merged multi-source lock), and no gem in it is source-pinned to Socket patch …". The same legs passed the night before (41395558980, cbbbdb9), when this arm didn't exist yet. It was added in #1961.

This is a deterministic failure, not a flake. I reproduced it locally with bundler 2.1.4.

Root cause

Before 2.2, bundler writes one merged GEM section for every rubygems source. The hosted redirect nests the Socket source … do block inside the user's own source "upstream" do block. The Gemfile attribution reader in vex/discover/gem.rs ignores nested blocks, so rollback can't tie the gem to the patch. This is the documented era limit: gem_hosted_unwind_keeps_a_source_block_bang (#1056) already skips with "bundler {} merges every rubygems source into one GEM section". The new CRLF arm is missing that guard. PR CI only runs the bundler 4.0.21 leg, so the gap showed up only in the nightly schedule run.

Fix

The source-block arm of the CRLF test now has the same fx.bundler.at_least(2, 2) floor. It uses continue, so the plain crlf-gemfile arm still runs. Assertions are unchanged.

Proof

Run locally with --include-ignored crlf_gemfile_crlf:

bundler before after
2.1.4 FAILED (rollback, hosted_wiring_contested) ok, source-block arm SKIP and plain CRLF arm runs
4.0.18 ok ok, both arms run (no SKIP)

I couldn't run bundler 1.17.3 locally because it doesn't start on Ruby 3.3; CI pins Ruby 3.1 for that leg. It takes the same < 2.2 branch as 2.1.4.

Where coverage still runs

Nothing is dropped:

  • The CRLF source-block arm still runs on bundler 2.2.33, 2.5.23, 2.6.9, 4.0.15 (nightly e2e-extended), 2.7.2 (e2e-full) and 4.0.21 (PR e2e).
  • The plain CRLF arm still runs on every era, 1.17.3 and 2.1.4 included.

Follow-up for the product (not changed here): attributing a gem in nested source blocks on a merged pre-2.2 lock would let rollback work on those bundlers too.


Generated by Claude Code


Note

Low Risk
Test-only guard aligned with an existing e2e skip; no production code or behavior changes.

Overview
Fixes nightly gem e2e failures on bundler 1.17 and 2.1 for gem_hosted_redirect_keeps_a_crlf_gemfile_crlf.

The crlf-gemfile-source-block loop arm now matches gem_hosted_unwind_keeps_a_source_block_bang: when bundler is < 2.2, it prints SKIP and continues instead of running rollback assertions that fail with hosted_wiring_contested / patched_ref_unattributable. Pre-2.2 bundler merges rubygems sources into one GEM section, so nested Socket source blocks cannot be attributed on rollback.

The plain crlf-gemfile arm is unchanged and still runs on every bundler version. The test doc comment notes the ≥ 2.2 requirement for the source-block case.

Reviewed by Cursor Bugbot for commit 819c846. Configure here.


Generated by Claude Code

The nightly e2e-extended gem legs for bundler 1.17.3 and 2.1.4 fail
since #1961 added the crlf-gemfile-source-block arm to
gem_hosted_redirect_keeps_a_crlf_gemfile_crlf. Before 2.2 bundler
writes one merged GEM section for every rubygems source, and the
redirect nests the Socket block inside the user's own source block,
so rollback refuses with hosted_wiring_contested.

That is the documented era limit that
gem_hosted_unwind_keeps_a_source_block_bang already skips for. Apply
the same floor to the source-block arm only; the plain CRLF arm still
runs on every bundler era. PR CI only runs bundler 4.0.21, so the gap
showed up on the nightly schedule run alone.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011f9aeQNTkAfriFzVGPKuZP
@mikolalysenko Mikola Lysenko (mikolalysenko) added the ci-janitor Opened by the CI janitor routine (flakes, redundant tests, CI perf) label Nov 3, 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 819c846. Configure here.

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

Copy link
Copy Markdown
Collaborator Author

Ready for review (burn-down agent).

  • Head: 819c846
  • CI: 50/50 check runs on this head are green (31 success, 19 skipped). No main-wide failures.
  • Bugbot: reviewed 819c846, no issues found.
  • Reviewer focus: test-only change in crates/socket-patch-cli/tests/e2e_redirect_gem_build.rs. The CRLF source-block arm now skips on bundler < 2.2, the same floor as the sibling gem_hosted_unwind_keeps_a_source_block_bang test. Pre-2.2 lockfiles merge rubygems sources into one GEM section, so rollback can't attribute the gem. The plain CRLF arm still runs on every bundler version.

Generated by Claude Code

@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

Final review brief

What it does: Test-only fix for the nightly e2e-extended gem legs (bundler 1.17.3 / 2.1.4) that went red after #1961. The new crlf-gemfile-source-block arm of gem_hosted_redirect_keeps_a_crlf_gemfile_crlf now skips on bundler < 2.2, the same era floor gem_hosted_unwind_keeps_a_source_block_bang already has. Pre-2.2 bundler writes one merged GEM section, so rollback can't attribute the nested-block gem to the patch. The plain CRLF arm still runs on every bundler.

Risk: low. One test file, 14 lines, no product code. The skip is narrow (that driver only, bundler < 2.2, continue rather than return), and the arm still runs on 2.2.33 / 2.5 / 2.6 / 2.7 / 4.0.x.

Look here

  • e2e_redirect_gem_build.rs:4796-4807:`` the new guard
  • e2e_redirect_gem_build.rs:4787-4790:``` the two arms; continue keeps the plain arm running
  • e2e_redirect_gem_build.rs:3247-3254:```` the sibling skip it mirrors (same message)

Verified: I read the full diff and checked that the guard matches the sibling test's era floor and wording, and that continue only skips the source-block arm. CHANGELOG.md is untouched. CI is 50/50 green on 819c846 (ci-ok and clippy both pass). Bugbot found no issues. There are no review threads.

Changes I made: none.

Open questions: none for this PR. The description suggests a later product follow-up: attribute gems in nested source blocks on merged pre-2.2 locks.

Auto-merge is armed, so approving sends this straight to the merge queue.


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) 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.

2 participants