Skip to content

Replace DISCO API with GitHub API for Mandrel latest version resolution.#213

Merged
fniephaus merged 2 commits intograalvm:mainfrom
zakkak:2026-03-30-fix-211
Mar 31, 2026
Merged

Replace DISCO API with GitHub API for Mandrel latest version resolution.#213
fniephaus merged 2 commits intograalvm:mainfrom
zakkak:2026-03-30-fix-211

Conversation

@zakkak
Copy link
Copy Markdown
Collaborator

@zakkak zakkak commented Mar 30, 2026

The Foojay DISCO API is not needed for resolving the latest Mandrel
release. Instead, use the GitHub Releases API to search for matching assets
directly in the graalvm/mandrel repository.

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

Closes #211

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Mar 30, 2026
@zakkak zakkak force-pushed the 2026-03-30-fix-211 branch from 70f3542 to ea406fb Compare March 30, 2026 11:23
The Foojay DISCO API is no longer needed for resolving the latest Mandrel
release. Instead, use the GitHub Releases API to search for matching assets
directly in the graalvm/mandrel repository.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@zakkak zakkak force-pushed the 2026-03-30-fix-211 branch from ea406fb to 043be01 Compare March 30, 2026 11:28
@fniephaus fniephaus self-assigned this Mar 30, 2026
src/mandrel.ts Outdated
throw new Error(`Failed to fetch latest Mandrel release for Java ${javaVersion} from DISCO API: ${response.result}`)
}
const result = response.result?.result[0]
const expectedPrefix = `mandrel-java${javaVersion}-${c.GRAALVM_PLATFORM}-${c.GRAALVM_ARCH}-`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking: this uses c.GRAALVM_PLATFORM, which is darwin on macOS, but Mandrel release assets use macos in their filenames. That means version: latest will stop resolving on macOS after this change, even though it works on Linux.

The previous DISCO lookup used c.JDK_PLATFORM, which maps macOS correctly to macos. I think this match should use the Mandrel/JDK platform token instead of the raw GraalVM platform token. 🤖

@fniephaus
Copy link
Copy Markdown
Member

Could we add a test for the platform-specific asset prefix used by getLatestMandrelReleaseUrl()? The current integration test passes on Linux, but it would not catch the macOS darwin vs macos mismatch introduced here. A small unit test around the asset-name matching logic would help prevent this regression. 🤖

Use `JDK_PLATFORM` instead of `GRAALVM_PLATFORM` so macOS resolves to
`macos` (not `darwin`) when matching Mandrel release assets. Extract
`matchesMandrelAsset()` helper and add a unit test covering all platforms.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@zakkak zakkak requested a review from fniephaus March 30, 2026 15:41
Copy link
Copy Markdown
Member

@fniephaus fniephaus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@fniephaus fniephaus merged commit 671c7d4 into graalvm:main Mar 31, 2026
100 checks passed
@zakkak zakkak deleted the 2026-03-30-fix-211 branch March 31, 2026 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mandrel JDK 17 instead of 21 is downloaded

2 participants