ci(pr-review): trigger OpenAB PR Review on PR events, not just cron#1218
Conversation
…min cron The 'OpenAB PR Review' required status is posted only by the */5 cron poller. GitHub throttles scheduled runs, so after a push/rebase the new head SHA can sit in 'Expected — Waiting for status to be reported' for a long time. Add a pull_request trigger (opened/synchronize/reopened) so the review runs promptly on every head change. The cron stays as a safety net, and the existing per-SHA dedup avoids redundant reviews. Concurrency is left as-is (same-repo, low-velocity; superseded same-PR reviews cancelling is desirable).
|
LGTM ✅ — Minimal, safe trigger addition that eliminates cron-throttle latency for same-repo PRs. What This PR DoesAdds a How It WorksTwo-line addition to the Findings
Finding Details🟢 F1: Minimal, safe changeOnly adds 2 lines to the 🟢 F2: Well-documented tradeoffsThe PR body explicitly covers fork-PR read-only token limitation and the global concurrency group behavior. Both are acceptable for this repo's usage pattern. 🟢 F3: Dedup preservedThe poll step already checks commit status state before triggering — a Baseline Check
What's Good (🟢)
|
…403) (#1219) #1218 added a pull_request trigger, but fork PRs run with a read-only GITHUB_TOKEN, so creating the 'OpenAB PR Review' status 403s and the run fails (observed on fork PR #1190). Guard the job to run on pull_request events only for same-repo PRs; forks continue to be handled by the cron poller (which runs with full permissions). schedule/workflow_dispatch always run. Fixes the failing runs introduced by #1218. Co-authored-by: chaodu-agent <chaodu-agent@users.noreply.github.com>
What problem does this solve?
OpenAB PR Reviewis a required status posted only by the*/5cron poller inpr-bot-review.yml. GitHub throttles scheduled workflows (observed: actual runs hours apart, not every 5 min), so after a push or rebase the new head SHA sits in "Expected — Waiting for status to be reported" for a long time, blocking the PR.Change
Add a
pull_requesttrigger so the review runs promptly on every head change:Why this is safe (no other changes)
GITHUB_TOKENis read-only and can't write statuses, plus anything missed).pr-review-poller, cancel-in-progress): for this repo (same-repo branches, low PR velocity) cross-PR cancellation effectively never happens; and cancelling a superseded same-PR review is the desired behavior (review the latest SHA).Effect
A rebase/push now posts
OpenAB PR Reviewwithin a minute or two instead of waiting on the throttled cron.Note
For fork PRs,
pull_requestruns with a read-only token and can't write the status — those continue to be handled by the cron poller (which runs with full permissions). Same-repo PRs (the common case) post promptly.