Skip to main content

Module review_poll

Module review_poll 

Source
Expand description

PR review polling — review_open_prs.

Extracted from engine/review.rs. Monitors tasks in InReview status, checks for human review feedback, and re-dispatches agents when changes are requested.

§Batching strategy

Instead of making 4–5 individual REST calls per in-review task, the loop is split into phases:

  1. Validate tasks and load stored data (no API calls).
  2. Resolve missing PR numbers concurrently via REST (rare after first tick).
  3. Handle tasks with no open PR (merged / reroute logic).
  4. Fetch all PR review data in one GraphQL query for all tasks at once.
  5. Build a collaborator cache from batch issue comments (unique users only).
  6. Process each task using the pre-fetched batch data.

With N in-review tasks the call count drops from ~5N REST calls to:

  • M get_pr_number REST calls (M ≈ 0 after first tick per task)
  • 1 GraphQL batch call
  • K is_collaborator REST calls (K = unique automated-review users ≪ N)