foojayio / discoapi

The foojay discovery api (discoapi) is made to discover java packages (jre/jdk) from different distributions.
GNU General Public License v2.0
106 stars 12 forks source link

Filtering `graalvm_community` for `jdk_version` does not seem to work correctly #77

Closed sschuberth closed 1 year ago

sschuberth commented 1 year ago

https://api.foojay.io/disco/v3.0/packages?distro=graalvm_community returns entries with jdk_version: 20, but https://api.foojay.io/disco/v3.0/packages?distro=graalvm_community&jdk_version=20 returns "No package(s) found".

HanSolo commented 1 year ago

The jdk_version parameter alone is not enough to specify the packages, please try something like: https://api.foojay.io/disco/v3.0/packages?distro=graalvm_community&version=20&latest=available

fniephaus commented 1 year ago

@HanSolo shouldn't this then show an error that says that latest is required when jdk_version is used and vice versa? :)

sschuberth commented 1 year ago

The jdk_version parameter alone is not enough to specify the packages

Interesting. I was coming from the request generated here, seeing that it yields no results for graalvm_community, but does e.g. for temurin. Also, e.g. https://api.foojay.io/disco/v3.0/packages?distro=temurin&jdk_version=20 just works. Is this expected?

HanSolo commented 1 year ago

Well…jdk_version was only introduced because of the different versioning in the former graalvm distributions. Originally disco was only planned for OpenJDK distributions. You should use version instead.

sschuberth commented 1 year ago

You should use version instead.

Just to clarify: Will also requesting old "GraalVM CE 8 X"-style distributions work when using version instead of jdk_version?

sschuberth commented 1 year ago

jdk_version was only introduced because of the different versioning in the former graalvm distributions.

Also, as in the old GraalVM versioning the JDK version is part of the distribution name (like "graalvm_ce11"), what's the jdk_version needed for at all?

sschuberth commented 1 year ago

You should use version instead.

Just to clarify: Will also requesting old "GraalVM CE 8 X"-style distributions work when using version instead of jdk_version?

To answer this myself: No, it doesn't. I'm now conditionally using jdk_version for "GraalVM CE 8 X"-style distributions, and version for anything else (including "GraalVM Community" distributions).

So, now that I understand that graalvm_community should be filtered via version, I'm closing this as invalid.