Preserve compound Liberica build versions from release metadata

Co-authored-by: brunoborges <129743+brunoborges@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-09-11 02:51:39 +00:00
committed by GitHub
co-authored by brunoborges
parent 1073668b98
commit 058f41bc0d
4 changed files with 68 additions and 3 deletions
@@ -253,6 +253,39 @@ describe('findPackageForDownload', () => {
expect(result.version).toBe(expected);
});
describe('compound build versions', () => {
beforeEach(() => {
distribution['getAvailableVersions'] = async () =>
['1', '1.1', '1.2', '1.10'].map(build => ({
featureVersion: 25,
interimVersion: 0,
updateVersion: 4,
buildVersion: 1,
version: `25.0.4+${build}`,
downloadUrl: `https://download.bell-sw.com/java/25.0.4+${build}/bellsoft-jdk25.0.4+${build}-macos-aarch64.tar.gz`
}));
});
it.each([
['25.0.4+1.1', '25.0.4+1.1'],
['25.0.4+1', '25.0.4+1'],
['25.0.4', '25.0.4+1.10'],
['25', '25.0.4+1.10']
])('version is %s -> %s', async (input, expected) => {
const result = await distribution['findPackageForDownload'](input);
expect(result).toEqual({
version: expected,
url: `https://download.bell-sw.com/java/${expected}/bellsoft-jdk${expected}-macos-aarch64.tar.gz`
});
});
it('does not substitute a different compound build', async () => {
await expect(
distribution['findPackageForDownload']('25.0.4+1.3')
).rejects.toThrow(/No matching version found for SemVer/);
});
});
it('should throw an error', async () => {
await expect(distribution['findPackageForDownload']('17')).rejects.toThrow(
/No matching version found for SemVer/
@@ -335,6 +368,36 @@ describe('convertVersionToSemver', () => {
buildVersion: 13
},
'11.0.0+13'
],
[
{
version: '25.0.4+1.1',
featureVersion: 25,
interimVersion: 0,
updateVersion: 4,
buildVersion: 1
},
'25.0.4+1.1'
],
[
{
version: '25+36',
featureVersion: 25,
interimVersion: 0,
updateVersion: 0,
buildVersion: 36
},
'25.0.0+36'
],
[
{
version: '8u202',
featureVersion: 8,
interimVersion: 0,
updateVersion: 202,
buildVersion: 8
},
'8.0.202+8'
]
])('%s -> %s', (input, expected) => {
const actual = distributions['convertVersionToSemver']({
+1
View File
@@ -276,6 +276,7 @@ describe('getVersionFromFileContent', () => {
['java=21.0.5-graal', '21.0.5', 'graalvm'],
['java=17.0.9-graalce', '17.0.9', 'graalvm'],
['java=11.0.25-librca', '11.0.25', 'liberica'],
['java=25.0.4+1.1-librca', '25.0.4+1.1', 'liberica'],
['java=11.0.25-ms', '11.0.25', 'microsoft'],
['java=21.0.5-oracle', '21.0.5', 'oracle'],
['java=11.0.25-sapmchn', '11.0.25', 'sapmachine'],