fix: ignore check suites superseded by a later run - #1192
Open
zeexzeex wants to merge 1 commit into
Open
Conversation
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 <ujubongbong@gmail.com>
zeexzeex
force-pushed
the
fix/1151-superseded-check-suites
branch
from
September 14, 2026 07:16
fc73450 to
1dd3e16
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 highestrunNumberper workflow before the existing loop runs. The loop body is unchanged.The key includes
eventbecause runs triggered by different events are independent rather than superseding, so apushrun should not hide apull_requestrun of the same workflow.Suites without
workflowRuncannot 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
CANCELLEDsuite paired with a newerSUCCESSone 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 theeventpart of the key rather than the fix itself.Refs: #1152
Refs: #1163
Fixes: #1151