Skip to content

fix: don't exit immediately when no concluded workflow runs to retry#465

Draft
julienduchesne wants to merge 2 commits intografana:mainfrom
julienduchesne:fix/action-retries-race-condition
Draft

fix: don't exit immediately when no concluded workflow runs to retry#465
julienduchesne wants to merge 2 commits intografana:mainfrom
julienduchesne:fix/action-retries-race-condition

Conversation

@julienduchesne
Copy link
Contributor

Summary

  • Fixes a race condition in action-retries where GetCIStatus (GraphQL statusCheckRollup) reports failure as soon as any individual job fails, but RerunFailedWorkflowsForCommit (REST ListRepositoryWorkflowRuns) only finds retryable runs once the workflow run has fully concluded. When one job fails while others are still running, the tool would find zero retryable runs and exit immediately with "CI failed with no GitHub Actions to retry".
  • Instead of exiting, the tool now continues polling so the next check cycle can retry once the workflow run has concluded.

Test plan

  • Updated existing test case for zero rerun count to expect continued waiting
  • Added TestPRCheckRetryWithInProgressWorkflow that exercises the exact scenario: first Check() call returns 0 reruns (workflow in progress), second call returns 1 rerun (workflow concluded)
  • Verified the new test fails with the old code and passes with the fix

Made with Cursor

@julienduchesne julienduchesne requested a review from a team as a code owner February 6, 2026 16:00
There is a race condition between GetCIStatus (GraphQL statusCheckRollup)
and RerunFailedWorkflowsForCommit (REST ListRepositoryWorkflowRuns).
The rollup reports failure as soon as any individual job fails, but the
workflow run only gets a "failure" conclusion once all jobs complete.
When one job fails while others are still running, the tool would find
no retryable runs and exit immediately.

Instead, continue polling so the next check cycle can retry once the
workflow run has concluded.

Co-authored-by: Cursor <cursoragent@cursor.com>
@julienduchesne julienduchesne force-pushed the fix/action-retries-race-condition branch from 8a34793 to f0991ac Compare February 6, 2026 16:08
@julienduchesne julienduchesne marked this pull request as draft February 6, 2026 16:35
@julienduchesne
Copy link
Contributor Author

Waiting on #461

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