Skip to content

Retry Gradle builds once in CI - #69750

Merged
wtgodbe merged 1 commit into
dotnet:mainfrom
mmitche:copilot/gradle-maven-retry
Oct 9, 2026
Merged

wtgodbe merged 1 commit into
dotnet:mainfrom
mmitche:copilot/gradle-maven-retry

Conversation

@mmitche

@mmitche mmitche commented Oct 9, 2026

Copy link
Copy Markdown
Member

Summary

  • retry Java/Gradle builds once in CI using Arcade's ExecWithRetries task
  • preserve the existing single-attempt behavior for local builds
  • treat the process exit code as authoritative so stderr from a recovered attempt does not leave an MSBuild error

This mitigates transient dependency download failures such as truncated Maven responses while keeping the retry policy small and unconditional.

Validation

  • verified a successful command runs once
  • verified a failing command runs twice and then fails MSBuild
  • validated the targets file as XML
  • ran git diff --check

Use Arcade's ExecWithRetries task for Java builds in CI while preserving the existing single-attempt behavior for local builds.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 31880977-2e76-4303-9237-5e03bd9f9c9d
Copilot AI balanced review requested due to automatic review settings October 9, 2026 16:41
@mmitche
mmitche requested review from a team and wtgodbe as code owners October 9, 2026 16:41
@github-actions github-actions Bot added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Oct 9, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Hey @dotnet/aspnet-build, looks like this PR is something you want to take a look at.

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.

🟢 Approval recommended

The retry configuration matches the pinned Arcade task contract and preserves existing local behavior.

0 open findings

What changed in this PR

Adds a single retry for Gradle builds in CI while preserving local build behavior.

Changes:

  • Uses Arcade’s ExecWithRetries with two attempts in CI.
  • Keeps local builds on the existing single-attempt Exec path.
  • Prevents recovered stderr from failing MSBuild.
File Description
eng/​targets/​Java.Common.targets Splits Gradle execution into local and retry-enabled CI paths.

🧠 Review effort: Balanced


💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@Youssef1313 Youssef1313 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this trying to solve the same issue as #69365 ?

@mmitche

mmitche commented Oct 9, 2026

Copy link
Copy Markdown
Member Author

Is this trying to solve the same issue as #69365 ?

Nope...the wrapper retry only works for the distribution download.

@wtgodbe
wtgodbe merged commit 5c7435f into dotnet:main Oct 9, 2026
30 checks passed
@wtgodbe
wtgodbe temporarily deployed to copilot-pat-pool October 9, 2026 20:07 — with GitHub Actions Inactive
@wtgodbe
wtgodbe temporarily deployed to copilot-pat-pool October 9, 2026 20:07 — with GitHub Actions Inactive
@wtgodbe
wtgodbe temporarily deployed to copilot-pat-pool October 9, 2026 20:08 — with GitHub Actions Inactive
@wtgodbe
wtgodbe temporarily deployed to copilot-pat-pool October 9, 2026 20:09 — with GitHub Actions Inactive
@wtgodbe
wtgodbe temporarily deployed to copilot-pat-pool October 9, 2026 20:10 — with GitHub Actions Inactive
@wtgodbe
wtgodbe temporarily deployed to copilot-pat-pool October 9, 2026 20:11 — with GitHub Actions Inactive
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

✅ No documentation PR was created.

Confidence that documentation is needed: 2%

No docs needed: the PR only adds a CI retry for Gradle builds in an engineering targets file.

Documentation surfaces considered

  • Conceptual article: Not required — CI/build infrastructure only; no user-visible behavior.
  • Migration guidance: Not required — No upgrade action for users.
  • Breaking change: Not required — No compatibility impact; only eng/targets/Java.Common.targets changed.

This branch was previously deployed

1 inactive deployment
copilot-pat-pool — 2608f596 Deployed Oct 9, 2026 by wtgodbe via conclusion #26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants