Skip to content

Expand UpgradePluginVersion to support the kotlin plugin#6570

Merged
Laurens-W merged 4 commits intomainfrom
expand-upgrade-plugin-version
Jan 22, 2026
Merged

Expand UpgradePluginVersion to support the kotlin plugin#6570
Laurens-W merged 4 commits intomainfrom
expand-upgrade-plugin-version

Conversation

@Laurens-W
Copy link
Copy Markdown
Contributor

What's changed?

The recipe no longer allows downgrading the version when it's defined as a variable (similar to visitEntry)
The recipe now works to upgrade the Kotlin plugin version

What's your motivation?

Working with Kotlin I ran into these two

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

Matching by simple name is generally discouraged but with a lack of type information I'm not sure how else to approach

Any additional context

Unfortunately the select does not have a methodType so MethodMatcher won't work here
image

Checklist

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

Fix bug where `visitVariable` allowed the version to be downgraded
@Laurens-W Laurens-W self-assigned this Jan 20, 2026
@Laurens-W Laurens-W added bug Something isn't working enhancement New feature or request labels Jan 20, 2026
@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite Jan 20, 2026
…gradePluginVersion.java

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@Laurens-W Laurens-W marked this pull request as ready for review January 20, 2026 15:08
Copy link
Copy Markdown
Contributor

@Jenson3210 Jenson3210 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the code here made me realize we have a Trait GradlePlugin which we might be able to use here (similar to GradleDependency).
If we want to do that now or not, I honestly don't know without looking deeper into the existing Trait.

Copy link
Copy Markdown
Member

@timtebeek timtebeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good thanks! Ok to merge now with the understanding that there's a parallel PR, after which we can separately look to switch to the GradlePlugin trait.

@github-project-automation github-project-automation Bot moved this from In Progress to Ready to Review in OpenRewrite Jan 22, 2026
@timtebeek timtebeek changed the title Expand UpgradePluginVersion Expand UpgradePluginVersion to support the kotlin plugin Jan 22, 2026
@Laurens-W Laurens-W merged commit 934b45e into main Jan 22, 2026
2 checks passed
@Laurens-W Laurens-W deleted the expand-upgrade-plugin-version branch January 22, 2026 11:22
@github-project-automation github-project-automation Bot moved this from Ready to Review to Done in OpenRewrite Jan 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request gradle kotlin

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants