Add Microsoft OpenJDK 25.0.5.0.2 support (#1320)

* Initial plan

* Support Microsoft OpenJDK 25.0.5.0.2 with bundled manifest fallback

* Fix Microsoft OpenJDK version matching

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Bruno Borges <brborges@microsoft.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Copilot
2026-11-13 23:30:44 -05:00
committed by GitHub
parent a3c8068301
commit a1bf0b5568
9 changed files with 586 additions and 332 deletions
@@ -216,6 +216,172 @@ describe('findPackageForDownload', () => {
expect(result.signatureUrl).toBe(`${url}.sig`);
});
describe.each(['25.0.5.0.2', '25.0.5+0.2', '25.0.5'])(
'version %s missing from the live manifest',
version => {
it.each([
['darwin', 'x64', 'macos', 'tar.gz'],
['linux', 'x64', 'linux', 'tar.gz'],
['win32', 'x64', 'windows', 'zip'],
['darwin', 'aarch64', 'macos', 'tar.gz'],
['linux', 'aarch64', 'linux', 'tar.gz'],
['win32', 'aarch64', 'windows', 'zip']
])(
'resolves the bundled release for %s/%s',
async (platform, architecture, osType, extension) => {
mockOsPlatform.mockReturnValue(platform);
const distro = new MicrosoftDistributions({
version,
architecture,
packageType: 'jdk',
checkLatest: false
});
const result = await distro['findPackageForDownload'](
distro['version']
);
const url = `https://aka.ms/download-jdk/microsoft-jdk-25.0.5.0.2-${osType}-${architecture}.${extension}`;
expect(result).toEqual({
version: '25.0.5+0.2',
url,
signatureUrl: `${url}.sig`,
checksum: {
algorithm: 'sha256',
value: MICROSOFT_CHECKSUM,
source: `${url}.sha256sum.txt`
}
});
expect(spyHttpClientGet).toHaveBeenCalledWith(`${url}.sha256sum.txt`);
}
);
}
);
it('prefers the live manifest when it contains the requested release', async () => {
mockOsPlatform.mockReturnValue('linux');
const url =
'https://example.test/microsoft-jdk-25.0.5.0.2-linux-x64.tar.gz';
spyGetManifestFromRepo.mockResolvedValue({
result: [
{
version: '25.0.5+0.2',
stable: true,
release_url: 'https://aka.ms/download-jdk',
files: [
{
filename: 'microsoft-jdk-25.0.5.0.2-linux-x64.tar.gz',
arch: 'x64',
platform: 'linux',
download_url: url
}
]
}
],
statusCode: 200,
headers: {}
});
const result = await distribution['findPackageForDownload']('25.0.5+0.2');
expect(result.version).toBe('25.0.5+0.2');
expect(result.url).toBe(url);
expect(spyGetManifestFromRepo).toHaveBeenCalledWith(
'https://aka.ms/download-jdk/microsoft-openjdk-versions.json',
{accept: 'application/json'}
);
});
it('falls back to the bundled build when the live manifest has another build', async () => {
mockOsPlatform.mockReturnValue('linux');
spyGetManifestFromRepo.mockResolvedValue({
result: [
{
version: '25.0.5+0.3',
stable: true,
release_url: 'https://aka.ms/download-jdk',
files: [
{
filename: 'microsoft-jdk-25.0.5.0.3-linux-x64.tar.gz',
arch: 'x64',
platform: 'linux',
download_url:
'https://example.test/microsoft-jdk-25.0.5.0.3-linux-x64.tar.gz'
}
]
}
],
statusCode: 200,
headers: {}
});
const result = await distribution['findPackageForDownload']('25.0.5+0.2');
expect(result.version).toBe('25.0.5+0.2');
expect(result.url).toBe(
'https://aka.ms/download-jdk/microsoft-jdk-25.0.5.0.2-linux-x64.tar.gz'
);
});
it('matches dotted Java versions without falling back to the base release', async () => {
mockOsPlatform.mockReturnValue('linux');
spyGetManifestFromRepo.mockResolvedValue({
result: [
{
version: '17.0.8',
stable: true,
release_url: 'https://aka.ms/download-jdk',
files: [
{
filename: 'microsoft-jdk-17.0.8-linux-x64.tar.gz',
arch: 'x64',
platform: 'linux',
download_url: 'https://example.test/microsoft-jdk-17.0.8.tar.gz'
}
]
},
{
version: '17.0.8.1',
stable: true,
release_url: 'https://aka.ms/download-jdk',
files: [
{
filename: 'microsoft-jdk-17.0.8.1-linux-x64.tar.gz',
arch: 'x64',
platform: 'linux',
download_url: 'https://example.test/microsoft-jdk-17.0.8.1.tar.gz'
}
]
}
],
statusCode: 200,
headers: {}
});
distribution = new MicrosoftDistributions({
version: '17.0.8.1',
architecture: 'x64',
packageType: 'jdk',
checkLatest: false
});
const result = await distribution['findPackageForDownload'](
distribution['version']
);
expect(result.version).toBe('17.0.8+1');
expect(result.url).toBe(
'https://example.test/microsoft-jdk-17.0.8.1.tar.gz'
);
});
it('preserves the error when the live manifest cannot be loaded', async () => {
spyGetManifestFromRepo.mockRejectedValue(new Error('Network error'));
await expect(
distribution['findPackageForDownload']('25.0.5+0.2')
).rejects.toThrow('Could not load manifest for Microsoft Build of OpenJDK');
});
it.each([
['amd64', 'x64'],
['arm64', 'aarch64']