Skip to content

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

Merged
gdams merged 12 commits into
actions:mainfrom
jameswald:azul-metadata-api
Jul 8, 2026
Merged

dist: Migrate from Zulu Discovery API to Azul Metadata API#1010
gdams merged 12 commits into
actions:mainfrom
jameswald:azul-metadata-api

Conversation

@jameswald

@jameswaldjameswald commented May 29, 2026

Copy link
Copy Markdown
Contributor

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
  • Removedhw_bitness and abi query parameters (no longer part of the API)
  • Addedavailability_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 ownerMay 29, 2026 00:46
CopilotAI review requested due to automatic review settings May 29, 2026 00:46

CopilotAI 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
FileDescription
src/distributions/zulu/models.tsUpdated IZuluVersions interface to new Azul Metadata API schema.
src/distributions/zulu/installer.tsUpdated request URL/params, response field references, and simplified getArchitectureOptions to return a single string.
tests/distributors/zulu-installer.test.tsUpdated expected URLs and arch mapping assertions for macOS.
tests/distributors/zulu-linux-installer.test.tsUpdated expected URLs and arch mapping for Linux.
tests/distributors/zulu-windows-installer.test.tsUpdated expected URLs and arch mapping for Windows.
tests/data/zulu-windows.jsonRegenerated fixture to match new API response schema.
tests/data/zulu-linux.jsonRegenerated fixture to match new API response schema.
tests/data/zulu-releases-default.jsonRegenerated fixture to match new API response schema.
README.mdUpdated note about Zulu architecture mapping.

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

Comment threadsrc/distributions/zulu/installer.ts
Comment threadsrc/distributions/zulu/installer.ts Outdated
Comment thread__tests__/data/zulu-windows.json Outdated
Comment threadREADME.md Outdated
@jameswaldjameswald changed the title Use Azul metadata APIMigrate from Zulu Discovery API to Azul Metadata APIMay 29, 2026
@jameswald

Copy link
Copy Markdown
ContributorAuthor

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

@brunoborgesbrunoborges added feature request New feature or request to improve the current logic distribution JDK distribution/version/source support labels Jun 22, 2026
jameswaldand 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 gdamsJune 22, 2026 21:02
brunoborges
brunoborges previously approved these changes Jun 22, 2026
@brunoborgesbrunoborges 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
ContributorAuthor

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.

@brunoborgesbrunoborges self-assigned this Jun 23, 2026
@brunoborgesbrunoborges changed the title Migrate from Zulu Discovery API to Azul Metadata APIdist: Migrate from Zulu Discovery API to Azul Metadata APIJun 23, 2026
@gdams
gdams merged commit d3530c1 into actions:mainJul 8, 2026
405 checks passed
zendesk-ops-ci pushed a commit to zendesk/setup-java that referenced this pull request Jul 17, 2026
)
* Use Azul metadata API
* Document arm64 -> aarch64 mapping in README.md
* Paginate through all available versions
* Fix typo: win_aarhc4
* Only query for linux_glibc packages
* Add Zulu CRaC package support to metadata migration
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>
* Harden Zulu metadata pagination with safety cap
- 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>
* Preserve JDK build number from Azul Metadata API
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>
---------
Co-authored-by: Bruno Borges <brborges@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
(cherry picked from commit d3530c1)
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

distributionJDK distribution/version/source supportmaintenanceInternal 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

4 participants

@jameswald@brunoborges@gdams