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

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 3 times, most recently from 70434be to 4da0660 Compare July 14, 2025 13:26
@steve-aom-elliott steve-aom-elliott force-pushed the steve-fix-recognition-of-latest-release-latest-integration-for-upgrading branch from 4da0660 to 5144f4b Compare July 17, 2025 20:30
@timtebeek timtebeek requested a review from sambsnyd July 17, 2025 20:50
…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 5144f4b to 79573b7 Compare July 18, 2025 12:59
@sambsnyd sambsnyd merged commit 45c4389 into main Jul 22, 2025
2 checks passed
@sambsnyd sambsnyd deleted the steve-fix-recognition-of-latest-release-latest-integration-for-upgrading branch July 22, 2025 16:41
@github-project-automation github-project-automation bot moved this from Ready to Review to Done in OpenRewrite Jul 22, 2025
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
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants