fix(manager/gradle): add --refresh-dependencies when writing verification metadata - #45228
Open
derekslenk wants to merge 1 commit into
Open
fix(manager/gradle): add --refresh-dependencies when writing verification metadata#45228derekslenk wants to merge 1 commit into
derekslenk wants to merge 1 commit into
Conversation
…tion metadata With a warm dependency metadata cache, Gradle skips the parent POM / platform BOM hierarchy walk and omits their entries from the written verification-metadata.xml (gradle/gradle#19228, gradle/gradle#20194). Renovate warms that cache systematically: processing multiple repositories through one GRADLE_USER_HOME means every repository after the first regenerates against a warm cache, so the written file misses exactly the parent-POM/BOM .pom/.module entries and repository CI then fails dependency verification. Measured against a real-world incomplete file (five known-missing entries, every arm reset to the same baseline, warm arms sharing one snapshotted GRADLE_USER_HOME): - warm cache, current command: added 0 of 5 - warm cache, current command + --refresh-dependencies: added 5 of 5 - cold cache, current command: added 5 of 5 - warm cache, 'build' instead of 'dependencies': added 0 of 5 The last arm shows the task choice is not the variable (the writer resolves all resolvable configurations regardless) — cache state is, which is why swapping task names (renovatebot#29602 context) cannot fix this class.
This comment was marked as duplicate.
This comment was marked as duplicate.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Appends
--refresh-dependenciesto the command built bybuildUpdateVerificationMetadataCmd.Why: with a warm dependency metadata cache, Gradle skips the parent-POM / platform-BOM hierarchy walk and omits their entries from the written
verification-metadata.xml(gradle/gradle#19228, gradle/gradle#20194 — both open for years). Renovate warms that cache systematically: multiple repositories processed through oneGRADLE_USER_HOMEmeans every repository after the first regenerates against a warm cache. The written file then reliably misses exactly the parent-POM/BOM.pom/.moduleentries, and the repository's own CI fails dependency verification on the update PR. The fingerprint is always a recorded.modulewith a missing.pom, never jars.Measured with a controlled comparison against a real-world incomplete file (five known-missing entries; every arm reset to the same committed baseline and asserted to start at 0-of-5; warm arms restored from one snapshotted
GRADLE_USER_HOME; details in this gradle/gradle#19228 comment):--refresh-dependenciesbuildinstead ofdependenciesThe last arm matters for this repo's history: the task token was previously changed to
dependencies(#29602, from discussion #29259) — but the writer resolves all resolvable configurations regardless of the named task, so task choice cannot fix or cause this class. Cache state is the whole variable, and only--refresh-dependenciesaddresses it.Cost: module descriptors are re-fetched on each regeneration rather than served from cache. In our production use (15 repositories, 4 runs/day, several weeks of PR churn including a 13-branch rebase sweep) the write step runs in 11–22 seconds and we observed no registry rate limiting; the correctness failure it prevents has repeatedly cost human debugging sessions, because an incomplete-but-plausible file fails CI in a way that looks like a repo problem rather than a generation problem.
Context
AI assistance disclosure
Did you use AI tools to create any part of this pull request?
Code change, test updates, and this PR text were drafted with Claude (Fable 5) under my direction; I reviewed the change and we validated it in production across a 15-repository fleet before proposing it here.
Use of AI in replying to PR comments
Who answers review comments:
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via:
The public repository: the validating fleet is private (15 Gradle repositories, self-hosted Renovate 43.288.0); the measurement methodology and results are public in the gradle/gradle#19228 comment linked above. The equivalent preset-level workaround (
postUpgradeTasksre-running the same command with the flag) has been in production there since 2026-08-11 with zero recurrences.