Repository navigation
pr-flow: arm auto-merge, rotate reviewers, route change requests - #14
RyanTheTide wants to merge 9 commits into
Conversation
The readiness bot says what a pull request still needs; nothing acts on it, so finished PRs wait days for someone to notice an approval, a push after a review or a change request. pr-flow runs every 10 minutes over every open, non-draft PR, using the readiness bot's own evaluation. When everything but the approval holds it turns on GitHub auto-merge (merge commit, head pinned), so the PR merges the moment a counted approval lands; it merges approved CLEAN PRs with a normal merge and disarms when the head moves or a blocker appears. It asks one active reviewer per PR by load, moves requests after a 4-hour SLA, asks reviewers again after a push with the delta, routes change requests on lab PRs to the owning lane, and writes a queue with merge metrics. It never changes rulesets, never uses the admin bypass and never approves. pr-readiness: trust verdicts and approvals from the organisation's review App by login (GitHub reports its association as NONE). Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Two PRs merged before their rows: linux#3213 said 'hardware rows still owed' and mesa#1168 had one Mac with more rows under 'Not yet'; both were reverted. Two mesa PRs that were each CLEAN broke the tip together. Before arming or merging, require a head-SHA row line, a second Mac for linux, mesa, aura, installer and u-boot, no 'owed'/'still to run' in Tested or Not yet, and no lane line holding the PR. Merge at most one PR per repository per run and keep one armed PR at a time on mesa. Cached evaluations from an older gate never arm or merge. Offline tests cover both reverted cases. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
mesa keeps approvals after a push, so mesa#700 merged on an approval that predated a maintainer forward-merge, before its row at the new head. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
There was a problem hiding this comment.
Verdict: FINISH, then merge at 5d8174fe4a356ed6cae4b939294f88c7345ef37f
Blockers:
.github/aurora/pr-flow.py:543takes the direct-merge branch before checking the armed count at line 552. I ran the exact-head decision function offline with one armed Mesa PR and one separately approved, clean Mesa PR. It still issued a direct-merge action for the second PR. The armed PR can land independently alongside it. Make direct merges and arms share the repo's outstanding slot, and account for every live arm. Add coverage for both action orders.- At the detail time budget and error fallback, the code appends a cached evaluation even when the listing fingerprint changed. The mutation loop only checks the evaluation format version. After a same-head evidence edit, the stale approval and row state can still drive a mutation because the head pin remains valid. Keep stale evaluations for queue display and skip writes until the matching detail has been fetched.
Checked: Traced the row, non-default-base, approval, change-request and direct/auto-merge gates. Used an offline action recorder with no GitHub mutations for the first finding. Reviewed token loading and lane routing. No binding, board, private material, or attribution changes found. Because this head is deployed, please route the findings to the timer owner before the next write batch.
There was a problem hiding this comment.
One more hold-gate case at the same head. lane_holds() overwrites its per-PR candidate whenever a later configured file mentions the PR. It neither compares timestamps nor restricts replacement to explicit hold/release events. A newer HOLD in one file can disappear when a later-scanned file has an older neutral status line. Keep active holds until an authorized explicit release, and test conflicting lines from two files in both scan orders. Today the generated queue listed aura #369 as “merge now” after REVIEW6 logged a hardware HOLD, while GitHub still blocked it. Please check the hold selection along with the original two fixes.
…tions, keep holds until released Three gaps found in review of 5d8174f: - A direct merge was taken before the armed count was checked, so a repo with one PR armed could still get a second PR merged next to it. The armed PR can land on its own approval, untested together with the merge. Every live arm (anyone's, bot PRs included) now comes from the listing, and no PR merges directly beside another armed PR in its repo. Serial repos (mesa) count those arms too. - When a detail refresh failed or hit the time budget, the cached evaluation was used for actions even though the listing showed the PR had changed. Such PRs now stay in the queue but are never armed, merged, sent for review or routed; an arm of ours on one is turned off. - The lane hold scan kept only the last line per PR in file scan order, so an older neutral line in a later file hid a newer HOLD. Holds now stay until a newer explicit release (Verdict: MERGE, merge-ready, hold lifted) in any scanned file, or a later PASS row with no failures in the same file. Times across files are compared, with ties keeping the hold. Offline tests run main() against recorded GitHub fixtures (no network) for both action orders, live arms set by others, refresh errors and the budget path, and check conflicting hold lines in both file orders. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
Fixes for the three findings at 1. Direct merge beside an outstanding arm (13:13 review, blocker 1). Every live arm now comes from the listing ( 2. Cached evidence after a failed refresh (13:13 review, blocker 2). A PR listed from the cache after a detail error or the time budget goes into 3. File-order hold clobber (13:33 follow-up). Effect on today's lane files (read-only comparison of the old and new Tested: The timer still runs the deployed tree at |
There was a problem hiding this comment.
Please keep the hold on 0b1fa44. The offline suite passes, including the earlier stale-refresh, live-arm and cross-file ordering cases.
I added an offline lane-line case: linux#3206 HOLD: second family untested. First family PASS, 0 failures. At this head, lane_holds() leaves the PR out of HOLDS. The passed branch takes precedence over HOLD_RE, so a partial pass on the same line discards the explicit hold. If that file already has an older hold, the same mixed line can release it too. This bypasses the lane veto for a PR that otherwise satisfies the arm or merge checks.
Please give explicit hold language precedence over an inferred pass and add both variants to the offline suite. Keep the standalone passing rerun case as a control.
Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
|
Fixed at 0bb8d87. An explicit hold now wins over a partial PASS on the same line, both when it creates a hold and when an older hold already exists. A standalone clean rerun still releases a hold in its own file. I merged current main forward and kept its check and review pagination in the pr-flow reader. The offline pr-flow and pr-readiness suites pass, including a failing required check on the second page. This branch has not been deployed. |
There was a problem hiding this comment.
Verdict: MERGE at 0bb8d87
Checked: Explicit hold language now wins over a partial PASS on the same lane line. I replayed the earlier mixed-result case both with and without an older hold. Both kept the hold. The standalone later PASS control still releases its hold, and the exact offline suite passed all 48 checks.
What: finished PRs wait days between "ready" and "merged" because nothing acts on the readiness bot's verdict.
pr-flow.pyruns every 10 minutes over every open, non-draft PR with the readiness bot's own evaluation: it turns on GitHub auto-merge when only the approval is missing (so the PR merges the moment a counted approval lands), merges approved CLEAN PRs with a normal merge, asks one active reviewer per PR by load with a 4-hour SLA, asks reviewers again after a push with a compare link, routes change requests on lab PRs to the owning lane, and writes a queue with merge metrics. It never changes rulesets, never uses the admin bypass and never approves. Also: pr-readiness trusts verdicts from the organisation's review App by login (GitHub reports its association as NONE).Tested: no runtime change (organisation tooling, no Mac code). Offline tests:
python3 .github/aurora/pr-flow-test.py(row gate incl. the linux#3213 and mesa#1168 cases, lane holds). Live on the buildbox since 15:29: 43 merges in the first 2 hours (34 direct, 9 on approval). Two of them went in before their rows and were reverted (linux#3213 -> #3351, mesa#1168 -> #1200), and mesa#680 + #1183 were each CLEAN but broke the mesa tip together (fixed by #1201). Sinceb62b3ebthe row gate below blocks those cases: on its first run it disarmed 12 armed PRs that lacked a head row or a regression row.Risk: two-way · none (no Mac affected; disable with a
PAUSEfile or by stopping the timer)Not yet: an App approval does not satisfy the rulesets yet (App permission Contents is read-only; code-owner rules cannot name an App), so agent approvals of lab PRs still cannot trigger auto-merge. Owner settings, reported separately.
Details
Row gate (stricter than the readiness label) before arming or merging: a head-SHA row line; a second Mac for linux, mesa, aura, installer and u-boot; nothing in Tested or Not yet saying rows are owed or still to run; no lane line holding the PR. One merge per repository per run; one armed PR at a time on mesa. Evaluations from an older gate never arm or merge; PRs our account armed outside pr-flow's state follow the same gate.
Arms only PRs GitHub reports
BLOCKED(by the review rule), so a PR is never armed where GitHub would merge it without a review. Disarms when the head moves or CI, a change request, a conflict or a hold appears.Never arms or merges: policy repos (
.github,agent-guidelines),door:one-way, Stage 1 / boot-object titles,hold/blocked/do-not-merge, excluded PRs, stacked PRs (base not the default branch), private repos (no auto-merge on the plan). They show asmerge (by hand)/base/holdin the queue.Reviewers: members of Core, Omarchy Mac and Aurora Maintainers with 3+ reviews in the last 7 days, never the author, capped per person; for PRs not by the lab account, the lab's reviewer agents (a line in their lane file). Ready PRs first, outside contributors first, then oldest.
People get a GitHub re-request (no per-PR comment by default); the delta links go into one batched digest every 2 hours.
Incremental: a PR's detail is read again only when its head, CI rollup, mergeability, review decision, labels or update time change (or every 6 h). Reads can use a separate token command (the review App's installation token) to keep the maintainer's rate limit free.
Docs:
docs/pr-flow.md.