Skip to content

Conversation

timtebeek
Copy link
Member

What's your motivation?

Right now we pick an incorrect distribution for Zulu upgrades to Java 17.
There's are the versions that are available:

17.0.13.crac-zulu
17.0.14-zulu
17.0.14.crac-zulu
17.0.14.fx-zulu
17.0.15-zulu
17.0.15.crac-zulu
17.0.15.fx-zulu

We ought to pick 17.0.15-zulu as the highest version number, with a matching (non fx/crac) distribution.

In practice, we pick 17.0.13.crac-zulu as the first match here:

for (String candidate : readSdkmanJavaCandidates()) {
if (candidate.startsWith(ver) && candidate.endsWith(dist)) {
return plainText.withText(matcher.replaceFirst("java=" + candidate));

@timtebeek timtebeek added the bug Something isn't working label Jun 4, 2025
@github-project-automation github-project-automation bot moved this to In Progress in OpenRewrite Jun 4, 2025
@steve-aom-elliott steve-aom-elliott requested review from steve-aom-elliott and removed request for steve-aom-elliott June 4, 2025 17:40
@steve-aom-elliott steve-aom-elliott self-assigned this Jun 4, 2025
timtebeek and others added 2 commits June 4, 2025 19:47
…ng situation where `.crac-zulu` version could be chosen rather than `-zulu` when coming from `-zulu`.
@timtebeek timtebeek marked this pull request as ready for review June 4, 2025 20:56
@timtebeek timtebeek moved this from In Progress to Ready to Review in OpenRewrite Jun 4, 2025
Copy link
Member Author

@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.

Thanks a lot for the help here! Nice how you've figured out LatestRelease.

We might separately find that new JDK releases will break the tests in the future, but we can figure that out by then; possibly by adding a static src/test/resources/ variant of of sdkman versions.

@timtebeek timtebeek merged commit 61019fb into main Jun 4, 2025
2 checks passed
@timtebeek timtebeek deleted the pick-better-sdkmanrc-version branch June 4, 2025 21:51
@github-project-automation github-project-automation bot moved this from Ready to Review to Done in OpenRewrite Jun 4, 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 test provided
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants