mirror of
https://github.com/actions/setup-java.git
synced 2026-11-14 21:20:34 +08: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:
co-authored by
Copilot App
parent
d1374f8ac7
commit
3c7a629527
Vendored
+7
@@ -82,6 +82,7 @@ class OracleDistribution extends _base_installer_js__WEBPACK_IMPORTED_MODULE_3__
|
||||
possibleUrls.push(`${ORACLE_DL_BASE}/${major}/latest/jdk-${major}_${platform}-${arch}_bin.${extension}`);
|
||||
}
|
||||
const floatingUrl = isOnlyMajorProvided ? possibleUrls[0] : undefined;
|
||||
let latestUrlNotFound = false;
|
||||
possibleUrls.push(`${ORACLE_DL_BASE}/${major}/archive/jdk-${range}_${platform}-${arch}_bin.${extension}`);
|
||||
if (parseInt(major) < 17) {
|
||||
throw new Error('Oracle JDK is only supported for JDK 17 and later');
|
||||
@@ -90,6 +91,9 @@ class OracleDistribution extends _base_installer_js__WEBPACK_IMPORTED_MODULE_3__
|
||||
const response = await this.http.head(url);
|
||||
if (response.message.statusCode === _actions_http_client__WEBPACK_IMPORTED_MODULE_5__/* .HttpCodes */ .Hv.OK) {
|
||||
const floating = url === floatingUrl;
|
||||
if (latestUrlNotFound) {
|
||||
_actions_core__WEBPACK_IMPORTED_MODULE_0__/* .warning */ .$e(`Oracle JDK ${major} is no longer available from the latest endpoint. Falling back to its archived GA release, which may not include security updates.`);
|
||||
}
|
||||
return {
|
||||
url,
|
||||
version: range,
|
||||
@@ -100,6 +104,9 @@ class OracleDistribution extends _base_installer_js__WEBPACK_IMPORTED_MODULE_3__
|
||||
: undefined
|
||||
};
|
||||
}
|
||||
if (url === floatingUrl) {
|
||||
latestUrlNotFound = true;
|
||||
}
|
||||
if (response.message.statusCode !== _actions_http_client__WEBPACK_IMPORTED_MODULE_5__/* .HttpCodes */ .Hv.NotFound) {
|
||||
throw new Error(`Http request for Oracle JDK failed with status code: ${response.message.statusCode}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user