Skip to content

Retry a Gradle run that fails to resolve a dependency - #571

Merged
mernst merged 4 commits into
plume-lib:masterfrom
mernst:ci-refresh-dependencies
Nov 19, 2026
Merged

mernst merged 4 commits into
plume-lib:masterfrom
mernst:ci-refresh-dependencies

Conversation

@mernst

@mernst mernst commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Land after plume-lib/plume-scripts#153.

Maven Central sometimes transiently returns 404 for an artifact that it holds, which fails CI. Examples (each artifact had been on Maven Central for weeks or months):

This PR:

  • runs the ./gradlew commands in gradle.yml (but not the gradle-spotless hook that the prek workflow runs) through gradlew-retry from plume-scripts, which CI clones. If Gradle could not resolve a dependency, gradlew-retry runs it again, up to 2 more times, after 60 and then 180 seconds. A 404 for an artifact that does not exist, and other failures such as a compilation error or a test failure, are not retried and incur no delay.
  • sets fail-fast: false, so that one failing matrix job does not cancel the others.

CI fails until plume-lib/plume-scripts#153 lands, because gradlew-retry does not exist in plume-scripts until then.

The same change is being made in all plume-lib repositories that build with Gradle.

This PR also removes the "Warm up Gradle cache" step, which gradlew-retry subsumes. The warm-up step ran only spotlessCheck, so it did not protect the compile classpath.

When a repository transiently returns 404, Gradle caches the missing-module
result, so the retry in the "Warm up Gradle cache" step reused it and
`./gradlew build` failed.  The retry now passes --refresh-dependencies.  The
warm-up output is no longer discarded, and one failing matrix job no longer
cancels the others.
@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Explain Change →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 34 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between fc1afdc and b871023.

Files selected for processing: 1

  • .github/workflows/gradle.yml

No actionable comments were generated in the recent review.

Walkthrough

The Gradle matrix now allows remaining jobs to run after a job fails. The Spotless warm-up quietly runs spotlessCheck. If the check fails, the workflow waits 60 seconds and retries with dependency refresh. The warm-up step succeeds regardless of the retry result.

Change: Bug fix

Merge Risk: Minimal · previous review fc1af

This changes only CI workflow behavior. It makes the dependency warm-up more resilient to transient repository 404s and lets all matrix jobs finish. No product or production impact is expected, and it is low risk to merge.

Pre-merge checks: Passed 2

Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 1728a46 and fc1afdc.

Files selected for processing: 1

  • .github/workflows/gradle.yml

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Maven Central sometimes transiently returns 404 for an artifact that it
holds.  The new script .github/gradlew-retry.sh runs ./gradlew and, if
Gradle could not resolve a dependency, waits and runs it once more with
--refresh-dependencies (Gradle caches the absence of a module, so a plain
retry fails the same way).  Other failures are not retried.

Also set fail-fast: false, so that one failing matrix job does not cancel
the others.
@mernst mernst changed the title Make the CI warm-up retry re-query the repositories Retry a Gradle run that fails to resolve a dependency Nov 19, 2026
Gradle does not cache a 404 across runs, so --refresh-dependencies is
unnecessary; drop it.  A transient 404 from Maven Central can last a
minute or more, so retry up to twice, after 60 and then 180 seconds.  To
avoid pointless retries when a dependency does not exist, retry a 404 only
if the artifact exists at the URL that Gradle reported or on a mirror of
Maven Central.
…itory

CI clones plume-lib/plume-scripts and runs the Gradle commands through its
gradlew-retry script, so that the script is not duplicated in every
plume-lib repository.
@mernst
mernst merged commit 6d43300 into plume-lib:master Nov 19, 2026
5 of 8 checks passed
@mernst
mernst deleted the ci-refresh-dependencies branch November 19, 2026 21:22
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