Accept Temurin four field versions with build metadata - #1271
Hashim1999164 wants to merge 3 commits into
Conversation
normalizeVersion only converted pure four field versions like 18.0.1.1, so Temurin strings such as 26.0.2.1+1 failed the SemVer check. Fold the extra fields into build metadata and keep any existing +build suffix.
|
This might be over engineering, but according to JEP322 there is no limit on how many numbers there can be in a version, not sure how much work it would be to just allow any arbitrary number of numbers. |
|
@johnoliver @Hashim1999164 I wonder if we should allow major version and full version only. Example: Thoughts? |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Temurin validation and candidate matching do not consistently normalize four-field versions with build metadata.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
What changed in this PR
Adds support for Temurin four-field versions with build metadata, such as 26.0.2.1+1.
Changes:
- Extends SemVer conversion and normalization.
- Updates bundled setup and cleanup artifacts.
- Adds utility and installer regression tests.
| File | Summary |
|---|---|
src/util.ts |
Adds build-metadata-aware version conversion. |
src/distributions/base-installer.ts |
Applies four-field normalization; moderate issues remain in pre-validation, JMOD gating, and candidate matching. |
dist/setup/index.js |
Updates the bundled utility. |
dist/setup/242.index.js |
Updates the bundled installer. |
dist/cleanup/index.js |
Updates the bundled utility. |
__tests__/util.test.ts |
Adds conversion coverage. |
__tests__/distributors/base-installer.test.ts |
Adds normalization coverage. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@brunoborges @johnoliver yeah i was just trying to make the four field temurin builds like |
3c1b9c7 to
28a9132
Compare
|
@johnoliver @brunoborges pushed a follow up so the jmods gate normalizes four field versions that already have +build the same way JavaBase does. also clarified the |

Fixes #1270
Temurin publishes versions like
26.0.2.1+1.normalizeVersiononly rewrote pure four field strings (e.g.18.0.1.1), so those values failed the SemVer check on setup-java 6.x.convertVersionToSemvernow folds the extra numeric fields into SemVer build metadata and keeps any existing+buildsuffix (26.0.2.1+1->26.0.2+1.1).normalizeVersionmatches the same pattern.Test plan
npm test -- --testPathPatterns=util.test --coverage=falsenpm test -- --testPathPatterns=base-installer.test --testNamePattern=normalizeVersion --coverage=falsenpm run build