setup-java/__tests__
Julien Dubois d0e61fe743
Fix JDK resolution cache platform identity (#1210)
* Fix JDK resolution cache platform identity

Include the effective Linux libc platform in JDK resolution cache keys so Alpine/musl and glibc runners cannot restore each other's release metadata. Bump the cache namespace and share Alpine detection with affected distributors.\n\nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>\nCopilot-Session: 4f95577c-567c-47a8-92f2-b4dced527866

* Update generated action bundles

Regenerate setup and cleanup distributions for the platform-aware JDK resolution cache.\n\nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>\nCopilot-Session: 4f95577c-567c-47a8-92f2-b4dced527866

* Cover the platform-identity fallback and Alpine short-circuit

getJavaPlatformIdentity's `?? platform` fallback and the alias path for
platforms other than linux/darwin/win32 had no coverage, and isAlpineLinux
had no direct test at all.

Verified by mutation: replacing the fallback with a constant, and dropping
the `platform === 'linux'` short-circuit from isAlpineLinux, both left the
existing suite fully green. The added cases fail on each.

The short-circuit case matters beyond coverage bookkeeping: it is what keeps
the /etc/alpine-release probe from running on non-Linux runners, so a stray
file can never make Windows or macOS resolve as musl.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 74248bb0-72af-41d8-b85d-b0f5836e68db

* Carry the platform identity into the floating resolution request

Merging main brought in #1219, which added getFloatingResolutionRequest
as a second construction site for JdkResolutionRequest. It predates the
required `platform` field, so the merged tree did not compile.

The floating request already carries `source`, which pins the artifact
bytes, so this changes no lookup behaviour on its own -- it keeps the two
request builders consistent and the tree building.

Also refreshes dist/, which the textual merge left stale.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 74248bb0-72af-41d8-b85d-b0f5836e68db

---------

Co-authored-by: Bruno Borges <brborges@microsoft.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 74248bb0-72af-41d8-b85d-b0f5836e68db
2026-08-05 12:45:11 -04:00
..
cache Restore dependency and wrapper caches concurrently (#1174) 2026-07-29 13:41:24 -04:00
data Remove legacy Adopt distributions in v6 (#1185) 2026-07-31 15:48:18 -04:00
distributors Fix JDK resolution cache platform identity (#1210) 2026-08-05 12:45:11 -04:00
auth.test.ts Import Maven signing keys into an isolated GPG home (#1214) 2026-08-05 12:05:36 -04:00
benchmark-cache-restore.sh Restore dependency and wrapper caches concurrently (#1174) 2026-07-29 13:41:24 -04:00
cache-feature.test.ts Optimize Temurin tool-cache fast path with lazy loading (#1179) 2026-07-29 17:53:33 -04:00
cache.test.ts Add dependency cache path overrides (#1175) 2026-07-29 14:43:55 -04:00
check-dir.sh Extract repeated directory-check assertions into check-dir.sh helper (#1127) 2026-07-15 11:14:40 -04:00
checksum.test.ts Verify JDK downloads with vendor checksums (#1167) 2026-07-29 04:43:56 -04:00
cleanup-java.test.ts Import Maven signing keys into an isolated GPG home (#1214) 2026-08-05 12:05:36 -04:00
gpg.test.ts Import Maven signing keys into an isolated GPG home (#1214) 2026-08-05 12:05:36 -04:00
java-package-contract.test.ts chore(deps): bump brace-expansion from 5.0.8 to 5.0.9 (#1202) 2026-08-04 21:15:15 -04:00
java-platform-contract.test.ts Fix JDK resolution cache platform identity (#1210) 2026-08-05 12:45:11 -04:00
jdk-cache.test.ts Add conditional JDK caching (#1201) 2026-08-04 21:54:10 -04:00
jdk-resolution-cache.test.ts Fix JDK resolution cache platform identity (#1210) 2026-08-05 12:45:11 -04:00
maven-args.test.ts Migrate to ESM and upgrade dependencies (#1078) 2026-07-08 10:15:00 +01:00
maven-xml-loading.test.ts Optimize Maven configuration warm path (#1182) 2026-07-30 15:09:35 -04:00
problem-matcher.test.ts Add an option to disable Java problem matchers (#1133) 2026-07-16 11:28:10 -04:00
retrying-http-client.test.ts Consolidate JDK metadata retry handling (#1162) 2026-07-29 00:09:37 -04:00
setup-java.module-loading.test.ts Add conditional JDK caching (#1201) 2026-08-04 21:54:10 -04:00
setup-java.test.ts Add conditional JDK caching (#1201) 2026-08-04 21:54:10 -04:00
toolchains.test.ts Optimize Maven configuration warm path (#1182) 2026-07-30 15:09:35 -04:00
util-install.test.ts Report concrete versions for floating Oracle JDK downloads (#1213) 2026-08-05 11:57:27 -04:00
util.test.ts Add conditional JDK caching (#1201) 2026-08-04 21:54:10 -04:00
verify-java.sh Report concrete versions for floating Oracle JDK downloads (#1213) 2026-08-05 11:57:27 -04:00