damccorm opened a new issue, #41911: URL: https://github.com/apache/beam/issues/41911
### Context Following the [[email protected] discussion on handling the increase in non-committer AI-driven PRs](https://lists.apache.org/thread.html/785c89ngfsdptf95bzpt4vk21o5v0k6d) and community voting, this tracking issue coordinates implementation of the agreed-upon policies, PR template updates, automated review improvements, and `pr-bot` guardrails. **Goal:** Filter out low-effort/unowned PRs, raise PR quality before human review, and strictly bound reviewer workload while keeping Apache Beam welcoming to engaged external contributors. **Key Design Decisions:** - `.asf.yaml` PR creation cap: `max_open_pull_requests: 3`, `include_drafts: false`, with a `bypass_users` allowlist. - Trusted external contributor allowlist: extend `pr-bot` committer privileges (direct reviewer requests, `R: @`, `assign set of reviewers`, `stop reviewer notifications`, Tier 1 queue priority) to a shared `trustedContributors` allowlist in `.github/REVIEWERS.yml`. - Rolling reviewer rate limit: **10 reviews per trailing 10 days per reviewer — never bypassed** (committers and trusted contributors receive Tier 1 priority and queue at the front when reviewers are at capacity). - Human-review attestation checkbox: **required for all human PRs** (committers and non-committers; automated bots exempt). - Automated AI review gate signal: track via the existing **`ready-for-human`** label. - `checks.ts` zero-checks pass-through: intentionally preserved until Fork CI lands in Future Work. --- ### Implementation Checklist #### Phase 1: Immediate Friction, Policies, Agent Steering, and PR Template - [ ] **Cap concurrent open non-draft PRs per non-committer via `.asf.yaml`** — Enable `github.pull_requests.creation_cap` (`max_open_pull_requests: 3`, `include_drafts: false`, `bypass_users` allowlist seeded from `.asf.yaml` `collaborators`), clean up duplicate `release-2.8.0` entry, and verify post-merge asfyaml sync. - [ ] **Add `AI_POLICY.md` and update `CONTRIBUTING.md`** — Document human ownership & author as first reviewer (per ASF ICLA and ASF Generative Tooling Guidance), quality-based enforcement (not AI detection), ban on fully autonomous external bot PRs, ban on unedited LLM replies to review comments, and permission for concise human-edited LLM PR descriptions; update `R: @username` guidance in `CONTRIBUTING.md`. - [ ] **Update committer reviewer guidelines (`contributor-docs/committer-guide.md`)** — Normalize converting unready or AI-reply PRs to draft, applying `awaiting triage` for high-blast-radius PRs, or closing unengaged PRs / "AI dumps" without guilt, with polite response templates. - [ ] **Add proactive agent guidance via `AGENTS.md` (and align `.agent/skills/contributing/SKILL.md`)** — Include direct `STOP` instructions for unsupervised autonomous agents, prohibitions against checking the human-review attestation checkbox or posting autonomous review replies, concise PR description guidelines, and mandatory local pre-PR checks. - [ ] **Remove past Beam PRs as a GSoC recruitment factor** — Explicitly document in `CONTRIBUTING.md` and the Beam website (plus Confluence wiki / ASF ComDev GSoC listings) that prior Beam PRs will not factor into GSoC selection, and ask applicants to showcase Beam usage (e.g., component, pipeline, or benchmark) in their own repo. - [ ] **Redesign `.github/PULL_REQUEST_TEMPLATE.md` and add checkbox auto-labeling in `.github/workflows/label_prs.yml`** — Add mandatory human-review attestation checkbox (all human PRs) + optional Beam-user prioritization checkboxes (`user-impact: bug`, `user-impact: config`, `user-impact: feature`) and auto-sync labels on `opened`/`reopened`/`edited`. #### Phase 2: Automated AI Code Review Tooling - [x] **Add two-pass Apache Beam automated code review guide** (#41851) - [ ] **Switch `gemini_code_review.yml` to two-pass local read-only agent** (#41860) - [ ] **Align Gemini review bot with advisory norms, `ready-for-human` label, and bot consolidation** — Never approve or post "LGTM"; stay silent when 0 verified findings exist; apply `ready-for-human` when 0 unresolved Critical/High findings remain and remove it when Critical/High findings are posted; disable overlapping Gemini Code Assist marketplace app reviews in `.gemini/config.yaml` once #41860 stabilizes. #### Phase 3: `pr-bot` Guardrails, Gating, and Reviewer Rate-Limited Queue - [ ] **Add `pr-bot` CI unit test workflow and `pr-bot-state` write batching/concurrency hardening** — Run `npm test` on PRs touching `scripts/ci/pr-bot/**` or `.github/REVIEWERS.yml`; batch state writes with rebase-retry and concurrency guards. - [ ] **Auto-unassign directly requested reviewers & harden `pr-bot` commands** — Add `trustedContributors` allowlist to `.github/REVIEWERS.yml`; automatically unassign reviewers directly requested (`review_requested`) by non-committer/non-allowlisted users; restrict `R: @username`, `assign set of reviewers`, and `stop reviewer notifications` to committers and `trustedContributors`. - [ ] **Upgrade `pr-bot` CI, all-human attestation, and `ready-for-human` gating** — Fix `checks.ts` ascending sort and missing pagination bugs (preserving intentional 0-checks pass-through until Fork CI); add non-flaky check filtering + bounded auto-retry; hold reviewer assignment until attestation checkbox is checked (for all human PRs, committers and non-committers) and `ready-for-human` label is present. - [ ] **Implement strict rolling reviewer rate-limit and priority pending review queue** — Enforce a global 10-review / trailing 10-day cap per reviewer across all labels (never bypassed); sort eligible PRs by Tier 1 (committers + `trustedContributors`) > Tier 2 (`user-impact: bug` > `user-impact: config` > `user-impact: feature`) > Tier 3 (other external PRs, FIFO); apply `pending-review-queue` (exempt from `stale.yml`) with a transparent status comment when reviewers are at capacity. #### Future Work (Deferred) - [ ] **Pilot external-contributor Fork CI & tighten `checks.ts` zero-checks gate** — Add a dedicated secret-free GitHub-hosted `fork_ci.yml` + read-only upstream mirror (`fork_ci_status.yml`), pilot with volunteer external contributors, and then remove the intentional 0-checks pass-through in `checks.ts`. --- ### Explicit Non-Goals (Rejected in Community Discussion) - Banning LLM-assisted PR descriptions (globally or for non-committers only). - Blanket bans or tiered "apprenticeship" restrictions on AI-authored code. - Mandatory commit-message AI trailers (`Generated-by:` / `Assisted-by:` / `Co-authored-by:`). - Repo-wide automatic GitHub Copilot reviews in `.asf.yaml`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
