Proposal: deterministic PR governance pipeline (lessons from AnyPS5's 24k+ PR workflow) #2486

Open
opened 2026-11-25 14:46:06 +00:00 by rbolsoni · 1 comment
rbolsoni commented 2026-11-25 14:46:06 +00:00 (Migrated from github.com)
Contributor

Imported from Marvisak/VIctory. Originally posted by rbolsoni on 2026-11-25T14:46:06Z.


Following up on #1026 (and complementary to #1633 and #1698): boykopovar/AnyPS5 hit the exact same wave of high-volume / AI-assisted PRs (~24,600+ PRs, ~2,600 open) and solved review/CI bottlenecks with a fully deterministic, zero-LLM GitHub Actions pipeline that maps cleanly to VIctory's Rust/xtask setup:

  1. Progressive open-PR quota (pr-intake.yml) — pull_request_target caps open PRs per author by merged history (e.g., 1 with 0 merged, 20 with ≥1, unlimited at 20+) and auto-closes overflow with a polite note to reopen later. Immediately curbs drive-by PR floods without blocking trusted contributors.
  2. Safe static gate on pull_request_target (no untrusted code execution) — instead of blocking every fork PR on manual CI approval, run fast checks (e.g. xtask policy, PR template, basic conventions) from main against fetched PR Git objects.
  3. Batched workflow_dispatch builds (up to N PRs at once) — allow maintainers to trigger ci.yml with a space-separated list of PR numbers; the job merges them with git merge --no-ff onto main and runs cargo clippy + cargo test once with shared rust-cache. Lets a single Windows runner validate 20–40 PRs in one pass before batch-merging.
  4. Automated overlap detection (git merge-tree --write-tree) — hourly/on-push scan over open PR heads in memory (no checkout) to comment on PRs touching the same lines/shader lowerings/HLE exports, catching collisions that bypass manual claiming in #1633.
  5. Hourly Top-30 review queue (GraphQL) — filters open PRs down to those with zero blockers (no draft, no conflict, green checks, and any CHANGES_REQUESTED explicitly answered with a re-request), sorts critical-path labels first then FIFO, and labels only the top 30 (plus an optional --explain <PR> CLI for contributors).

Reference implementations (GPL-2.0, concise Python/YAML):

  • boykopovar/AnyPS5: .github/workflows/pr-intake.yml, conventions.yml, build.yml (workflow_dispatch batching), pr-overlap.yml, pr-ready.yml and tools/pr_ready.py / tools/pr_overlap.py.

Happy to help adapt a minimal subset (starting with pr-intake + batched ci.yml + review queue) if maintainers want this direction.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6607125614 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/2488). Originally posted by [rbolsoni](https://github.com/rbolsoni) on 2026-11-25T14:46:06Z. --- Following up on #1026 (and complementary to #1633 and #1698): `boykopovar/AnyPS5` hit the exact same wave of high-volume / AI-assisted PRs (~24,600+ PRs, ~2,600 open) and solved review/CI bottlenecks with a **fully deterministic, zero-LLM GitHub Actions pipeline** that maps cleanly to VIctory's Rust/`xtask` setup: 1. **Progressive open-PR quota (`pr-intake.yml`)** — `pull_request_target` caps open PRs per author by merged history (e.g., 1 with 0 merged, 20 with ≥1, unlimited at 20+) and auto-closes overflow with a polite note to reopen later. Immediately curbs drive-by PR floods without blocking trusted contributors. 2. **Safe static gate on `pull_request_target` (no untrusted code execution)** — instead of blocking every fork PR on manual CI approval, run fast checks (e.g. `xtask policy`, PR template, basic conventions) from `main` against fetched PR Git objects. 3. **Batched `workflow_dispatch` builds (up to N PRs at once)** — allow maintainers to trigger `ci.yml` with a space-separated list of PR numbers; the job merges them with `git merge --no-ff` onto `main` and runs `cargo clippy` + `cargo test` once with shared `rust-cache`. Lets a single Windows runner validate 20–40 PRs in one pass before batch-merging. 4. **Automated overlap detection (`git merge-tree --write-tree`)** — hourly/on-push scan over open PR heads in memory (no checkout) to comment on PRs touching the same lines/shader lowerings/HLE exports, catching collisions that bypass manual claiming in #1633. 5. **Hourly Top-30 `review queue` (GraphQL)** — filters open PRs down to those with zero blockers (no draft, no conflict, green checks, and any `CHANGES_REQUESTED` explicitly answered with a re-request), sorts critical-path labels first then FIFO, and labels only the top 30 (plus an optional `--explain <PR>` CLI for contributors). Reference implementations (GPL-2.0, concise Python/YAML): - `boykopovar/AnyPS5`: `.github/workflows/pr-intake.yml`, `conventions.yml`, `build.yml` (`workflow_dispatch` batching), `pr-overlap.yml`, `pr-ready.yml` and `tools/pr_ready.py` / `tools/pr_overlap.py`. Happy to help adapt a minimal subset (starting with `pr-intake` + batched `ci.yml` + `review queue`) if maintainers want this direction.
Marvisak commented 2026-11-25 19:06:37 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T18:50:47Z.


Automated triage for the maintainers.

This is a proposal about how the repository handles pull requests, not about VIctory's code. Whether to adopt PR quotas, batched CI, overlap detection or a review queue is the maintainer's decision, so it is labelled as a request and left for him. It belongs with the existing discussion in #1026, #1633 and #1698.

If any part is adopted, it would need to be written for this repository's workflows under this repository's licence. Copying workflow files from another project means checking whether its licence is compatible.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7171482619 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/2488#issuecomment-7171482619). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T18:50:47Z. --- <!-- victory-issue-triage v1 verdict=tracked seen=2026-11-25T14:46:06Z at=2026-11-25T19:04:00Z --> Automated triage for the maintainers. This is a proposal about how the repository handles pull requests, not about VIctory's code. Whether to adopt PR quotas, batched CI, overlap detection or a review queue is the maintainer's decision, so it is labelled as a request and left for him. It belongs with the existing discussion in #1026, #1633 and #1698. If any part is adopted, it would need to be written for this repository's workflows under this repository's licence. Copying workflow files from another project means checking whether its licence is compatible. --- _Generated by [Claude Code](https://claude.ai/code)_
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory#2486
No description provided.