Skip to content

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

Merged
guicaulada merged 3 commits intografana:mainfrom
julienduchesne:fix/action-retries-race-condition
Feb 11, 2026
Merged

fix: don't exit immediately when no concluded workflow runs to retry#465
guicaulada merged 3 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
@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

julienduchesne and others added 2 commits February 9, 2026 22:27
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 8f5282b to 50cd304 Compare February 10, 2026 03:27
@julienduchesne julienduchesne marked this pull request as ready for review February 10, 2026 03:30
Copy link
Member

@guicaulada guicaulada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good fix! Thank you for working on this.

Got some minor nitpicks that aren't that important.

@guicaulada guicaulada added this pull request to the merge queue Feb 11, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 11, 2026
@guicaulada
Copy link
Member

I'm gonna fix that linter right now.

@guicaulada guicaulada added this pull request to the merge queue Feb 11, 2026
Merged via the queue into grafana:main with commit 13eabae Feb 11, 2026
13 checks passed
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.

2 participants