foojayio / discoapi

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

Zulu Prime JREs miscategorised as JDKs #94

Open JackPGreen opened 5 months ago

JackPGreen commented 5 months ago

Take this request, which queries for package_type=jdk, but one of the results is:

"package_type": "jdk",
"filename": "zing24.01.0.0-4-jre17.0.10-linux_x64.tar.gz",

I.E. not a JDK, actually a JRE.

This looks to happen for other Zulu Prime versions as well.

Full request response:

{
  "result": [
    {
      "id": "9c5236e6bdb708a7e7c229f14dde4473",
      "archive_type": "tar.gz",
      "distribution": "zulu_prime",
      "major_version": 17,
      "java_version": "17.0.10+7",
      "distribution_version": "24.1",
      "jdk_version": 17,
      "latest_build_available": true,
      "release_status": "ga",
      "term_of_support": "lts",
      "operating_system": "linux",
      "lib_c_type": "glibc",
      "architecture": "x64",
      "fpu": "unknown",
      "package_type": "jdk",
      "javafx_bundled": false,
      "directly_downloadable": true,
      "filename": "zing24.01.0.0-4-jre17.0.10-linux_x64.tar.gz",
      "links": {
        "pkg_info_uri": "https://api.foojay.io/disco/v3.0/ids/9c5236e6bdb708a7e7c229f14dde4473",
        "pkg_download_redirect": "https://api.foojay.io/disco/v3.0/ids/9c5236e6bdb708a7e7c229f14dde4473/redirect"
      },
      "free_use_in_production": true,
      "tck_tested": "unknown",
      "tck_cert_uri": "",
      "aqavit_certified": "unknown",
      "aqavit_cert_uri": "",
      "size": 139615096,
      "feature": []
    },
    {
      "id": "df81636b87e993bca6a57b61d4d43893",
      "archive_type": "tar.gz",
      "distribution": "zulu_prime",
      "major_version": 17,
      "java_version": "17.0.10+7",
      "distribution_version": "24.1",
      "jdk_version": 17,
      "latest_build_available": true,
      "release_status": "ga",
      "term_of_support": "lts",
      "operating_system": "linux",
      "lib_c_type": "glibc",
      "architecture": "x64",
      "fpu": "unknown",
      "package_type": "jdk",
      "javafx_bundled": false,
      "directly_downloadable": true,
      "filename": "zing24.01.0.0-4-jdk17.0.10-linux_x64.tar.gz",
      "links": {
        "pkg_info_uri": "https://api.foojay.io/disco/v3.0/ids/df81636b87e993bca6a57b61d4d43893",
        "pkg_download_redirect": "https://api.foojay.io/disco/v3.0/ids/df81636b87e993bca6a57b61d4d43893/redirect"
      },
      "free_use_in_production": true,
      "tck_tested": "unknown",
      "tck_cert_uri": "",
      "aqavit_certified": "unknown",
      "aqavit_cert_uri": "",
      "size": 311739932,
      "feature": []
    }
  ],
  "message": "2 package(s) found"
}
JackPGreen commented 5 months ago

It looks like in ZuluPrime#getAllPkgs, it's hard coded to assume pkg.setPackageType(JDK).

I'd guess a simple solution would be something like pkg.setPackageType(filename.contains("jre") ? JRE : JDK) as done elsewhere, but I'm not able to run the project to test this.

HanSolo commented 5 months ago

Will take a look at it, thx for reporting

HanSolo commented 5 months ago

Found 23 wrong packages and removed them, so they should be added with the next update run after the deployment will be done, so probably by tomorrow all packages should be back again with the correct package type.

JackPGreen commented 5 months ago

@HanSolo this had been fixed but is happening again?

HanSolo commented 5 months ago

Darn...did another deployment yesterday and probably have a regression here...will take a look...thx for the heads up

HanSolo commented 5 months ago

Deployment is ongoing...should be fixed in around 2 hours (fingers crossed :))

JackPGreen commented 5 months ago

Deployment is ongoing...should be fixed in around 2 hours (fingers crossed :))

Still showing 2 package results unfortunately.

HanSolo commented 5 months ago

Now this is interesting...on the staging and testing environment it doesn't show the wrong pkgs but on production it does...hmm...need to take a closer look why this happens

JackPGreen commented 5 months ago

This is now showing one package - fixed or intermittent?