Support Java release tags with exact abbreviated builds

Normalize jdk-prefixed numeric versions and pad abbreviated build requests so exact build constraints survive version matching. Keep platform and package validation consistent, document the syntax, and add regression coverage.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Bruno Borges
2026-10-05 18:06:14 +02:00
parent d0e6e4dbf7
commit ca21d6d9c1
12 changed files with 250 additions and 94 deletions

View File

@@ -191,6 +191,17 @@ describe('convertVersionToSemver', () => {
describe('normalizeJavaVersionToSemver', () => {
it.each([
['jdk-27+35', '27.0.0+35'],
['27+35', '27.0.0+35'],
['27.0+35', '27.0.0+35'],
['jdk-27.0+35', '27.0.0+35'],
['jdk-27.0.0+35', '27.0.0+35'],
['jdk-27', '27'],
['jdk-27.0', '27.0'],
['jdk-27.0.1', '27.0.1'],
['27+35.0.LTS', '27.0.0+35.0.LTS'],
['jdk-26.0.2.1+1', '26.0.2+1.1'],
['jdk-11.0.9.1', '11.0.9+1'],
['17', '17'],
['17.0.8', '17.0.8'],
['17.0.8+7', '17.0.8+7'],
@@ -199,7 +210,11 @@ describe('normalizeJavaVersionToSemver', () => {
['26.0.2.1+1', '26.0.2+1.1'],
['17.0.8.1+1080.1', '17.0.8+1.1080.1'],
['>=11.0.9.1', '>=11.0.9.1'],
['17.x', '17.x']
['17.x', '17.x'],
['>=17 <28', '>=17 <28'],
['jdk-27.x', 'jdk-27.x'],
['jdk-latest', 'jdk-latest'],
['temurin-27+35', 'temurin-27+35']
])('%s -> %s', (input: string, expected: string) => {
expect(normalizeJavaVersionToSemver(input)).toBe(expected);
});