Skip to content

ci(review-loop): pre-existing races in PR review poller (concurrency groups, per-SHA gating) #1627

Backlog

Description

@chaodu-agent

Found during review of #1626. These behaviors exist on main and are not changed by #1626.

1. /review and scheduled runs can race on the same PR

.github/workflows/pr-bot-review.yml puts schedule/dispatch/pull_request runs in pr-review-poller-poll and /review runs in pr-review-poller-<PR>. Both runs can read the same status, pass the gate, write pending and send a webhook. A status write is not compare-and-set, so reads alone cannot serialize them.

2. Gating is per HEAD SHA, not per PR

If a round is running for SHA A and the PR is pushed to SHA B, SHA B has no status and is eligible on the next poll. The ADR (docs/adr/pr-review-loop.md L90, L224) says this guarantees "at most one in-flight review per PR", which is stronger than the workflow provides.

3. Missing created_at on a pending status triggers immediately

In the pending branch, an empty PENDING_AT skips both stale checks and falls through to a trigger.

Suggested direction

  • Put /review and scheduled runs in one concurrency group per PR, or claim the PR before sending the webhook.
  • Either add a PR-scoped in-flight check, or reword the ADR to say duplicates are limited per SHA.
  • Treat a pending with no timestamp as invalid and skip it with a log line.

Refs #1621, #1626

Activity

  1. github-actions commented on Nov 24, 2026

    @github-actions

    Thanks for the report! A maintainer will triage this shortly and apply the appropriate label. Once a type label is added, the issue will be re-validated automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions