Skip to content

feat(id-gate): run and bisect ready PR batches - #12474

Merged
dezren39 merged 2 commits into
mainfrom
archer/12229-gate-driver
Nov 22, 2026
Merged

dezren39 merged 2 commits into
mainfrom
archer/12229-gate-driver

Conversation

@dezren39

@dezren39 dezren39 commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Add gate.py run to assemble ordered PR heads on a fresh origin/main worktree and run the planner's workspace check plus affected-crate tests through fleet shell --build.
  • Log each evaluated batch/sub-batch; bisect red runs and merge only green PRs, leaving failures open.
  • Use GitHub --merge commits to preserve PR ancestry and have GitHub mark accepted PRs as merged; interaction-only failures conservatively leave the entire batch open.

Evidence

  • Before: RunBatchTests failed because run_batch did not exist.
  • After: python3 -m unittest scripts.id.test_gate -v — 17 tests passed.
  • Also passed: python3 -m py_compile scripts/id/gate.py scripts/id/test_gate.py, git diff --check.
  • Ran on the laptop at 56799f4040.
  • Did not run live PR id: check the record join at admission, not only on read #12470: nixos-rebuild was active (PID 291703/291705) with /tmp/rebuild3.log progressing, so the required build-slot run would contend with it. No live batch was attempted.

Merge Danger

  • This driver invokes gh pr merge --merge for green PRs; run only from the intended laptop/repository with ID_GATE_OFF=1 available as the kill switch.
  • The first live batch remains to be run after the laptop rebuild finishes; ten consecutive batches and the two-week incident-rate goal remain outstanding.

Start Proof
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Use GitHub merge commits rather than cherry-picks so accepted PR commits retain their ancestry and GitHub marks each PR merged. A green candidate is applied in PR order; red subsets are tested from fresh origin/main worktrees, logged, and only green PRs are merged. Interaction-only failures conservatively leave the batch open.
@dezren39
dezren39 requested a review from a team as a code owner November 22, 2026 08:07
@coderabbitai

coderabbitai Bot commented Nov 22, 2026

Copy link
Copy Markdown

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 47 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

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 71a1ab49-5430-4801-a6b3-fccd5222a550
Commits

Reviewing files that changed from the base of the PR and between 4cef8fe and 56799f4.

Files selected for processing: 2

  • scripts/id/gate.py
  • scripts/id/test_gate.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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-22T08:10:48.689572Z 56799f4 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 56799f4040

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/id/gate.py
Comment on lines +211 to +213
if root_red and not red:
red = list(prs)
green = [pr for pr in prs if pr not in set(red)]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Revalidate the surviving PR combination before merging

When a batch contains both an independently failing PR and an interaction-only failure, this fallback still merges a failing combination. For example, with [1,2,3,4], suppose builds fail whenever PR 1 is present or PRs 3 and 4 occur together. Bisection identifies only PR 1 as a singleton culprit, so red is nonempty and the driver merges [2,3,4], even though it explicitly observed [3,4] failing. Retain interaction-failing subtrees or evaluate the complete surviving combination before merging any survivors.

Useful? React with 👍 / 👎.

Comment thread scripts/id/gate.py
# `gh pr merge --merge` creates the durable merge commit and marks each
# source PR merged; each accepted PR is applied in the same order tested.
for pr in green:
gh(["pr", "merge", str(pr), "--merge"], cwd=repo)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Pin each merge to the exact PR head that passed testing

If an author pushes to a PR while the batch build runs, this command merges the new, untested head rather than the commit assembled in the candidate worktree. The earlier headRefOid is neither checked against the fetched commit nor retained for merging. Locally inspected gh pr merge --help documents --match-head-commit SHA as “Commit SHA that the pull request head must match to allow merge”; capture the exact fetched/tested OID and require that match when merging.

Useful? React with 👍 / 👎.

@dezren39
dezren39 merged commit d4a004a into main Nov 22, 2026
2 checks passed
@dezren39
dezren39 deleted the archer/12229-gate-driver branch November 22, 2026 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant