rewrite icon indicating copy to clipboard operation
rewrite copied to clipboard

Gradle - Add tests for update in dependencyManagement

Open ThomasVitale opened this issue 9 months ago • 4 comments

What's changed?

  • Introduced tests for demonstrating the issue.

What's your motivation?

  • https://github.com/openrewrite/rewrite/issues/5300

Anything in particular you'd like reviewers to focus on?

  • How to implement the new use case?

Anyone you would like to review specifically?

@timtebeek

Have you considered any alternatives or workarounds?

Yes, workaround considered and explained in https://github.com/openrewrite/rewrite/issues/5300, but not feasible in certain scenarios.

Checklist

  • [X] I've added unit tests to cover both positive and negative cases
  • [ ] I've read and applied the recipe conventions and best practices
  • [X] I've used the IntelliJ IDEA auto-formatter on affected files

ThomasVitale avatar Apr 15 '25 20:04 ThomasVitale

Thanks for the start here @ThomasVitale ! I'm going to ask if @shanman190 has some guiding hints here for whether we want to make these changes as part of this recipe, and if that should be in a separate visitor perhaps. He's our friendly community authority on all things Gradle. 🧙🏻‍♂️

timtebeek avatar Apr 15 '25 20:04 timtebeek

Perfect, thank you so much!

ThomasVitale avatar Apr 15 '25 20:04 ThomasVitale

@shanman190 thanks so much for the inputs. I'll look a bit deeper into the JavaIsoVisitor and consider support for both the Groovy DSL and Kotlin DSL. I hope I'll get a draft PR ready soon.

ThomasVitale avatar Apr 19 '25 20:04 ThomasVitale

I have pushed a draft PR that addresses this one. The implementation is still quite dirty, but I feel this Trait could easily be added to other recipes like UpgradeDependencyVersion etc to make them also bump the depdencyManagement section.

Jenson3210 avatar Jun 13 '25 23:06 Jenson3210