Skip to content

fix(ci): a merge train fails when a member's content did not arrive (#20406) - #20530

Merged
mrveiss merged 6 commits into
mainfrom
issue-20406-content-gate
Nov 2, 2026
Merged

mrveiss merged 6 commits into
mainfrom
issue-20406-content-gate

Conversation

@mrveiss

@mrveiss mrveiss commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

Thinking Path

Train PR #20271 merged #20179 with an empty diff. Its commits were reachable and the PR read MERGED, but its files weren't on main. The cause is still unknown, so this gate checks the result and not how a train is built. It measures each member at its own merge commit, because at the tip a deliberate in-train fix reads as a loss.

What Changed

  • pipeline-scripts/train_content_gate.py:
    • --range judges each Merge #N @ sha at its merge. A member fails when a file it added is missing, a file it deleted is still there, or under half of a file's added lines are present. A member merged twice is judged at its last merge against the base of its first, so a drop in the first still counts. A head already on the train's base passes with a note; a head reachable only through the train fails as unmeasured. A re-merge with no new commits makes no merge commit, so the earlier one stands.
    • --body lets a train name a deliberate drop: train-content-drop: #N path reason.
    • --title compares against the member list in the train PR's title, chore(merge-train): #N #N. A declared member with no merge fails, and so does a merge the gate can't account for.
    • --landed checks that a file the train changed, and main did not, reached main byte-identical.
    • A range with no members, or a landing with no files to compare, fails as "nothing was measured". A git error exits 2 as UNMEASURED.
  • .github/workflows/train-content-gate.yml: runs on train-* PRs and when one lands. Other PRs skip the job.
  • Floors: re-pinned.

Commit note: the move to run_git and the rename to ContentReport are in the commit titled as the floor repin, because their own commit failed on an isort reformat.

Verification

$ pytest train_content_gate_test.py -q
============================== 26 passed in 8.17s ==============================

The tests build real git histories, including the -s ours shape of #20179.

Against real trains on main:

Train Members Files Result
e8227ac (the one that lost #20179) 4 79 Red: 27 files, all #20179. The other 3 members are clean
11 other recent trains 4-8 each 25-166 each Green

The train-level table is from the final code, using each train's real title. The file counts are from before the first-merge base, which raises them on some trains. The landing check passed on all 12 before these follow-ups; it wasn't changed since. On #20271, the shape asked about in review: ^2 isn't in ^1, and base b28e9d4 differs from head 9b7eecf, so #20179 is flagged through the normal path. #20406 counted 5 missing files for #20179; the other 22 are partial losses in modified files.

Not checked: a run of the workflow itself, which first happens on the first train after this lands.

Code review found gaps, fixed here: base equal to head, a drop in a first merge, no named exception, and a loose title parse. An earlier code-reviewer pass found: traceback on a non-merge landing, a member never merged, quoted paths, reading the head from the subject.

Risks

Refs rather than Closes: the cause and the wider audit remain on #20406, and #20381 keeps its unread commits.

Model Used

Claude Opus 5.5

Issue Link

Refs #20406, #20381

🤖 Generated with Claude Code

…20406)

A member's commits can be reachable and its PR MERGED while its files are
not on main. The gate reads the content: each member at its own merge
commit before landing, and what the train changed against main after it. A
declared member with no merge, or a merge it cannot account for, fails too.
@mrveiss mrveiss added bug Something isn't working phase:M5.7 M5 phase 7: CI throughput and release flow labels Nov 1, 2026
@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 23 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 09e1c80 and 18c069a.

Files selected for processing: 4
  • .github/workflows/train-content-gate.yml
  • pipeline-scripts/train_content_gate.py
  • pipeline-scripts/train_content_gate_test.py
  • repo_tests/one_paths_filter_job_15360_test.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Notice: 29 open PRs — past the runaway threshold (25)

This is not a request to defer this PR. There is no cap on open PRs (#19397) -- nothing blocks opening or pushing a PR.

This notice only means the count is high enough to be worth a glance for a runaway — something opening PRs in a loop, or a merge pipeline that has stalled so nothing is draining.

Currently open:

If the queue is draining normally, ignore this. Otherwise:

  1. Check whether CI is dispatching at all — see the ci-dispatch-watchdog status on these PRs
  2. Approved PRs land through the merge train the coordinator sequences (merge commits, never squash) -- check the open chore(merge-train) PR is moving, not each PR on its own
  3. Look for a loop opening near-identical PRs

Warn-only runaway detector — .github/workflows/pr-queue-gate.yml. It never blocks a merge.

@mrveiss

mrveiss commented Nov 1, 2026

Copy link
Copy Markdown
Owner Author

Code review on PR #20530 (head 73b675d): approve.

Read only; the gate's logic was reproduced with git commands and the gate itself wasn't run. Measuring each member at its own merge gives no false red on the current trains with deliberate in-train fixes, #20442 and #20455. The workflow is safe: title via env, read-only, full history, and a git error is unmeasured rather than green. Follow-ups, none blocking:

  • The chore(merge-train): #20107 #20128 #20171 #20179 #20271 shape, where a member's commits are already reachable from the first parent, makes base equal head and measures nothing. Add a test with that real topology, since it's the case the gate exists for.
  • Only a member's last merge is judged, so a loss in an earlier merge followed by a fix touching other files goes unflagged.
  • There's no named exception: a deliberate drop inside a merge commit stalls the train until the gate is edited. A body marker would do.
  • Any #N in the title counts as a member, so (#20442) in a title goes red. Anchor it to the member list.

…rge (#20406)

A drop in a member's first merge moved the base and went unseen. A head
already in the train measured nothing and passed; it now fails, unless it
is already on the base. A deliberate drop can be named in the PR body, and
only the title's member list counts as declared.
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

✅ SSOT Configuration Compliance: Passing

🎉 No new hardcoded values of either class — ssot and other both block.

Known backlog in pipeline-scripts/hardcoded_values_baseline.txt is suppressed and tracked in #14371.

@mrveiss

mrveiss commented Nov 1, 2026

Copy link
Copy Markdown
Owner Author

Code review on PR #20530 (head 986ee8f): approve.

Read only; the gate wasn't run. This head is 1977b46a77 plus a sync of main. The follow-ups are in, each with a named test. The drop marker is read only from the train PR's own body, through env; real titles parse; first-merge bases gave no false red on #20442's or #20500's history. Low: a train title not starting chore(merge-train): declares nothing, so a member with no merge at all goes undetected.

@mrveiss
mrveiss merged commit 63c128c into main Nov 2, 2026
5 checks passed
@mrveiss
mrveiss deleted the issue-20406-content-gate branch November 2, 2026 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working phase:M5.7 M5 phase 7: CI throughput and release flow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant