setup-java/__tests__/distributors
John b24df5bba5
Make the Adoptopenjdk package type look at the Temurin repo first for latest assets (#522)
* Make the Adoptopenjdk package type look at the Temurin repo first for latest assets

* Address Copilot code review comments

- Use strict equality (===, !==) instead of loose equality (==, !=) for all comparisons
- Properly handle caught errors with instanceof type narrowing before accessing properties
- Only fall back to legacy AdoptOpenJDK for specific version-not-found errors
- Rethrow unexpected errors to avoid masking real issues (network failures, rate limits, etc.)
- Fix error message check to match actual error text ('No matching version found')
- Remove unnecessary undefined check since method return type is never undefined
- Add @internal JSDoc annotation to TemurinDistribution.findPackageForDownload()
- Update tests to properly mock Temurin lookup failures for fallback behavior testing
- Rebuild dist files

* Always fall back to legacy AdoptOpenJDK but log all Temurin failures

- Change error handling to gracefully fall back for all errors, not just version-not-found
- Log version-not-found errors as notices with migration guidance
- Log other Temurin failures as debug messages for troubleshooting
- Improves resilience: users always get a result even if Temurin API has issues
- Maintains visibility: failures are still logged for debugging

* Fixes from review

* Fixes from review

* Fixes from review

* Regenerate dist
2026-06-12 16:30:59 +01:00
..
adopt-installer.test.ts Make the Adoptopenjdk package type look at the Temurin repo first for latest assets (#522) 2026-06-12 16:30:59 +01:00
base-installer.test.ts Refactor error handling and improve test logging for installers (#989) 2026-04-13 12:44:45 -05:00
corretto-installer.test.ts Refactor error handling and improve test logging for installers (#989) 2026-04-13 12:44:45 -05:00
dragonwell-installer.test.ts Refactor error handling and improve test logging for installers (#989) 2026-04-13 12:44:45 -05:00
graalvm-installer.test.ts Refactor error handling and improve test logging for installers (#989) 2026-04-13 12:44:45 -05:00
jetbrains-installer.test.ts Refactor error handling and improve test logging for installers (#989) 2026-04-13 12:44:45 -05:00
liberica-installer.test.ts Refactor error handling and improve test logging for installers (#989) 2026-04-13 12:44:45 -05:00
liberica-linux-installer.test.ts Refactor error handling and improve test logging for installers (#989) 2026-04-13 12:44:45 -05:00
liberica-windows-installer.test.ts Refactor error handling and improve test logging for installers (#989) 2026-04-13 12:44:45 -05:00
local-installer.test.ts Refactor error handling and improve test logging for installers (#989) 2026-04-13 12:44:45 -05:00
microsoft-installer.test.ts Refactor error handling and improve test logging for installers (#989) 2026-04-13 12:44:45 -05:00
oracle-installer.test.ts Refactor error handling and improve test logging for installers (#989) 2026-04-13 12:44:45 -05:00
sapmachine-installer.test.ts Refactor error handling and improve test logging for installers (#989) 2026-04-13 12:44:45 -05:00
semeru-installer.test.ts Implement pagination with link headers for Adoptium based apis (#1014) 2026-06-12 11:50:16 +01:00
temurin-installer.test.ts Implement pagination with link headers for Adoptium based apis (#1014) 2026-06-12 11:50:16 +01:00
zulu-installer.test.ts Refactor error handling and improve test logging for installers (#989) 2026-04-13 12:44:45 -05:00
zulu-linux-installer.test.ts Refactor error handling and improve test logging for installers (#989) 2026-04-13 12:44:45 -05:00
zulu-windows-installer.test.ts Refactor error handling and improve test logging for installers (#989) 2026-04-13 12:44:45 -05:00