PREQ-6264: Add Gradle wrapper download retries in config-gradle#288
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a CI-time hardening step to the config-gradle composite action to reduce flakiness when downloading the Gradle distribution via the wrapper, without requiring per-repo wrapper changes.
Changes:
- Introduces a new “Configure Gradle wrapper download resilience” step that edits
gradle/wrapper/gradle-wrapper.propertiesat runtime. - Ensures
networkTimeout=60000,retries=3, andretryBackOffMs=1000are present/updated when a wrapper properties file exists.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Code Review ✅ Approved 3 resolved / 3 findingsAdds Gradle wrapper download resilience through increased timeouts and retries, resolving the potential for file corruption by ensuring a trailing newline is present before appending properties. ✅ 3 resolved✅ Edge Case: Appending wrapper prop without trailing newline corrupts file
✅ Bug: retries/retryBackOffMs are not recognized gradle-wrapper.properties keys
✅ Edge Case: Mutating wrapper props before cache-key step silently shifts the cache key
OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |



Summary
config-gradlethat setsnetworkTimeout=60000,retries=3, andretryBackOffMs=1000ingradle/wrapper/gradle-wrapper.propertiesat CI runtimeservices.gradle.orgtimeouts onsonar-scanner-engine) without requiring per-repo wrapper property changesJira: https://sonarsource.atlassian.net/browse/PREQ-6264
Related: Julien Henry reported Gradle download timeout in https://github.com/SonarSource/sonar-scanner-engine/actions/runs/27123611072/job/80050116778 — wrapper had
retries=0andnetworkTimeout=10000.Test plan
@v1, verifysonar-scanner-engineGradle build no longer flakes on distribution download