Repository navigation
fix(watch-pr): wait for head-scoped Actions workflows - #1124
ErickMachado wants to merge 4 commits into
Conversation
| latest.set(check.id, check); | ||
| } | ||
| if (seen >= result.total) | ||
| return [...latest.values()].map(({ id, attempt, ...check }) => check); |
There was a problem hiding this comment.
Superseded runs block readiness
Medium Severity · Logic Bug
Latest-attempt selection is keyed by run id, so every head-scoped workflow run joins classification. A cancelled earlier run of the same workflow still counts as failed when a newer run is queued or green, so the watcher reports a CI blocker instead of waiting.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 43bc757. Configure here.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.
Reviewed by Cursor Bugbot for commit e7804d2. Configure here.
| const repositoryId = positiveInteger( | ||
| at(run, ["head_repository", "id"]), | ||
| "workflow run.head_repository.id" | ||
| ); |
There was a problem hiding this comment.
Nullable head repo fails snapshot
Medium Severity · Logic Bug
parseWorkflowRunPage now requires head_repository.id on every workflow run. GitHub can return head_repository as null when the head repo is gone, so one valid row fails the whole Actions read and the watcher surfaces a status-query blocker instead of classifying that run. head_branch already allows null on the same object.
Reviewed by Cursor Bugbot for commit e7804d2. Configure here.
|
Hey @ErickMachado, two notes from reading this against the other open watch-pr PRs.
|
|
Adding to the note above: the three PRs that each close one READY-too-early window merge cleanly together as well, not only pairwise with |


Why
Keep watch-pr from reporting ready while Actions workflows are starting, without letting an obsolete failed or cancelled execution block a successful replacement.
Summary
Execution identity uses workflow ID, event, head repository, branch and PR associations. Run number orders replacements; attempt number orders retries. The Code Review Gate owner-approval exception remains intact.
Scope
Manual dispatches, unknown trigger contexts and multiple PR associations remain conservative. GitHub's PR associations do not identify the triggering PR. This does not provide an atomic GitHub snapshot or change the installed Pi bundle.
Evidence
READY(0). The CLI now waits and reaches the fixture deadline withTIMEOUT(5).BLOCKER(4) for cancelled or failed run 100 plus successful replacement 101 with passing current checks. Both now returnREADY(0). The CLI matrix also preserves current failures, queued replacements, independent contexts and retryable pagination errors.Merge Danger
Door: Two-way. Revert the watcher changes to restore prior behavior.
Blast Radius: Watch-pr readiness. Incomplete, unstable or capped Actions observations now become retryable query errors rather than false readiness. Filtered totals of at least 1,000 fail closed because GitHub caps those searches.