Skip to content

pr_review.py Counts a Check Run a Rerun on the Same Head Superseded #2327

Closed

Description

@ptr727

Problem

scripts/pr_review.py counts a check run that a later run of the same check on the same head has superseded. In that state, wait returns at once on a failure that no longer gates anything.

Reproduction, as seen on ptr727/KiCadLibrary#70 on 2026-10-04:

  1. A pull request's first Lint sources job fails. Here the cause was the A comments Label Applied by gh pr create Misses the Event That Starts the First Run #1703 label race: the comments label arrived 2 seconds after the pull request was created.
  2. The pull request is closed and reopened to rerun the checks with the label. A new Test pull request action run starts on the same head SHA.
  3. While the new run is in progress, pr_review.py wait returns after 1 second with status=CHECKS_NOT_MERGEABLE and CHECK FAILED ('Validate sources job / Lint sources job', COMPLETED/FAILURE). That check belongs to the superseded run.
  4. After the new run completes successfully and GitHub reports mergeStateStatus: CLEAN, status still prints checks=31/33 stuck=FAILED with the same superseded failure.

Expected

For each check name on the head, only the newest run counts. wait keeps waiting while that newest run is in progress, and status reports the newest run's conclusion, so a closed-and-reopened pull request reads green once its rerun passes.

🤖 Generated with Claude Code

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

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