Refactor Gradle recipes to use model mapping APIs - #8339
Conversation
|
Build passes locally, any idea what went wrong? Nothing useful is logged. Also, those tests took half of the time of full gradle test suite, it's too much i think edit: ChangeDependencyConcurrencyTest |
|
What copilot said about failing ChangeDependencyConcurrencyTest: The test combined mutually incompatible fixture settings.
!StringUtils.isBlank(gav.getVersion()) || Boolean.TRUE.equals(overrideManagedVersion)However, the test set Setting a requested version would make the latch fire, but would no longer model the versionless Gradle declaration. It also triggers Gradle dependency resolution, requiring the corresponding POM to be stubbed. The correct fixture keeps the dependency versionless, enables |
|
Thanks for the continued work here @KamilPatora ; I'm falling further and further behind in reviews, especially with the increased productivity producing changes, which has not kept pace with our ability to review, polish and merge. I'll hope to get to this soon, or convince colleagues to pitch in as well. |

What's changed?
Refactored Gradle dependency recipes to update the Gradle model through
GradleProject.mapConfiguration(s)andGradleDependencyConfiguration.mapDependencies().Updated
ChangeDependency,RemoveDependency,ChangeDependencyGroupId,ChangeDependencyArtifactId,ChangeDependencyClassifier, andChangeManagedDependency.What's your motivation?
Manual model updates could leave resolved or transitive dependency data stale after a recipe changed or removed a dependency. Using the existing mapping APIs centralizes model invalidation and provides consistent configuration inheritance behavior
Anything in particular you'd like reviewers to focus on?
selected mapping API is appropriate for each recipe, especially configuration inheritance and resolved dependency graph handling.
Anyone you would like to review specifically?
No specific reviewers.
Have you considered any alternatives or workarounds?
Continuing to mutate requested and resolved dependencies manually was considered, but it duplicates synchronization logic and can leave stale model data. Updating only source files would also leave the attached
GradleProjectinconsistent during subsequent recipe execution.Any additional context
Checklist