Skip to content

Don't request code review until required CI checks pass (currently happens while checks are still IN_PROGRESS) #522

@FidoCanCode

Description

@FidoCanCode

Symptom

Fido marks a PR ready-for-review and requests review from the human while required CI checks are still in progress — the human gets a review notification before there's anything verifiable to review.

Concrete repro on rhencke/orly PR #6:

  • isDraft: false, review requested from rhencke
  • The single verify check is status: IN_PROGRESS (Coq build takes 10-15 min on cold cache)

If CI ends up failing, the human now has to either ignore the request (noisy) or close the loop manually.

Expected behaviour

The promote-from-draft path already gates on CI green (#465 / #486). But there are two distinct gates:

  1. pr_ready — flips draft → ready
  2. add_pr_reviewers — requests review

Right now both fire together once tasks complete + CI green is observed, but they fire on a single CI snapshot. With long-running checks, the second-to-last task can complete and trigger this pair while a fresh CI run kicked off by the most recent push is still in flight. Fido then promotes + requests review on a PR whose CI is mid-flight (not yet failed, not yet green).

Fix direction

Tighten the gate. Before add_pr_reviewers:

  1. Re-fetch CI status — must include the latest workflow run on the head SHA, with conclusion=success.
  2. If any required check is status=in_progress or status=queued, defer the review-request. Worker can either:
    • Wait: poll until checks finish, then promote / request review (or close as failed).
    • Skip and re-check on next webhook: don't request review now; let the check_run completion webhook re-trigger handle_promote_merge once CI lands.

#2 is cleaner — kennel already wakes the worker on check_run completion via waking worker thread, so the next pass naturally picks up the now-final state.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions