mirror of
https://github.com/actions/setup-java.git
synced 2026-11-14 07:52:24 +00:00
Fix Oracle JDK 21 e2e and warn on archived GA fallback (#1327)
Oracle no longer serves JDK 21 under /java/21/latest/, so a major-only request falls back to the archived 21 GA build and reports version 21. The e2e check required a concrete version for floating Oracle requests, so the oracle 21 jobs failed. Move floating Oracle e2e coverage to JDK 25 and keep a single oracle 21 job that exercises the archive fallback without the concrete-version requirement. Warn when a major-only request falls back from /latest/ to the archived GA release, since that build may lack security updates. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -185,6 +185,19 @@ describe('findPackageForDownload', () => {
|
||||
expect(spyHttpClientGet).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('warns when a major-only request falls back to the archived GA release', async () => {
|
||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'head');
|
||||
spyHttpClient
|
||||
.mockResolvedValueOnce({message: {statusCode: 404}})
|
||||
.mockResolvedValueOnce({message: {statusCode: 200}});
|
||||
|
||||
await distribution['findPackageForDownload']('21');
|
||||
|
||||
expect(core.warning).toHaveBeenCalledWith(
|
||||
'Oracle JDK 21 is no longer available from the latest endpoint. Falling back to its archived GA release, which may not include security updates.'
|
||||
);
|
||||
});
|
||||
|
||||
it('always resolves major-only requests remotely', () => {
|
||||
expect(distribution['requiresRemoteResolution']()).toBe(true);
|
||||
const exactDistribution = new OracleDistribution({
|
||||
|
||||
Reference in New Issue
Block a user