Skip to content

Changing what LatestRelease recognizes as the latest release or latest snapshot keyword versions by expanding it to include those from Ivy/Gradle #5720

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

steve-aom-elliott
Copy link
Contributor

What's changed?

  • Expanded LatestRelease to not only recognize LATEST and RELEASE from Maven, but also their equivalents from Ivy / Gradle (latest.integration and latest.release)

What's your motivation?

We were seeing UpgradeDependencyVersion for Gradle change latest.release to a specific version number rather than leaving it alone.

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

@steve-aom-elliott steve-aom-elliott self-assigned this Jul 4, 2025
@steve-aom-elliott steve-aom-elliott added bug Something isn't working test provided Already replicated with a unit test, using JUnit pioneer's ExpectedToFail gradle labels Jul 4, 2025
@github-project-automation github-project-automation bot moved this to In Progress in OpenRewrite Jul 4, 2025
@steve-aom-elliott steve-aom-elliott marked this pull request as ready for review July 4, 2025 20:44
@timtebeek timtebeek self-requested a review July 5, 2025 20:02
@timtebeek timtebeek moved this from In Progress to Ready to Review in OpenRewrite Jul 5, 2025
@Test
void retainLatestReleaseOrLatestIntegrationIfUsed() {
rewriteRun(
spec -> spec.recipe(new UpgradeDependencyVersion("org.projectlombok", "lombok", "1.18.*", null)),
Copy link
Member

Choose a reason for hiding this comment

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

Adding the context here that this is coming from in org.openrewrite.java.migrate.lombok.UpdateLombokToJava11.

Copy link
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.

This looks good to me already; I'm somewhat surprised we hadn't run up against this before. I'm going to chalk that up to only recently having added support for .kts files which our own projects use alongside latest.release.

Given the potential for impact I'm going to ask for a quick review from @jkschneider to resolve this customer issue.

@timtebeek timtebeek requested a review from jkschneider July 5, 2025 20:14
@steve-aom-elliott steve-aom-elliott force-pushed the steve-fix-recognition-of-latest-release-latest-integration-for-upgrading branch from e754744 to e860733 Compare July 7, 2025 19:30
…est snapshot keyword versions by expanding it to include those from Ivy/Gradle
@steve-aom-elliott steve-aom-elliott force-pushed the steve-fix-recognition-of-latest-release-latest-integration-for-upgrading branch from e860733 to 70434be Compare July 8, 2025 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working gradle test provided Already replicated with a unit test, using JUnit pioneer's ExpectedToFail
Projects
Status: Ready to Review
Development

Successfully merging this pull request may close these issues.

2 participants