Repository navigation
Prefer Zulu 4-segment hotfix builds when resolving version ranges - #1278
Merged
Merged
Conversation
Azul reports hotfix releases like 25.0.4.1 as java_version=[25,0,4,1] with openjdk_build_number=1 (SDKMAN '25.0.4+1.1'). Sorting candidates via semver.compareBuild ranked 25.0.4+7 above 25.0.4+1.1, so ranges such as '25' resolved to the older build. Compare java_version, build number and distro_version numerically instead. Fixes: #1275 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused implementation matches the documented ordering requirements and includes regression coverage for exact and ranged versions.
Review effort: Balanced
Findings: None
What changed in this PR
Updates Zulu version resolution so range requests prefer newer four-segment hotfix builds.
Changes:
- Sorts candidates numerically by Java version, build number, then distro version.
- Adds coverage for exact and ranged hotfix resolution.
- Rebuilds the runtime bundle.
| File | Description |
|---|---|
src/distributions/zulu/installer.ts |
Implements numeric candidate ordering. |
dist/setup/978.index.js |
Updates the generated runtime bundle. |
__tests__/util.test.ts |
Covers SDKMAN Zulu version parsing. |
__tests__/distributors/zulu-installer.test.ts |
Tests hotfix selection behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
1 task
gregor-dietrich
pushed a commit
to gregor-dietrich/Midas
that referenced
this pull request
Oct 24, 2026
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [actions/setup-java](https://github.com/actions/setup-java) | action | minor | `v6.0.1` → `v6.1.0` | --- ### Release Notes <details> <summary>actions/setup-java</summary> ### [`v6.1.0`](https://github.com/actions/setup-java/releases/tag/v6.1.0) [Compare Source](actions/setup-java@v6.0.1...v6.1.0) ##### What's Changed - Preserve compound Liberica build versions from .sdkmanrc by [@​brunoborges](https://github.com/brunoborges) with [@​Copilot](https://github.com/Copilot) in [#​1268](actions/setup-java#1268) - Support Temurin on Linux RISC-V by [@​yawkat](https://github.com/yawkat) in [#​1269](actions/setup-java#1269) - Stop GPG agent before removing signature-verification home by [@​brunoborges](https://github.com/brunoborges) with [@​Copilot](https://github.com/Copilot) in [#​1273](actions/setup-java#1273) - Prefer Zulu 4-segment hotfix builds when resolving version ranges by [@​brunoborges](https://github.com/brunoborges) in [#​1278](actions/setup-java#1278) - Support Temurin JEP 322 patch versions like 26.0.2.1+1 by [@​brunoborges](https://github.com/brunoborges) in [#​1279](actions/setup-java#1279) - chore(deps): bump undici from 6.28.0 to 6.29.0 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​1274](actions/setup-java#1274) - chore(deps): bump the monthly-npm-updates group with 13 updates by [@​dependabot](https://github.com/dependabot)\[bot] in [#​1276](actions/setup-java#1276) - feat: support Maven server credential origins by [@​YunaBraska](https://github.com/YunaBraska) in [#​1282](actions/setup-java#1282) - Support Maven plugin repositories in generated settings.xml by [@​brunoborges](https://github.com/brunoborges) in [#​1286](actions/setup-java#1286) ##### New Contributors - [@​yawkat](https://github.com/yawkat) made their first contribution in [#​1269](actions/setup-java#1269) - [@​YunaBraska](https://github.com/YunaBraska) made their first contribution in [#​1282](actions/setup-java#1282) **Full Changelog**: <actions/setup-java@v6.0.1...v6.1.0> </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xNjUuMSIsInVwZGF0ZWRJblZlciI6IjQ0LjE2NS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Reviewed-on: https://git.vptr.de/gregor/midas2/pulls/113 Reviewed-by: gregor <1+gregor@noreply.localhost> Co-authored-by: Renovate Bot <renovate@vptr.de>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Azul publishes out-of-band hotfix builds with a 4-segment
java_version. For example,zulu25.36.205-ca-jdk25.0.4.1hasjava_version=[25,0,4,1]andopenjdk_build_number=1. SDKMAN calls this build25.0.4+1.1.Since the v6 Azul Metadata API migration, an exact
25.0.4+1.1request (for example from.sdkmanrcjava=25.0.4+1.1-zulu) already resolves. The failure in the issue came from a pinned pre-v6 commit that dropped the build number.There was still a bug with version ranges. Candidates were sorted with
semver.compareBuild, which compares the text after+and ranks25.0.4+7above25.0.4+1.1. As a result,25or25.0.4resolved to the older GA build instead of the newer 25.0.4.1 hotfix.This PR sorts Zulu candidates numerically by:
java_version(a missing segment counts as 0)openjdk_build_numberdistro_version, which stays the tie-breakerThe version strings themselves are unchanged, so exact matching and toolcache folder names behave the same.
Toolcache lookup of already-cached versions may have a similar ordering issue. It is not addressed here.
Related issue:
Fixes: #1275
Check list:
npm run checklocally (format, lint, build, test) and all checks pass.__tests__/distributors/zulu-installer.test.tsand__tests__/util.test.tspassed (284 tests).npm run buildpassed. ESLint on the changed source and Zulu test file was clean.