Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: ignore check suites superseded by a later run - #1192

Open
zeexzeex wants to merge 1 commit into
nodejs:mainfrom
zeexzeex:fix/1151-superseded-check-suites
Open

fix: ignore check suites superseded by a later run#1192
zeexzeex wants to merge 1 commit into
nodejs:mainfrom
zeexzeex:fix/1151-superseded-check-suites

Conversation

@zeexzeex

Copy link
Copy Markdown

What

A commit keeps every check suite attached to it, so force-pushing away from a SHA and back leaves the cancelled suites from the first run alongside the suites from the new one. checkGitHubCI() treats any non-successful suite as a current failure, so a superseded cancelled run blocks the commit queue even after the latest run succeeded.

Stale suites never expire and re-running CI only adds more, so such a pull request can only be landed manually. On the example from the issue, nodejs/node#64803, one failed and fifteen cancelled jobs were all from superseded runs while the latest run was green.

How

Query workflowRun { event runNumber workflow { id } } for each suite and keep only the highest runNumber per workflow before the existing loop runs. The loop body is unchanged.

The key includes event because runs triggered by different events are independent rather than superseding, so a push run should not hide a pull_request run of the same workflow.

Suites without workflowRun cannot be compared against one another and pass through as they were. Every existing fixture is in that state, so none of them needed run metadata added.

Tests

Two tests cover an old CANCELLED suite paired with a newer SUCCESS one on the same workflow and event, and two suites whose events differ. Reverting the fix makes only the first fail. The second passes either way and guards the event part of the key rather than the fix itself.

Refs: #1152
Refs: #1163
Fixes: #1151

A commit keeps every check suite ever attached to it, so a branch that
is force-pushed away from a SHA and back again ends up with one suite
per run. checkGitHubCI() treated every non-successful suite as a current
failure, so a cancelled run that a later run had already replaced kept
the commit queue from accepting the pull request.

Select only the latest run of each workflow before inspecting suites.
Runs triggered by different events do not supersede one another, so the
event is part of the key. Suites without run metadata cannot be compared
and are kept as they were.

Fixes: nodejs#1151
Signed-off-by: Avocado <[email protected]>
@zeexzeex
zeexzeex force-pushed the fix/1151-superseded-check-suites branch from fc73450 to 1dd3e16 Compare September 14, 2026 07:16
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.

pr_checker: ignore superseded GitHub Actions check suites when a head SHA is reused

1 participant