Repository navigation
ci(merge_group): validate all constituent PRs in multi-PR batches (#8082) - #14671
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 20 minutes. View limit details
Summary by CodeRabbit
WalkthroughThe routed Rust workflow now validates and admits every constituent PR in a merge group. It checks the queue’s commit chain, live PR heads, changed paths, candidate status, review disposition, unresolved threads, and final eligibility. ChangesMerge-group constituent admission
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant MergeQueue
participant RunnerSelection
participant GitHubAPI
participant CandidateAdmission
participant ReviewRecheck
MergeQueue->>RunnerSelection: Provide merge-group base and head SHAs
RunnerSelection->>GitHubAPI: Look up constituent PR repositories
GitHubAPI-->>RunnerSelection: Return repository identities
CandidateAdmission->>GitHubAPI: Read each PR, changed files, and queue entry
GitHubAPI-->>CandidateAdmission: Return constituent admission data
CandidateAdmission->>ReviewRecheck: Pass admitted constituent list
ReviewRecheck->>GitHubAPI: Read review decisions and threads for each PR
GitHubAPI-->>ReviewRecheck: Return review and thread state
Possibly related issues
Merge Risk:
|
Exact-Head Review Record
|
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
Source, oracle, and contract review complete on exact head 78747b5. See Conversation comment for full inspection record.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
VERDICT: APPROVE 78747b5
Exact-head completion of my source/oracle/contract review at this head (review 5902331414). cargo policy check-workflows exit 0 and cargo test -p repo-policy --lib 78 passed. No blocking findings. The head is stacked on hill/ci-efficiency (#14656), so the hosted Rust gates do not run on this head; that qualification is still outstanding until rebase/native admission.
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
VERDICT: BLOCK 78747b5 — three blocking defects in the new merge-group path: the constituent capture is cleared before it is read, the inline constituent admission zeroes every generated-file discount, and the base freeze packet falls back to the candidate checkout on any read failure. This supersedes my APPROVE on this same head (review 5903276711), which completed after the devin findings below were filed and did not examine them.
Head pinned and unchanged during this read: 78747b5, tree f000d7cd74b59852449f5c3b71995a2eca660d18. Static review only; no checkout, no workflow run.
Blocking
B1 — routed-rust.yml:108-109: BASH_REMATCH is cleared by the two SHA-format tests, so ref_pr is always empty.
Every [[ … =~ … ]] resets BASH_REMATCH. The next two tests (GROUP_BASE_SHA, GROUP_HEAD_SHA) succeed with no capture groups, so BASH_REMATCH[1] is unset when ref_pr="${BASH_REMATCH[1]}" runs. Reproduced under bash with a real queue ref:
GROUP_HEAD_REF=refs/heads/gh-readonly-queue/main/pr-14671-78747b5…
GROUP_BASE_SHA=<40 hex> GROUP_HEAD_SHA=<40 hex>
→ ref_pr=<>
Consequences at this head: the jq filter's $prs[-1] == $ref_pr guard (:118) never matches, constituent_prs is empty, HEAD_REPO becomes unresolved (:131), and :137 skips the runner query with reason=fork_or_untrusted_pr. Every merge_group therefore routes to GitHub-hosted and the PR's advertised gate — "every constituent PR in base..head must belong to the base repository before self-hosted runners can be selected" — never executes. Nothing turns red, so the fallback hides it. The base at 3f3243cc was safe here because its capture test was the last evaluation before the read (routed-rust.yml:104-105); this PR made it unsafe by prepending the format checks.
B2 — routed-rust.yml:394-399,453: constituent admission runs without ADMISSION_REPOSITORY / ADMISSION_PR_NUMBER, so generated-file discounts are always discarded.
The step invokes candidate_admission.py directly with only GH_TOKEN, REPOSITORY, TIP_PR, CONSTITUENTS, DOCS_ONLY. The CLI reads the repository only from ADMISSION_REPOSITORY (candidate_admission.py:1775); with it empty, head_unmoved() returns False because number.isdigit() rejects the empty PR number (:1698), and :1785-1788 then sets generated_files = generated_lines = 0. A constituent that fits the ordinary 160 files / 3000 lines only because its generated files are declared in the live base's .gitattributes is refused in the batch although it qualifies alone. The composite action sets both variables (action.yml:95-99), so the two paths disagree. release_cut_admission.py does not read them.
Fix: export ADMISSION_REPOSITORY="$REPOSITORY" and ADMISSION_PR_NUMBER="$c_pr" for the candidate_admission.py call.
B3 — routed-rust.yml:435-439,449-451: the freeze packet and generated-path evidence fail open to the candidate tree.
action.yml states the contract: "The enforcement packet comes from the exact live base commit, never the candidate checkout"; it copies the local packet only on a verified HTTP 404 and refuses any other read failure. The inline step instead copies ${GITHUB_WORKSPACE}/${packet_path} — the merge-group checkout, which all constituents can edit — on any failure, and silently omits --generated-attributes on any .gitattributes failure. After a transient base read failure a non-tip constituent is evaluated against a candidate-supplied freeze packet and without the base's generated declarations. The predicate "freeze evidence is read from the live base, and an unreadable base refuses" is violated.
Fix: mirror action.yml (404 → local template, otherwise refuse), and refuse non-404 .gitattributes failures.
Non-blocking
xtask/src/tests.rs:9803-9850: three mutation needles are stale at this head —[ "$parents" = "1" ] && [ "$parent" = "$GROUP_BASE_SHA" ]…,[ "$fetched" = "$head" ], and the${GROUP_HEAD_SHA}^{tree}merged-tree pin. The workflow now bindsc_pr/c_head/c_sha(routed-rust.yml:355-376), soassert_ne!fires and the retained xtask test fails whenever it runs.tools/repo-policy/src/workflow_tests.rswas updated in this PR; the duplicate was not.routed-rust.yml:453-464,465-473: underset -euo pipefail, a nonzero exit from either admission script aborts the step before the::error::constituent PR … refusedannotation, and theEXITtrap deletes$result. Capture the exit code first, asaction.ymldoes withrc_candidate.- The PR body's
Source review: REVIEW_READY 78747b5c…line is self-attested; the 7 devin threads at this head include B1-B3 and remain unresolved.
Limits
No build, no workflow execution, no checkout. B1 was reproduced by running the exact conditional under bash; B2/B3 were read from the scripts at this head. I did not run the repo-policy or xtask suites. The three non-blocking items are reported from source only.
|
Disposition: repair dispatched at The earlier APPROVE on this head is superseded by review 5906627517, which completed after devin filed seven findings and did not examine them. Three blockers, all in
Seven devin threads are open at this head; the repair sweeps them. No |
|
Published bounded repair
Proof:
Resolved
|
|
Disposition: conflict resolution dispatched at The repair is published — queue-ref capture, per-constituent admission context, 404-only base evidence, retained refusal diagnostics, updated stale needles, and the CI changelog — but the head is CONFLICTING/DIRTY against main, so a review would be stale on resolution. Repair: merge current main into the branch and resolve the conflict in One thread is still open and real: No |
# Conflicts: # .github/workflows/routed-rust.yml
|
Published conflict repair and final Devin disposition at
Proof:
All seven Devin threads now have a repair disposition. A fresh exact-head review and hosted qualification remain required. |
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY — head 5c4ce6e
Stage: source review, head 5c4ce6ed (7 files, 5 commits). Green.
This is per-constituent admission for a batched merge group (#8082). I read the whole workflow delta and added four checks the PR's own proof does not carry at this head.
1. The bash parses. I extracted all 19 run: blocks from routed-rust.yml at this head and ran bash -n on each: 0 syntax errors. The new classify_constituent_docs, the constituent loop, the additional-constituents step and the check_pr_eligibility refactor are all inside that set.
2. The workflow is valid YAML. Parsed with a YAML 1.2 parser: 12 jobs, and the admission job has 12 steps including Admit additional merge-group constituents. The new step's indentation matches its siblings.
3. The policy contract holds at this head. routed_rust_ready_event_contract_violations is a list of workflow.contains(snippet) pairs. I extracted all 26 pairs from tools/repo-policy/src/lib.rs at this head and checked each against the workflow: 26/26 present. I also checked the function's other three predicates: merge_group.types is exactly [checks_requested], pull_request.types parses, and the queue-entry snippet GROUP_HEAD_REF: ${{ github.event.merge_group.head_ref }} is present.
4. The CLI flags exist. The additional-constituents step calls candidate_admission.py with --generated-attributes, --open-prs, --comments, --base-sha, --pr-files and --docs-only, and release_cut_admission.py with --packet, --base-commit, --cut-commit and --proposed-packet. Every one is declared in the script at this head, so the step cannot die on an unknown argument.
On the binding. The chain check requires each queued commit to be single-parent on the previous one, to end its subject with (#N), to be unique, and to have a tree equal to git merge-tree --write-tree <previous> <live head>. The tip must be the ref's PR and the chain must end at GROUP_HEAD_SHA. A fetch error, a merge conflict, a moved PR ref or a missing queue entry exits 1. The docs-only scope for the run still comes from the group-wide detect-docs-only, so a batch with one code constituent cannot be routed as docs-only; the per-constituent flag only feeds that constituent's own admission.
Non-blocking observations.
- The PR body names
78747b5cas the candidate branch and as the rollback commit, and its proof was run at that head. The body's own convention makes the GitHub head authoritative, so this is not a false claim, but the rollback boundary should name5c4ce6ed. check_pr_threadscallswarn, which exits 0, on the first constituent read error, so a batch stops pre-checking the remaining constituents. The final eligibility recheck still covers every constituent, so this is advisory-only.- The contract test pins exact substrings, so it cannot detect a logic inversion inside a pinned line. The behavioural evidence is the workflow itself.
Not checked: no hosted merge_group run exists at this head (the workflow runs only on merge_group or the merge-ready label, and neither fired), so the runtime behaviour of the new steps is not established; no cargo test -p repo-policy --lib run on this host.
Wrote: this body file, the extracted workflow and scripts, and a yaml npm package under %TEMP%\opencode; git fetch updated remote-tracking refs only. No checkout, branch, worktree, label or thread touched.
|
Head moved from The coder's claim: merged Proof offered: repo-policy 78/78; focused xtask 1/1; exact classifier docs/code/rename/release controls pass; changelog gate pass; diff-check and merge-tree clean. Review dispatched at the exact head, scoped to whether the conflict resolution kept both sides, whether the mixed docs-only fix is correct, and whether the three original blockers (BASH_REMATCH capture, ADMISSION_REPOSITORY/PR_NUMBER, 404-only base evidence) are still fixed after the merge. No queue action until the review and a routed run exist at |
The eligibility recheck now validates the admitted constituents and checks each one, so the routed-dispatch fixtures must supply a valid single-entry CONSTITUENTS array instead of the placeholder value. The history-sync scope self-test must assert the new per-constituent docs-only fallback.
The entry step now reads each constituent's changed paths and the PR read helper takes explicit arguments. Extend the queue-resolution gh stub with the paginated files call and a MOCK_FILES fixture, and pass the target PR/head into the retry helper. Update the batch refusal needles to the new entry-step messages.
The entry step now refuses a two-parent queued commit with 'is not a single-parent commit directly on <parent>'. Update the history-sync two-parent test to that message; it still names the expected parent.
…uire complete file lists The additional-constituent step accepted the Python decisions without re-reading the live base, so a freeze that activated during evaluation could be missed. Apply the wrapper's movement check: accept only when both the evaluated and the moved base carry an inactive packet. Also refuse docs-only classification when the returned file list is shorter than the PR's changed_files, so an incomplete list cannot skip the size refusals.
…ument list The three workflow-contract snippets pinned the full classify_constituent_docs call, so adding the changed_files argument broke check-workflows. Pin the signature-independent prefix instead; the label text is unchanged.
…s count The truncation guard compares the paginated file count with the REST payload's changed_files. The mock omitted that field, so jq printed null and the guard refused before the binding checks. The mock file list has one entry, so set changed_files to 1.
EffortlessSteven
left a comment
There was a problem hiding this comment.
VERDICT: APPROVE 48913a6 — no blocking findings on this head.
Reviewed the delta from my 0a227e3d approval. 0729a3acfa added the constituent changed-path completeness gate and the post-admission base-movement recheck; 48913a630d repairs the queue-resolution fixture (changed_files: 1) and pins the policy contract by prefix. The Rust test shards pass at this head.
- Three original blockers remain fixed:
BASH_REMATCHis captured immediately after each match;ADMISSION_REPOSITORY/ADMISSION_PR_NUMBERare exported per inline constituent; the hard-cut packet falls back to the local template only on a verifiedHTTP 404, and the.gitattributesread fails on any non-404. - Mixed docs-only fix remains correct: per-constituent changed-path classification, renames and release surfaces fail closed, and the group scope still uses the combined-tree
detect-docs-only. - New completeness gate:
classify_constituent_docsnow requires the paginated files count to equal the PR's.changed_files, so a truncated file list cannot be classified docs-only. The fixture now supplies the count and the shards pass. - New base-movement recheck: after admission the step re-reads the base ref and refuses movement unless both the evaluated and newly observed packets are inactive. This is a faithful port of the landed
pr-candidate-admission/action.ymllogic, including thepacket_from_baseand 404 handling.
Residual, non-blocking: the base-movement branch has no workflow-level test of its own; its evidence is the textual match to the action's landed logic. Ripr Rust Small on GitHub Hosted / Rust gates is still pending at this head, so the head is not yet queue-eligible on that gate.
Static review only: no build, no checkout, no merge, no thread changes. Head pinned at 48913a630d.
|
Head moved from The delta is one commit: The green run Review dispatched at the exact head, scoped to whether the delta is test-only and does not change the workflow or repo-policy source approved at No queue action until the review exists at |
…atch # Conflicts: # .github/workflows/routed-rust.yml
|
|
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
Source review at head e5004c90a5ab7a951b4879271df1be6c23b99fe3 (base main), superseding nothing: my previous approval was at 48913a630d, and this head is that commit plus a merge of origin/main. Green.
What this head is. e5004c90a5 is a two-parent merge (48913a630d + 0ab323d565, the then-tip of main). 260 files appear between my approved head and this one, but that is main's own history arriving, not candidate work. The revisions check: git merge-tree --write-tree 48913a630d 0ab323d565 reports CONFLICT (content) in .github/workflows/routed-rust.yml, so the merge was hand-resolved. That resolution is the only new subject in this head, and it is what I reviewed.
1. The resolution is a clean union. The candidate's patch against the merge base (799ba7c6e7) and the head's patch against 0ab323d565 are the same 574-line patch, differing only in the cap context line (3000 vs 3700), blob hashes and hunk offsets. Diffing the two patches shows no other delta. The merged file's candidate delta is exactly +316/-117, the PR's own recorded stat for that file. No candidate hunk was dropped and no main hunk was lost.
2. Main's cap raise survived in all three sites. #14735 bumped the per-candidate changed-line cap to 3700. The merged file wires max-changed-lines: '3700' at both with: inputs (:315, :408) and --max-changed-lines 3700 in the new constituent loop (:485); grep 3000 on the merged file returns nothing. A stale 3000 in any one of those would have re-created exactly the split main's self-test exists to catch.
3. Main's own cap self-test passes on the merged file. I extracted candidate_admission.py at this head and ran its --self-test --workflow against the merged routed-rust.yml with --max-changed-lines 3700 --max-changed-files 160: all controls passed, exit 0. Run with the script default (3000) it fails with "the self-test certifies 3000 but the workflow wires 3700", which is the discriminator, so the pass is not vacuous. release_cut_admission.py --self-test and review_disposition.py --self-test also exit 0 at this head.
4. The constituent call sites still match main's modified scripts. main changed candidate_admission.py and review_disposition.py (+266 lines in the disposition script) inside this merge window, so I re-checked every flag the constituent loop passes instead of assuming the earlier review still applied. --current, --open-prs, --expected-head, --max-changed-files, --max-changed-lines, --pr-files, --base-sha, --comments, --generated-attributes, --docs-only all exist in the merged parser, and review_disposition.py still takes --repository/--pr/--head as invoked at :580 and :583. No argument rename landed under the candidate.
Carried, unchanged by the merge: ADMISSION_REPOSITORY/ADMISSION_PR_NUMBER are exported per inline constituent (:480); BASH_REMATCH is read immediately after each match; the hard-cut packet falls back to the local template only on a verified HTTP 404 (:456) and the .gitattributes read fails on anything else (:475); the post-admission base-movement recheck refuses unless both the evaluated and newly observed base carry an inactive packet (:502-517).
Runtime evidence at this head, its exact subject: the hosted lane ran on e5004c90a5, not on my earlier heads — Ripr Rust Small on GitHub Hosted / Rust gates SUCCESS 20:58Z, test shards 1-4 SUCCESS 20:28-20:29Z, Ripr Rust Small Result SUCCESS 20:58Z, Admit PR Candidate and Route Ripr Rust Small SUCCESS. GitHub scheduling those runs also proves the hand-merged workflow parses as valid YAML at this head.
Limits, stated rather than papered over. The merge_group constituent path itself has not executed: those steps are gated on event_name == 'merge_group', so the route/admission and test runs above are the pull_request path. Its bash is therefore still statically reviewed only — bash -n is unavailable on this Windows box, and the merges touched no bash lines, but I did not execute it. main has since moved 13 commits past 0ab323d565; those are unrelated to the touched surfaces, and I am not asking for a restack.
Stage: source review at e5004c90a5 is green. Integration/merge-group qualification stays with the queue and is untouched by this pass.
#14671 moved again: another merge-only deltaThe head is now The review already covered the full five-commit delta from What remains: a verdict at Admission is held until it settles. This PR has moved five times, and the last two moves were main merges. A review bound to a merge head will keep going stale while main moves, so I am not enqueuing on the old verdict. |
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
VERDICT: APPROVE e5004c9
No blocking findings on this head. The delta from 48913a63 is merge-only: the merge brings origin/main forward, and the PR's own diff is byte-identical at both heads — ten files, 427 insertions / 150 deletions (routed-rust.yml, the repo-policy contract and its mirrors, the two xtask fixtures, the history-sync test, the changelog fragment, docs/CI.md and docs/MERGE_FLOW.md).
The three blockers remain fixed: ref_pr/ref_sha are captured immediately after the /pr-N-sha match (routed-rust.yml:353), each inline constituent admission exports ADMISSION_REPOSITORY/ADMISSION_PR_NUMBER (:480), and the hard-cut packet and .gitattributes reads fall back only on a verified HTTP 404 (:456, :475).
The mixed docs-only fix remains correct: classify_constituent_docs is still fed the constituent's own changed paths and its changed_files count (:376), the tip uses tip_docs_only (:390, :406), and the group scope still uses the combined-tree detect-docs-only. The base-movement recheck is still the faithful port (:515).
Zero unresolved review threads at this head.
This PR has now moved repeatedly, and its last two moves were main merges that do not change the PR's own diff. A verdict bound to a merge head will keep going stale as main advances; it is worth holding admission until the head settles, or treating an unchanged own-diff merge head as carrying the current verdict. I reviewed statically only; I did not run a build or test.
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
VERDICT: APPROVE e5004c9
No blocking findings on this head. The delta from 48913a63 is merge-only: the merge brings origin/main forward, and the PR's own diff is byte-identical at both heads — ten files, 427 insertions / 150 deletions (routed-rust.yml, the repo-policy contract and its mirrors, the two xtask fixtures, the history-sync test, the changelog fragment, docs/CI.md and docs/MERGE_FLOW.md).
The three original findings are still repaired:
ref_pr/ref_shaare captured immediately after the/pr-N-shamatch (routed-rust.yml:353).- Each inline constituent admission exports
ADMISSION_REPOSITORY/ADMISSION_PR_NUMBER(:480). - The hard-cut packet and
.gitattributesreads fall back only on a verifiedHTTP 404(:456,:475).
The mixed docs-only fix is still correct: classify_constituent_docs is fed the constituent's own changed paths and its changed_files count (:376), the tip uses tip_docs_only (:390, :406), and the group scope uses the combined-tree detect-docs-only. The base-movement recheck is still the faithful port (:515).
Zero unresolved review threads at this head. Static review only; no build or test run on this host.
Summary
.github/workflows/routed-rust.ymlmerge_grouprouting, admission, and result evaluation to validate every constituent PR in a multi-PR merge-queue batch (single-parent linear chain of unique(#N)squash commits, same-repo check, liverefs/pull/<N>/head+git merge-tree --write-treebinding,candidate_admission.py,review_disposition.py, unresolved threads, andmergeQueueEntry.id).tools/repo-policy/src/lib.rs,tools/repo-policy/src/workflow_tests.rs,docs/MERGE_FLOW.md, anddocs/CI.md.hill/ci-efficiency(ci: harden merge_group admission and disable incremental with sccache #14656).Source-of-truth Links
Governing issue or accepted claim: #8082
Acceptance delta (one sentence): Validate all constituent PRs in a multi-PR
merge_groupbatch across routing, admission, and result checks inrouted-rust.yml.Candidate branch:
hill/ci-merge-group-batch(78747b5cf44e53a818bbab0207ba8e1afae32da0)Stack parent or prerequisite PR: #14656 (
hill/ci-efficiency)Production & Evidence Delta
.github/workflows/routed-rust.yml,tools/repo-policy/,docs/MERGE_FLOW.md,docs/CI.md).tools/repo-policy/src/workflow_tests.rsupdated (78 passed).Acceptance Matrix
cargo policy check-workflowsexit 0)cargo test -p repo-policy --libexit 0)actionlint(author-run)exit 0)Proof Actually Run
cargo policy check-workflows: passed (exit 0)cargo test -p repo-policy --lib:78 passed; 0 failed; 0 ignored(exit 0)Limitations / Non-claims
#14656;check-doc-index,markdown-links, and livemerge_grouprun not yet executed.Rollback Boundary
78747b5cf44e53a818bbab0207ba8e1afae32da0.Source Review of Record
Source review: SOURCE_REVIEW_READY e5004c9
Delta review by the RIPR Reviewer at this head, 2026-11-15T20:08Z: APPROVE e5004c9, covering the merge of main 0ab323d into 48913a6 only. The one hand-resolved conflict extends max-changed-lines 3700 to the additional-constituent path, which is correct because #14735 states the cap per candidate, not per tip; leaving it at 3000 would make admissibility depend on queue position. All three CodeRabbit fixes survived the merge and the three pinned snippets match the merged workflow. Hosted qualification on this head is not established. The 8b8d44c packet stands for everything else; this is not a full re-review. Carried here by the operational root, because the reviewer role makes no GitHub writes in this campaign.
Recorded follow-ups (non-blocking)
routed-rust.yml:335, and the base-movement check at:500-518has no contract row at all. Suggested anchors:[ "$count" = "$expected" ] ||and[ "$base_sha_after" != "$base_sha" ]..[-1]tip rule and the per-constituent--docs-onlypath have zero coverage.lib.rs:1344,workflow_tests.rs:1284,xtask/src/tests.rs:9854), so one workflow edit needs three test edits.