Skip to content

dist: Migrate from Zulu Discovery API to Azul Metadata API#1010

Open
jameswald wants to merge 10 commits into
actions:mainfrom
jameswald:azul-metadata-api
Open

dist: Migrate from Zulu Discovery API to Azul Metadata API#1010
jameswald wants to merge 10 commits into
actions:mainfrom
jameswald:azul-metadata-api

Conversation

@jameswald

@jameswald jameswald commented May 29, 2026

Copy link
Copy Markdown

Used Claude Sonnet 4.6 to implement https://docs.azul.com/core/detailed/metadata-api-migration.html. If it's way off the mark then we can close it but if it's salvageable then please feel free to push any necessary commits on top of what is already done although I believe the changes I've made for this PR are complete.

Summary

Migrates the zulu distribution from the deprecated Zulu Discovery API (https://api.azul.com/zulu/download/community/v1.0/bundles/) to the new Azul Metadata API (https://api.azul.com/metadata/v1/zulu/packages/).

Background

The old Zulu Discovery API was returning HTTP 520 errors for a few hours, breaking all distribution: zulu workflows. Since the beginning of 2023 Azul has recommended the Metadata API and published a migration guide.

Changes

src/distributions/zulu/models.ts

Updated IZuluVersions to match the new API response shape:

  • id: numberpackage_uuid: string
  • urldownload_url
  • jdk_versionjava_version
  • zulu_versiondistro_version
  • Added latest: boolean and availability_type: string

src/distributions/zulu/installer.ts

  • New API base URL: https://api.azul.com/metadata/v1/zulu/packages/
  • Renamed query parameters: extarchive_type, bundle_typejava_package_type, javafxjavafx_bundled
  • Removed hw_bitness and abi query parameters (no longer part of the API)
  • Added availability_types=ca to restrict to free community builds
  • Pagination: the new API is paginated; added a loop that iterates through all pages until an empty page is returned
  • Simplified getArchitectureOptions(): now returns a plain string instead of {arch, hw_bitness, abi}. Architecture mapping: x64x64, x86x86, arm64/aarch64aarch64
  • Linux platform: returns linux_glibc instead of linux to exclude musl packages, which standard GitHub-hosted runners do not use
  • Fixed a typo: win_aarhc4win_aarch64

README.md

Updated the architecture-mapping note to reflect the new API's conventions (arm64aarch64).

Test fixtures and tests

  • Updated all three fixture files (zulu-releases-default.json, zulu-linux.json, zulu-windows.json) to use the new field names
  • Updated URL assertions in all three installer test files to match the new endpoint and parameter names
  • Updated getArchitectureOptions test cases to expect strings instead of objects
  • Removed the DistroArch type (no longer needed)

Related issue

Fixes #795

Check list

  • Documentation updated (README.md)
  • Tests added/updated to cover the changes

Fixes #795
Fixes #636

@jameswald jameswald marked this pull request as ready for review May 29, 2026 00:46
@jameswald jameswald requested a review from a team as a code owner May 29, 2026 00:46
Copilot AI review requested due to automatic review settings May 29, 2026 00:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Migrates the Zulu (Azul) distribution from the deprecated zulu/download/community/v1.0 API to the new metadata/v1/zulu/packages API, updating request parameters, response model fields, and architecture mapping accordingly.

Changes:

  • Switched API endpoint and renamed query parameters (e.g., extarchive_type, bundle_typejava_package_type, javafxjavafx_bundled); replaced hw_bitness/abi with a single arch value and added availability_types, page, page_size parameters.
  • Updated IZuluVersions model to use new field names (package_uuid, download_url, java_version, distro_version, latest, availability_type).
  • Updated tests and fixture data to align with the new API contract; updated README note about arch mapping.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/distributions/zulu/models.ts Updated IZuluVersions interface to new Azul Metadata API schema.
src/distributions/zulu/installer.ts Updated request URL/params, response field references, and simplified getArchitectureOptions to return a single string.
tests/distributors/zulu-installer.test.ts Updated expected URLs and arch mapping assertions for macOS.
tests/distributors/zulu-linux-installer.test.ts Updated expected URLs and arch mapping for Linux.
tests/distributors/zulu-windows-installer.test.ts Updated expected URLs and arch mapping for Windows.
tests/data/zulu-windows.json Regenerated fixture to match new API response schema.
tests/data/zulu-linux.json Regenerated fixture to match new API response schema.
tests/data/zulu-releases-default.json Regenerated fixture to match new API response schema.
README.md Updated note about Zulu architecture mapping.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/distributions/zulu/installer.ts
Comment thread src/distributions/zulu/installer.ts Outdated
Comment thread __tests__/data/zulu-windows.json Outdated
Comment thread README.md Outdated
@jameswald jameswald changed the title Use Azul metadata API Migrate from Zulu Discovery API to Azul Metadata API May 29, 2026
@jameswald jameswald force-pushed the azul-metadata-api branch from df4cd23 to 874ffb6 Compare May 29, 2026 11:44
@jameswald

Copy link
Copy Markdown
Author

Unintentionally implemented many of the same changes from #998 although the scope of this PR is a bit narrower.

@brunoborges brunoborges added feature request New feature or request to improve the current logic distribution JDK distribution/version/source support labels Jun 22, 2026
jameswald and others added 7 commits June 22, 2026 14:14
Fold CRaC-related work into the Zulu metadata API migration by wiring crac_supported query handling, extending Zulu package docs, and updating installer tests for jdk+crac/jre+crac behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Stop paginating on a short page to avoid an extra empty request
- Guard against undefined results (not just null)
- Cap iterations at 100 pages and warn if the limit is hit to
  prevent a runaway loop if the API misbehaves

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The Azul Metadata API returns java_version as a 3-element array
(e.g. [17,0,7]) and reports the build number separately in
openjdk_build_number. The migration mapped version directly from
java_version, dropping the build and breaking exact-version lookups
like 17.0.7+7 (e2e failure: "No matching version found for SemVer").

Add openjdk_build_number to IZuluVersions and append it to
java_version before converting to semver so resolved versions retain
the build (e.g. 17.0.7+7). Update the zulu test fixtures to mirror the
real API shape (3-element java_version plus openjdk_build_number) so
unit tests exercise the actual response format, and rebuild dist.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@brunoborges brunoborges requested a review from gdams June 22, 2026 21:02
brunoborges
brunoborges previously approved these changes Jun 22, 2026
@brunoborges brunoborges added maintenance Internal refactors/chore work and removed feature request New feature or request to improve the current logic labels Jun 22, 2026
@jameswald

Copy link
Copy Markdown
Author

Thanks @brunoborges! The additional changes look solid.

@brunoborges

Copy link
Copy Markdown
Contributor

Linking the tracking issue: this PR implements #795 (Migrate to the new Azul Metadata API). Maintainers — adding Closes #795 to the PR description will auto-close the issue on merge.

@brunoborges brunoborges self-assigned this Jun 23, 2026
@brunoborges brunoborges changed the title Migrate from Zulu Discovery API to Azul Metadata API dist: Migrate from Zulu Discovery API to Azul Metadata API Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

distribution JDK distribution/version/source support maintenance Internal refactors/chore work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate to new Azul metadata API (from Zulu Discovery API) Allow differentiating Zulu releases with/without CRaC

3 participants