Support exact Corretto release versions (#1310)

* Support exact Corretto release versions

Corretto users cannot pin the release used by their local builds and
production. Accept full release numbers so a workflow keeps using its
chosen release after Amazon publishes a newer patch.

* Fix Corretto release review findings

Co-authored-by: Copilot App <223556219+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:
authored and GitHub committed 2026-11-04 16:40:21 -05:00
1 parent dade0c5eef
commit 644a850ee5
8 files changed
+557 -25

No files matched your search

+14
View File
@@ -31674,6 +31674,7 @@ function validateToolchainIds(versions, versionFile, toolchainIds) {
/* harmony export */ ZY: () => (/* binding */ convertVersionToSemver),
/* harmony export */ aT: () => (/* binding */ isGhes),
/* harmony export */ ag: () => (/* binding */ getDownloadArchiveExtension),
/* harmony export */ kI: () => (/* binding */ isExactCorrettoVersion),
/* harmony export */ lK: () => (/* binding */ getGitHubToken),
/* harmony export */ lN: () => (/* binding */ isJdkCacheEnabled),
/* harmony export */ n2: () => (/* binding */ renameWinArchive),
@@ -31990,6 +31991,15 @@ function getVersionFromFileContent(content, distributionName, versionFile) {
}
const tentativeVersion = avoidOldNotation(capturedVersion);
const rawVersion = tentativeVersion.split('-')[0];
// Preserve Corretto's full vendor release before generic coercion drops its extra numeric fields.
if ((extractedDistribution || distributionName) === 'corretto' &&
capturedVersion === tentativeVersion &&
isExactCorrettoVersion(tentativeVersion)) {
return {
version: tentativeVersion,
distribution: extractedDistribution
};
}
let version = semver__WEBPACK_IMPORTED_MODULE_3__.validRange(rawVersion)
? tentativeVersion
: semver__WEBPACK_IMPORTED_MODULE_3__.coerce(tentativeVersion);
@@ -32073,6 +32083,10 @@ function mapAsdfDistribution(asdfDist) {
function avoidOldNotation(content) {
return content.startsWith('1.') ? content.substring(2) : content;
}
function isExactCorrettoVersion(version) {
// Java 8 releases have a nonzero update field; later releases use five numeric fields.
return /^(?:8\.(?!0+(?:\.|$))\d+(?:\.\d+){2}|(?!8\.)\d+(?:\.\d+){4})$/.test(version.replace('+', '.'));
}
function convertVersionToSemver(version) {
// Some distributions may use semver-like notation (12.10.2.1, 12.10.2.1.1)
const versionArray = Array.isArray(version) ? version : version.split('.');