Skip to content

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

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

mernst merged 3 commits into
plume-lib:mainfrom
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.

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.
@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 26 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 b3015ff and 9b61cbd.

Files selected for processing: 1

  • .github/workflows/gradle.yml

No actionable comments were generated in the recent review.

Walkthrough

The change adds a script that runs Gradle and retries once after 60 seconds when the initial run fails with a recognized dependency-resolution error. The retry uses --refresh-dependencies and the original arguments. The Spotless and build workflow steps now use the script. The build job sets fail-fast: false.

Change: Other

Merge Risk: Minimal · previous review b3015

This adds a one-time retry for transient dependency-resolution failures in CI and leaves other failures unchanged. It should be low risk to merge, and a revert would restore the previous behavior.

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 39263be and b3015ff.

Files selected for processing: 2

  • .github/gradlew-retry.sh
  • .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.

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 8e48f38 into plume-lib:main Nov 19, 2026
6 of 10 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