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

add support for adoptopenjdk binaries #67

Closed
wants to merge 14 commits into from
Closed

Conversation

gdams
Copy link
Contributor

@gdams gdams commented May 26, 2020

partially resolves #13

@giltene
Copy link
Contributor

giltene commented May 26, 2020

The option name “distro” makes much more sense here than “vendor” IMO (see examples at #13 (comment)).

I’d go with “adopt” for the AdoptOpenJDK distro (likely to last longer given recent gripes around the use of the “OpenJDK” trademark in names as opposed to the fair use rules laid out on the OpenJDK site).

I think we should structure to accommodate several distros, and pre-populate some of the additional likely distro names:

zulu
oracle-openjdk
redhat
corretto
liberica
adopt
dragonwell

This way folks can later just tweak the (initially empty?) implementation for each distro to enable them. I’m pretty sure at least a couple of them will fill those in pretty quickly...

Should we break out the distro-specific items to a separate .ts file?

@gdams
Copy link
Contributor Author

gdams commented May 26, 2020

Should we break out the distro-specific items to a separate .ts file?

@giltene updated to have separate files.

The option name “distro” makes much more sense here than “vendor” IMO (see examples at #13 (comment)).

Agreed, updated

I’d go with “adopt” for the AdoptOpenJDK distro (likely to last longer given recent gripes around the use of the “OpenJDK” trademark in names as opposed to the fair use rules laid out on the OpenJDK site).

I'd prefer to stick with AdoptOpenJDK for now. In the event of a rebrand, it will be very easy to resolve this with an alias

@gdams gdams force-pushed the adopt branch 14 times, most recently from 8d8cb42 to 5382c49 Compare May 27, 2020 14:53
@giltene
Copy link
Contributor

giltene commented May 27, 2020

For the readme, we should probably add a section ( at the bottom?) describing the possible distro options and their limitations (if any). I anticipate that we as we move past having only one distro we will quickly get to 4-7, and with each distro potentially having different limitations (only some version syntax supported, only some package types, platforms, or architectures supported, possibly only some versions or ranges of versions supported), we can state the limitations of each in a concise way under their distro description in the readme.

The version specification description at the top should remain generic (no “Zulu only” or adopt specific notes), and we can add a small subnote saying “see distro-specific limitations below”. A key purpose purpose of the limitation notes (which each distro can list separately if they want) is to intercept a user being surprised that a a specification that is covered in the general way for specifying a version and package doesn’t work in a specific distro for some reason (e.g. using semver range syntax for adopt in current implementation, or “Oracle OpenJDK does not have jdk+fx or jre packages available”). We don’t have to list all limitations, or even any (you can leave them blank and have people just figure out why something fails), but they would be helpful for distros to include. As limitations are removed (full semver syntax supported, additional package types or platforms added), distributions can update the notes, but we probably don’t want to be churning the readme often to e.g. describe the full set of versions supported by each distro, as that would have us editing the readme many times each quarter, and likely having it be stale and incorrect most of the time.

@gdams
Copy link
Contributor Author

gdams commented Jul 9, 2020

This should be good to land, is somebody happy to merge?

@giltene
Copy link
Contributor

giltene commented Jul 9, 2020

This should be good to land, is somebody happy to merge?

Please address the previous notes on the readme changes you propose... (e.g. remove the "XYZ only" additions to some of the version specification syntax, introduce a distros list to the readme, with notes that each distro can have (as needed) about any limitations or specific expectations.)

@gdams gdams force-pushed the adopt branch 3 times, most recently from 8154901 to 1223d9e Compare July 28, 2020 09:46
@@ -19,7 +19,8 @@ steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: '9.0.4' # The JDK version to make available on the path.
java-version: '11' # The JDK version to make available on the path.
vendor: adoptopenjdk # (adoptopenjdk or zulu) - defaults to adoptopenjdk
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like it should be distro instead of vendor?

@@ -6,8 +6,8 @@
"main": "dist/index.js",
"scripts": {
"build": "ncc build -o dist/setup src/setup-java.ts && ncc build -o dist/cleanup src/cleanup-java.ts",
"format": "prettier --write **/*.ts",
"format-check": "prettier --check **/*.ts",
"format": "prettier --write **/*.ts src/distro/*.ts",
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: I think src/distro/*.ts should be covered by **/*.ts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that was what I thought but for some reason prettier wasn't picking it up

Comment on lines +31 to +42
async function setupVendor(distro: string) {
switch (distro) {
case 'adoptopenjdk':
[jdkFile, version] = await getJavaAdoptOpenJDK(
version,
javaPackage,
arch
);
break;
case 'zulu':
[jdkFile, version] = await getJavaZulu(version, javaPackage);
break;
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest to move this function outside of getJava function to improve readability

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd also echo the "change vendor to distro" and ask to use that everywhere for consistency, including in the code. So this should be setupDistro()...

Comment on lines +10 to +13
const http = new httpm.HttpClient('setup-java', undefined, {
allowRetries: true,
maxRetries: 3
});
Copy link
Contributor

Choose a reason for hiding this comment

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

May be we could use some inheritance here.
We can create base class JavaInstaller and two child classes: AzulInstaller, AdoptInstaller. It would allow us to move some common logic to base class and avoid code duplication.
For example, http initialization could be put to constructor and re-used.

@konradpabjan
Copy link
Collaborator

We've decided to move forward with a v2 version of setup-java that will add support for adoptopenJDK binaries and default to them. I've created a PR with an ADR (architecture decision record), that roughly outlines and documents the roadmap and plans for the v2. Because the default version is changing, a major version update is warranted (v2): #97

A lot of the hard work has already been done in this PR so we can use this once the ADR is accepted. A bit of restructuring will be needed but we'll get this across the finish line 😃

If anyone would like to offer some feedback or suggestions in the ADR, I would greatly appreciate it!

cc @giltene @gdams

@maxim-lobanov
Copy link
Contributor

Closing since V2 was released recently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Offer AdoptOpenJDK in addition to Zulu
4 participants