quarkusio / registry.quarkus.io

Quarkus Extension Registry application
https://registry.quarkus.io
Apache License 2.0
10 stars 11 forks source link

/extensions/all endpoint dropping all metadata (including 'unlisted' field) for platform extensions #148

Closed holly-cummins closed 2 years ago

holly-cummins commented 2 years ago

There are around 38 extensions in the quarkus platform with unlisted: true, but the only extensions with an "unlisted" field in https://registry.quarkus.io/client/extensions/all are 2 non-platform extensions.

I've confirmed, for example, at https://mvnrepository.com/artifact/io.quarkus/quarkus-resteasy-server-common/3.0.0.Alpha1, that the yaml does have the unlisted:true, so it looks like the issue is somewhere in the registry code.

holly-cummins commented 2 years ago

On closer inspection, I can see that all of the metadata is missing for the platform extensions.

For example, platform case:

{
    "name" : "SmallRye Mutiny Reactive Streams Operators",
    "description" : "Operators to write Reactive Streams based applications based on Mutiny",
    "artifact" : "io.quarkus:quarkus-mutiny-reactive-streams-operators::jar:3.0.0.Alpha1",
    "origins" : [ "io.quarkus.platform:quarkus-bom-quarkus-platform-descriptor:3.0.0.Alpha1:json:3.0.0.Alpha1" ]
  },

Non-platform case:

   {
    "name" : "Quarkus - Operator SDK",
    "description" : "Quarkus extension for the Java Operator SDK (https://javaoperatorsdk.io)",
    "metadata" : {
      "built-with-quarkus-core" : "2.13.3.Final",
      "extension-dependencies" : [ "io.quarkus:quarkus-arc", "io.quarkus:quarkus-core", "io.quarkus:quarkus-openshift-client", "io.quarkus:quarkus-kubernetes-client", "io.quarkus:quarkus-jackson", "io.quarkus:quarkus-kubernetes", "io.quarkus:quarkus-kubernetes-client-internal", "io.quarkus:quarkus-container-image", "io.quarkus:quarkus-container-image-jib", "io.quarkus:quarkus-smallrye-health", "io.quarkus:quarkus-vertx-http", "io.quarkus:quarkus-mutiny", "io.quarkus:quarkus-smallrye-context-propagation", "io.quarkus:quarkus-vertx", "io.quarkus:quarkus-netty", "io.quarkus:quarkus-jsonp" ],
      "categories" : [ "cloud" ],
      "keywords" : [ "operator", "kubernetes", "openshift" ]
    },
    "artifact" : "io.quarkiverse.operatorsdk:quarkus-operator-sdk::jar:4.0.5",
    "origins" : [ "io.quarkus.registry:quarkus-non-platform-extensions:2.13.3.Final:json:1.0-SNAPSHOT" ]
  }
holly-cummins commented 2 years ago

@gastaldi has had a peek into the backing data, and it looks like the metadata is in the database, so the problem is getting it out, not putting it in.

For example, he's found


{"built-with-quarkus-core":"3.0.0.Alpha1","keywords":["swagger-ui","openapi"],"extension-dependencies":["io.quarkus:quarkus-core","io.quarkus:quarkus-vertx-http","io.quarkus:quarkus-mutiny","io.quarkus:quarkus-smallrye-context-propagation","io.quarkus:quarkus-vertx","io.quarkus:quarkus-netty","io.quarkus:quarkus-arc"],"guide":"https://quarkus.io/guides/openapi-swaggerui","status":"stable","unlisted":true}
in the `metadata` column in the `platform_extension` table
holly-cummins commented 2 years ago

The cause is that metadata for platform extensions lives in the PlatformExtension object, not in the ExtensionRelease object. So if we only look in ExtensionRelease, we will miss metadata. The reason for this is that an extension's metadata could, in principle, be different for each platform. This doesn't make things totally easy for the client-side API, which only has a single metadata object. We need to collapse in some way, so I will merge.

holly-cummins commented 1 year ago

I've raised https://github.com/quarkusio/extensions.quarkus.io/issues/24 for the conflict resolution where different platforms have different values. It affects both the extensions ui and the registry, but I raised the issue on the UI since I think we should decide what we want to show and then work backwards to how we deliver it from the backend.