Skip to content

Retry failed rolling CI builds once - #19751

Closed
Copilot wants to merge 1 commit into
mainfrom
copilot/rolling-ci-auto-retry
Closed

Copilot wants to merge 1 commit into
mainfrom
copilot/rolling-ci-auto-retry

Conversation

Copilot AI commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Description

Rolling CI builds on main are frequently red because the aggregate probability of at least one low-frequency test flake is high. This change gives the first failed attempt for the current main commit one automatic rerun of failed jobs.

The rolling retry is a separate job in the existing auto-rerun workflow, leaving the PR failure-analysis path unchanged. Before requesting the retry, it verifies that main still points at the failed run's commit so a stale retry cannot replace a newer pending build in the CI concurrency group. Only attempt 1 is eligible.

Red-main issue reporting is coordinated with the retry:

  • Main attempt 1 failures are not reported.
  • A failed attempt 2 reruns the dependent tracker and files or updates the issue.
  • A successful attempt 2 closes any existing issue.
  • A fallback reports attempt 1 if the external retry job does not complete successfully.
  • Release branch failures remain reportable on attempt 1.

Validation:

  • Parsed the changed workflow YAML and validated retry/reporting contracts.
  • Syntax-checked the extracted inline GitHub Script blocks with Node.js.
  • Exercised current-head retry, stale-head skip, and source-run fallback reporting with mocked GitHub APIs.
  • Added focused Infrastructure.Tests coverage for the workflow and issue-reporting contracts. The local test run was blocked because the configured Arcade SDK feed returned HTTP 403; PR CI will run these tests.

Fixes # (issue)

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

Created from a Microsoft Teams conversation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI requested a balanced review from Copilot and removed request for Copilot August 27, 2026 19:06
@github-actions
github-actions Bot requested a balanced review from Copilot September 8, 2026 21:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new retry contract test does not verify job-scoped eligibility, the retry API call, or the fallback dependency.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds one guarded retry for failed rolling main CI builds and coordinates red-main issue reporting with that retry.

Changes:

  • Retries failed jobs once when the failed commit is still current.
  • Defers or falls back to red-main issue reporting.
  • Updates workflow tests and CI documentation.
File summaries
File Description
.github/workflows/auto-rerun-transient-ci-failures.yml Adds rolling retry and reporting fallback jobs.
.github/workflows/ci.yml Defers first-attempt main failure reporting.
.github/workflows/report-ci-failure.js Updates reporter documentation.
tests/Infrastructure.Tests/WorkflowScripts/AutoRerunTransientCiFailuresTests.cs Adds retry workflow contract coverage.
tests/Infrastructure.Tests/WorkflowScripts/ExtensionReleaseFastPathWorkflowTests.cs Verifies deferred tracker behavior.
docs/ci/auto-rerun-transient-ci-failures.md Documents rolling retries.
docs/ci/auto-rerun-outerloop-failures.md Clarifies workflow responsibilities.
docs/ci/ci-failure-issues.md Documents retry/reporting coordination.
Review details
  • Files reviewed: 8/8 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment on lines +949 to +953
Assert.Contains("rerun-rolling-ci-failure:", workflowText);
Assert.Contains("github.event.workflow_run.event == 'push'", workflowText);
Assert.Contains("github.event.workflow_run.head_branch == 'main'", workflowText);
Assert.Contains("github.event.workflow_run.conclusion == 'failure'", workflowText);
Assert.Contains("github.event.workflow_run.run_attempt == 1", workflowText);
@joperezr

Copy link
Copy Markdown
Member

fyi Ankit Jain (@radical) since you said you would take a look at this. This is the PR that we started last week when we prompted copilot into addressing this.

@radical

Copy link
Copy Markdown
Member

[automated] Closing in favor of #20345, which covers current-main failed-job retries and defers failure analysis until the final failed attempt.

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.

5 participants