Skip to content

pr-wait.py: wait for finished checks to settle before reporting - #31

Merged
bonelifer merged 1 commit into
mainfrom
fix-pr-wait-settle
Oct 19, 2026
Merged

bonelifer merged 1 commit into
mainfrom
fix-pr-wait-settle

Conversation

@bonelifer

Copy link
Copy Markdown
Contributor

Fixes pr-wait.py reporting "passed" too early, right after a pull request is opened.

The bug

In seed-forum#23 the workflow runs on both push and pull request. The push run had finished a few minutes before the pull request was opened. On its first look, pr-wait.py saw only that finished push run, because GitHub hadn't added the pull request's own run yet, and it exited 0 while the real run was about to start.

The fix

A result now counts only once the same finished checks have been seen for --settle seconds (default 30, new -s option). If a new run appears in that time, or a check changes, the wait carries on. This adds up to 30 seconds to every wait, which is small next to a CI run. If the timeout runs out while finished checks are settling, the message says so.

Other changes

  • tests/test-pr-wait.sh: a regression check for this case (a finished run, then a new queued run, then both passed: exit 0 only after both), and a check that --settle 0 is refused. The other checks pass a short settle time. 24 checks in all.
  • README and the script's help describe --settle.

Testing

Claude ran tests/test-pr-wait.sh (all 24 pass), ShellCheck and flake8.


Investigated and written by Claude on behalf of William Jacoby (bonelifer).

🤖 Generated with Claude Code

Right after a pull request is opened, GitHub can show only an earlier
push run, already finished, before it adds the pull request's own run;
pr-wait.py then reported "passed" too early. The result now counts only
once the same finished checks have been seen for --settle seconds
(default 30).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bonelifer
bonelifer merged commit ecfe56d into main Oct 19, 2026
1 check passed
@bonelifer
bonelifer deleted the fix-pr-wait-settle branch October 19, 2026 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant