Skip to content

Accept Temurin four field versions with build metadata - #1271

Open
Hashim1999164 wants to merge 1 commit into
actions:mainfrom
Hashim1999164:fix/temurin-four-field-semver
Open

Hashim1999164 wants to merge 1 commit into
actions:mainfrom
Hashim1999164:fix/temurin-four-field-semver

Conversation

@Hashim1999164

Copy link
Copy Markdown

Fixes #1270

Temurin publishes versions like 26.0.2.1+1. normalizeVersion only rewrote pure four field strings (e.g. 18.0.1.1), so those values failed the SemVer check on setup-java 6.x.

convertVersionToSemver now folds the extra numeric fields into SemVer build metadata and keeps any existing +build suffix (26.0.2.1+1 -> 26.0.2+1.1). normalizeVersion matches the same pattern.

Test plan

  • npm test -- --testPathPatterns=util.test --coverage=false
  • npm test -- --testPathPatterns=base-installer.test --testNamePattern=normalizeVersion --coverage=false
  • npm run build

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.
@Hashim1999164
Hashim1999164 requested a review from a team as a code owner September 18, 2026 13:42
@johnoliver

Copy link
Copy Markdown
Contributor

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.

['11.0.9.1', {version: '11.0.9+1', stable: true, latest: false}],
['12.0.2.1.0', {version: '12.0.2+1.0', stable: true, latest: false}],
['18.0.1.1-ea', {version: '18.0.1+1', stable: false, latest: false}],
['26.0.2.1+1', {version: '26.0.2+1.1', stable: true, latest: false}],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using the test cases of 26.0.2.1+1 -> 26.0.2+1.1 does leave it ambiguous if +1.1 is in the right order

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Temurin version incorrectly converted for setup-java 6.0.x

2 participants