Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate from Zulu OpenJDK Discovery API to Azul Metadata API #514

Open
ryansuhartanto opened this issue Apr 19, 2024 · 4 comments · May be fixed by #515
Open

Migrate from Zulu OpenJDK Discovery API to Azul Metadata API #514

ryansuhartanto opened this issue Apr 19, 2024 · 4 comments · May be fixed by #515
Assignees
Labels
bug Something isn't working

Comments

@ryansuhartanto
Copy link

Bug Report

Package Name: zulu*

Current Behaviour

Currently, Azul Zulu packages are using the discovery API (https://api.azul.com/zulu/download/).

Expected Behaviour

Azul Zulu packages should utilize the new metadata API (https://api.azul.com/metadata/v1/)

Additional context/output

In accordance with https://docs.azul.com/core/metadata-api-migration.

Azul now support CRaC on their JDKs beginning on version 17 by default, currently zulu17-jdk and zulu-jdk packages cannot update correctly due to the incorrect regex trying to match the default CRaC (*-ca-crac-*) support.

It's also worth mentioning that the LTS version of 21 is missing from the bucket (#509).
Zulu packages beginning from 21 should drop support for 32-bit architecture in accordance with JEP 449.

Possible Solution

  • Replace supported zulu* packages' checkver and autoupdate links with the new metadata API.
  • Drop support for 32bit architecture on zulu-* and zulufx-* as per JEP 449.

We should discuss about making a separate package for the CRaC support.

@ryansuhartanto ryansuhartanto added the bug Something isn't working label Apr 19, 2024
@se35710 se35710 self-assigned this Apr 19, 2024
@ryansuhartanto
Copy link
Author

ryansuhartanto commented Apr 19, 2024

For example, here's the discovery API for the JDK version 17 (added newlines for clarity):

https://api.azul.com/zulu/download/community/v1.0/bundles/latest/\
?jdk_version=17\
&bundle_type=jdk\
&features=\
&javafx=false\
&ext=zip\
&os=windows\
&arch=x86\
&hw_bitness=64

Here's the migrated metadata API after being refactored to have the same order in the swagger docs:

https://api.azul.com/metadata/v1/zulu/packages/\
?java_version=17\
&os=windows\
&arch=x86\
&archive_type=zip\
&java_package_type=jdk\
&javafx_bundled=false\
&crac_supported=false\
&release_type=PSU\
&latest=true\
&page_size=2

Here's the diff after the refactor:

- https://api.azul.com/zulu/download/community/v1.0/bundles/latest/\
+ https://api.azul.com/metadata/v1/zulu/packages/\
- ?jdk_version=17\
+ ?java_version=17\
  &os=windows\
  &arch=x86\
- &ext=zip\
+ &archive_type=zip\
- &javafx=false\
+ &javafx_bundled=false\
+ &crac_supported=false\
+ &release_type=PSU\
+ &latest=true\
+ &page_size=2
- &features=

Note that we added CRaC, release type, and latest parameters.

I removed the feature parameter (java_package_features; being used in zulu*-jre) due to Windows build of JRE is always headfull.

CRaC support has their own docs here https://docs.azul.com/core/crac/crac-introduction,

Release type parameter is, quote from the API:

Filters the result by release type, Critical Patch Update CPU, Patch Set Update PSU, or Limited Update LU.

We use PSU to match latest available versions on the download screen at https://www.azul.com/downloads.

I added latest and page size parameter to only list the first x86 and x64, regardless of CRS support. Page size parameter value should be 1 starting from Java version 21 per JEP 449.

@ryansuhartanto ryansuhartanto linked a pull request Apr 19, 2024 that will close this issue
1 task
@ryansuhartanto
Copy link
Author

ryansuhartanto commented Apr 21, 2024

Note that now, the hash for the downloaded file has been separated to a different API request (/zulu/packages/). We need to store the product UUID of both the 32-bit architecture and 64-bit architecture to substitute it on autoupdate.

Can be included using include_fields parameter.

@ryansuhartanto
Copy link
Author

ryansuhartanto commented Apr 21, 2024

I have researched the documentation about CRaC and CRS support.

CRS (Connected Runtime Service) is not available to 32-bit architecture after October 2023.
We can just ignore this since it's just a drop support on the architecture, the official download site lists the latest 32-bit version without the support.

CRaC (Coordinated Restore at Checkpoint) is only available on 64-bit architecture beginning from Zulu version 17.46 and 21.30.
I suggests making a separate package for this since it's mutually exclusive with JavaFX to match how they are displayed on their download site.

@ryansuhartanto
Copy link
Author

I made a regex to match and substitute the urls here https://regex101.com/r/5ZwIZG/5.
Note that the page size parameter is set to 2.

ryansuhartanto added a commit to ryansuhartanto/Scoop-Java that referenced this issue Apr 23, 2024
Using the regex from <ScoopInstaller#514 (comment)>.

TODO: fit with json path and regex.
ryansuhartanto added a commit to ryansuhartanto/Scoop-Java that referenced this issue May 13, 2024
Using the regex from <ScoopInstaller#514 (comment)>.

TODO: fit with json path and regex.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants