Support Temurin JEP 322 patch versions like 26.0.2.1+1 - #1279
Merged
Merged
Conversation
Accept 4-part versions with build metadata (X.Y.Z.P+B -> X.Y.Z+P.B) and match exact Temurin requests against OpenJDK-derived version keys, since the Adoptium API semver folds the patch into the build number (26.0.2+101) and adds LTS metadata (25.0.4+7.0.LTS). 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 implementation is consistent across source and generated bundles and includes focused regression coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Adds support for Temurin JEP 322 respin versions while preserving existing range resolution behavior.
Changes:
- Normalizes multi-field Java versions with build metadata.
- Matches exact Temurin requests against reconstructed OpenJDK versions.
- Adds documentation, tests, and rebuilt runtime bundles.
| File | Description |
|---|---|
src/util.ts |
Adds shared Java-version normalization. |
src/distributions/temurin/models.ts |
Models the optional patch field. |
src/distributions/temurin/installer.ts |
Resolves exact respin and LTS versions. |
src/distributions/package-types.ts |
Normalizes versions for jmods validation. |
src/distributions/base-installer.ts |
Applies shared normalization to inputs. |
README.md |
Documents respin syntax. |
dist/setup/index.js |
Rebuilds setup utility bundle. |
dist/setup/463.index.js |
Rebuilds Temurin installer bundle. |
dist/setup/242.index.js |
Rebuilds base installer bundle. |
dist/cleanup/index.js |
Rebuilds cleanup bundle. |
__tests__/util.test.ts |
Tests normalization cases. |
__tests__/distributors/temurin-installer.test.ts |
Tests respin and LTS resolution. |
__tests__/distributors/distribution-factory.test.ts |
Tests jmods compatibility checks. |
__tests__/distributors/base-installer.test.ts |
Tests input normalization. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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:
Temurin now publishes respins with a JEP 322 patch field (for example
26.0.2.1+1and25.0.4.1+1). In v6,java-version: 26.0.2.1+1fails with "is not valid SemVer notation", and the version could not have resolved anyway:normalizeVersiononly converted 4+ field versions without build metadata, soX.Y.Z.P+Bwas rejected.version_data.semverencodes the patch into the build number (26.0.2.1+1->26.0.2+101) and appends metadata for LTS releases (25.0.4+7->25.0.4+7.0.LTS), so an exact OpenJDK-style request never matches.Changes:
normalizeJavaVersionToSemverhelper insrc/util.tsthat mapsX.Y.Z.P[+B]toX.Y.Z+P[.B](consistent withconvertVersionToSemverand the Liberica compound-build handling from Preserve compound Liberica build versions from .sdkmanrc #1268). Used byJavaBase.normalizeVersionand the Temurinjdk+jmodsversion check inpackage-types.ts.resolvePackage: for exact (build-qualified) requests, also match against a key derived from the OpenJDK fields (major.minor.security+[patch.]build). The APIsemveris still used as the resolved version, for sorting, and for tool-cache paths, so ranges (25,26.0.2,x) behave as before and pick the newest respin.25.0.4+7now resolve remotely (previously only a tool-cache hit worked).26.0.2.1+1to the supported version syntax table.dist/.Known limitation: an exact
26.0.2.1without build metadata still won't match a respin;26.0.2.1+1or26.0.2work.Verified locally against the live Adoptium API by running
dist/setup/index.js:26.0.2.1+1->26.0.2+101,25.0.4.1+1->25.0.4+101.0.LTS,25.0.4+7->25.0.4+7.0.LTS, all downloaded successfully.Related issue:
Fixes: #1270
Check list:
npm run checklocally (format, lint, build, test) and all checks pass. (45 suites, 1512 tests passed)