damccorm opened a new pull request, #41976:
URL: https://github.com/apache/beam/pull/41976

   Part of #41911 (Phase 3.2 — Stack 3/4, stacked on #41975).
   
   ### Summary
   Fixes existing CI status bugs in `pr-bot`, adds bounded auto-retry for 
transient PreCommit flakes, and gates human reviewer assignment on the author 
human-review attestation checkbox and the `ready-for-human` automated review 
label:
   
   - **CI checks bug fixes & filtering (`shared/checks.ts`):**
     - Paginates `checks.listForRef` (`per_page: 100`) instead of stopping at 
the first 30 check runs.
     - Fixes `getMostRecentChecks` sort direction 
(`compareCheckRunsNewestFirst`) so the newest run wins (and active 
`in_progress`/`queued` runs with `completed_at: null` are prioritized over 
older completed runs).
     - Explicitly preserves the intentional zero-checks pass-through until 
external-contributor Fork CI lands (Future Work in #41911).
     - Expands `shouldExcludeCheck()` to ignore meta/bot/non-PreCommit checks 
(`codecov`, `process-pr-update`, `pr-bot`, `gemini`, `labelprs`, `pr signal`, 
`postcommit`, `loadtests`, `performancetests`, `stresstests`).
   - **Bounded auto-retry for flaky PreCommits (`shared/checks.ts`, 
`processNewPrs.ts`, `.github/workflows/pr-bot-new-prs.yml`):**
     - Triggers at most 1 automatic `actions.reRunWorkflowFailedJobs` per 
`(headSha, runId)` for failed non-lint PreCommit workflow runs (tracked in 
`prState.autoRetriedRuns`, pruning old SHAs).
     - Never retries deterministic lint/format/license workflows (`RAT`, 
`Whitespace`, `Spotless`, `Python Lint`, `Python Formatter`, `GHA`, etc.) using 
word-boundary matching so `PreCommit Python Integration` is still eligible.
     - Adds `actions: write` permission to `pr-bot-new-prs.yml`.
   - **All-human review attestation gate (`processNewPrs.ts`, `shared/pr.ts`, 
`shared/commentStrings.ts`):**
     - Requires `- [x] I, the PR author, have personally reviewed every line of 
this PR.` in the PR body for **all human PRs** (both committers and 
non-committers; automated bots exempt).
     - Posts a one-time reminder (`prState.commentedAboutMissingAttestation`) 
when unchecked and clears the block once checked. (Note: `edited` event support 
for immediate label refresh is added to `pr_signal.yml` in #41973; 
`pr-bot-new-prs` also sweeps every 30 minutes.)
   - **`ready-for-human` automated review gate (`processNewPrs.ts`):**
     - Holds human reviewer assignment for all human PRs (bots exempt) until 
the `ready-for-human` label is present (applied by Gemini Code Review in #41972 
when 0 Critical/High findings remain, or manually by a committer).
     - Holds silently while automated review is still pending; posts a one-time 
notice (`prState.commentedAboutAutomatedReview`) only after an automated review 
has posted without applying `ready-for-human`.
   
   ### Verification
   - Ran `npm run build && npm test` in `scripts/ci/pr-bot` (Node 24): **71 
passing** (including new unit tests in `test/checksTest.ts` and 
`test/processNewPrsTest.ts`).
   - Validated `.github/workflows/pr-bot-new-prs.yml` YAML and license headers.
   
   > **Merge order:** Merge #41974 → #41975 first, and merge #41973 (PR 
template attestation checkbox) & #41972 (`ready-for-human` label automation) 
before or together with this PR so human PRs receive the checkbox and label.


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

Reply via email to