Fix disco client JDK download action#8682
Conversation
There was a problem hiding this comment.
We should probably look at upgrading Disco Client?
This looks like foojayio/discoclient@6825e2c
Not against making this change too, if we're sure it's the right approach, but probably better to change the method name to match the delegated API.
|
upgrading made no difference, the exception was just different |
ephemeral id stopped working for some reason, but I noticed that it had the same value as the regular id field. Using getPkgInfoByPkgId() which uses the regular id does appear to work.
3ac1884 to
0e18f08
Compare
neilcsmith-net
left a comment
There was a problem hiding this comment.
OK, thanks for confirming. The JSON passed into the Pkg constructor doesn't seem to have an ephemeral ID, which that commit looks to fix, but I guess the resulting query still doesn't work either. Other methods in DiscoClient are odd in that some use ephemeral IDs with API v3 only and some only without API v3. The paths for them don't seem to be in the API docs for the service either?!
Thanks for the method name change.
|
here the reproducer replicating the calls outside of NB for anyone interested Details DiscoClient client = new DiscoClient();
Distribution distribution = client.getDistributions()
.stream()
.filter(d -> d.getName().equalsIgnoreCase("zulu"))
.findFirst()
.get();
System.out.println("dist: "+distribution);
List<Pkg> pkgs = client.getPkgs(
List.of(distribution),
VersionNumber.fromText("21"),
Latest.NONE,
OperatingSystem.LINUX,
LibCType.NONE,
Architecture.NONE,
Bitness.NONE,
ArchiveType.NONE,
PackageType.JDK,
Boolean.FALSE,
Boolean.TRUE,
List.of(ReleaseStatus.GA, ReleaseStatus.EA),
TermOfSupport.LTS,
List.of(Scope.PUBLIC),
null
);
for (Pkg pkg : pkgs) {
System.out.println("pkg: "+pkg);
// on 21.0.1 and 2.0.39: Exception in thread "main" java.lang.NullPointerException: Cannot invoke "com.google.gson.JsonArray.size()" because "jsonArray" is null
// on 2.0.24: Exception in thread "main" java.lang.IllegalArgumentException: ephemeralId or javaVersion cannot be null
System.out.println("info: "+client.getPkgInfoByEphemeralId(pkg.getEphemeralId(), pkg.getJavaVersion()));
} |
|
Good morning Michael (not brother from Adam), I will test it immediately. Thanks for support. |
|
Workaround steps:
|
|
something changed in the endpoint over night so the download is currently failing with rc2 too unfortunately. Running #8682 (comment) against 2.0.39 would work though as of "right now" since it uses a different version of the REST api. (this PR is still needed since ephemeral ids would also not work with 2.0.39) |
|
Added a PR to update to use the v3 REST API. The legacy v2 API seems to be unstable. |
ephemeral id stopped working for some reason, but I noticed that it had the same value as the regular id field.
Using
getPkgInfoByPkgId()which uses the regular id does appear to work.how to test:
try to download a JDK using the java platform manager. It would fail during the download step.
targets delivery