You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pr_review.py wait Reports Checks Complete Before a Fresh Head's Jobs Register #3451
scripts/pr_review.py wait on a pull request into a non-default branch reads an attested local pass as coverage=local, then polls the head's checks "while they can still move its merge". Run right after a push, it can report the checks complete before the push's workflow jobs exist.
What Happens
Observed on a downstream repository whose pull request workflow fans out a compile matrix of about thirty jobs behind a change-detection job.
Push a new head, run attest, then run wait.
wait prints checks=5/5 and merge=CLEAN, and exits 0 after waited=2s.
At that moment only the change-detection job, the matrix-build job, a reviewer status, and the skipped bot jobs had registered against the head. The compile and lint jobs were still queued, and gh pr checks listed them as pending a few seconds later.
The run then took several more minutes, and status afterwards read checks=36/36.
A driver trusting the exit would judge the pull request green with most of its required jobs not yet started.
Likely Cause
The poll counts the check runs that exist at the moment it reads, and on a fresh head the jobs a workflow will create have not been attached yet. A matrix job's children are created only after its upstream jobs finish, so the window spans the whole first stage.
Suggested Change
Treat a head whose workflow runs are still queued or in_progress as not settled, rather than reading only the check runs attached so far. Alternatively, keep polling until the check-run count stops growing across a grace interval. --check-grace already names a similar wait for a required status nothing has posted.
Done When
wait run right after a push does not exit 0 while that head's workflow runs are queued or in progress, and a regression test covers the fresh-head case.
Activity
Split pr_review.py's Check and Round Readers Into Leaf Modules (#3462)
Hold a Held Wait While a Head's Workflow Run Has Not Completed (#3470)