AdoptOpenJDK / openjdk-api

DEPRECATED and replaced by of https://github.com/AdoptOpenJDK/openjdk-api-v3 - See README
https://api.adoptopenjdk.net/README
Apache License 2.0
15 stars 15 forks source link

api returning incorrect build for latest #175

Closed lumpfish closed 5 years ago

lumpfish commented 5 years ago

A new release jdk-11.0.4+11.2 was recently created for hotspot and openj9 builds. The openj9 build release name is jdk-11.0.4+11.2_openj9-0.15.1. However, the new release is not returned as 'latest' via the API - https://api.adoptopenjdk.net/v2/info/releases/openjdk11?release=latest&os=mac&arch=x64&openjdk_impl=openj9&type=jdk&heap_size=normal

The new build is returned OK for the hotspot build: https://api.adoptopenjdk.net/v2/info/releases/openjdk11?release=latest&os=mac&arch=x64&openjdk_impl=hotspot&type=jdk&heap_size=normal

Asking for all builds (or viewing via the website) - https://api.adoptopenjdk.net/v2/info/releases/openjdk11?os=mac&arch=x64&openjdk_impl=openj9&type=jdk&heap_size=normal shows the new release listed as #5 and the previous release is #6.

So I infer that the releases are returned ordered by release name, that the insertion of the ".2" in the release name means the new release collates ahead of the previous release, and the api notion of 'latest' is simply 'last in list'.

Looks like the collation needs to be more sophisticated (e.g. based on release date?)

lumpfish commented 5 years ago

Unfortunately https://github.com/AdoptOpenJDK/openjdk-api/pull/176 does not appear to have fixed this issue - https://api.adoptopenjdk.net/v2/info/releases/openjdk11?release=latest&os=mac&arch=x64&openjdk_impl=openj9&type=jdk&heap_size=normal still returns the jdk-11.0.4+11_openj9-0.15.1 build, not the jdk-11.0.4+11.2_openj9-0.15.1 build.

karianna commented 5 years ago

@ParkerM would you be able to patch this again?

ParkerM commented 5 years ago

Hm that's funky, yeah I'll take another look later today 👍.

ParkerM commented 5 years ago

Ah, the data was getting re-sorted further down the chain using an outdated comparison function. I think this is fixed now in #177.