artifacthub / hub

Find, install and publish Cloud Native packages
https://artifacthub.io
Apache License 2.0
1.62k stars 220 forks source link

docker label io.artifacthub.package.readme-url not working for github #3975

Closed jon-nfc closed 1 month ago

jon-nfc commented 1 month ago

Describe the bug

Artifact hub is reporting required metadata field not provided: io.artifacthub.package.readme-url which is incorrect.

navigating to https://raw.githubusercontent.com/nofusscomputing/centurion_erp/development/README.md does indeed return the markdown in plain text, however Github appears to be loading js as well. Unknown if the latter is causing the issue.

The image does contain the required tags. only change from working to not working is adjustment to the readme-url from gitlab raw to github raw.

To Reproduce Steps to reproduce the behavior:

  1. using nofusscomputing/centurion-erp:dev as container on artifacthub
  2. artifacthub reports required metadata field not provided: io.artifacthub.package.readme-url

Expected behavior A clear and concise description of what you expected to happen.

that the image be processed

Screenshots If applicable, add screenshots to help explain your problem.

Screenshot from 2024-08-11 14-45-40

Screencast from 2024-08-11 14-53-57.webm

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

from image docker inspect nofusscomputing/centurion-erp:dev


            "Labels": {
                "io.artifacthub.package.license": "MIT",
                "io.artifacthub.package.maintainers": "[{\"name\":\"No Fuss Computing\",\"email\":\"helpdesk@nofusscomputing.com\"}]",
                "io.artifacthub.package.readme-url": "https://raw.githubusercontent.com/nofusscomputing/centurion_erp/development/README.md",
                "org.opencontainers.image.created": "2024-08-10T11:23:34+00:00",
                "org.opencontainers.image.description": "An ERP with a focus on ITSM and automation",
                "org.opencontainers.image.revision": "40e3078a5838277d54a75c7211cd0700ec467108",
                "org.opencontainers.image.source": "https://github.com/nofusscomputing/centurion_erp",
                "org.opencontainers.image.title": "Centurion ERP",
                "org.opencontainers.image.vendor": "No Fuss Computing"
            }
tegioz commented 1 month ago

Hi @jon-nfc

Metadata for container images can be provided in different ways depending on if the image has an index or the manifest format used:

(from https://artifacthub.io/docs/topics/repositories/container-images/)

metadata

At the moment your situation is the highlighted one.

(no annotations at the index level)

% crane manifest nofusscomputing/centurion-erp:dev | jq                                    
{
  "schemaVersion": 2,
  "mediaType": "application/vnd.oci.image.index.v1+json",
  "manifests": [
    {
      "mediaType": "application/vnd.oci.image.manifest.v1+json",
      "digest": "sha256:0de931eb7db5b5fdff0d34d94554631c35f2846464ab17446455f91dd5097a03",
      "size": 2925,
      "platform": {
        "architecture": "amd64",
        "os": "linux"
      }
    },
    {
      "mediaType": "application/vnd.oci.image.manifest.v1+json",
      "digest": "sha256:4491e003b4e96ecc6a446c2ff3fe559b5a36fce858c377a3b2ecaa4cd37d483d",
      "size": 2925,
      "platform": {
        "architecture": "arm64",
        "os": "linux"
      }
    }
  ]
}

(annotations found in the image)

~ % crane manifest --platform linux/amd64 nofusscomputing/centurion-erp:dev | jq .annotations
{
  "org.opencontainers.image.created": "2024-08-12T06:02:21+00:00",
  "org.opencontainers.image.description": "a DESCRIPTION for multi-arch images",
  "org.opencontainers.image.revision": "9d5464b5a989f5095a099fcb081a9422b576cefa",
  "org.opencontainers.image.source": "https://github.com/nofusscomputing/centurion_erp"
}

(labels found in the image)

~ % crane config --platform linux/amd64 nofusscomputing/centurion-erp:dev | jq .config.Labels
{
  "io.artifacthub.package.license": "MIT",
  "io.artifacthub.package.maintainers": "[{\"name\":\"No Fuss Computing\",\"email\":\"helpdesk@nofusscomputing.com\"}]",
  "io.artifacthub.package.readme-url": "https://raw.githubusercontent.com/nofusscomputing/centurion_erp/development/README.md",
  "org.opencontainers.image.created": "2024-08-12T06:02:21+00:00",
  "org.opencontainers.image.description": "An ERP with a focus on ITSM and automation",
  "org.opencontainers.image.revision": "9d5464b5a989f5095a099fcb081a9422b576cefa",
  "org.opencontainers.image.source": "https://github.com/nofusscomputing/centurion_erp",
  "org.opencontainers.image.title": "Centurion ERP",
  "org.opencontainers.image.vendor": "No Fuss Computing"
}

In this case, as described in the docs, annotations take precedence. They are not merged, but even if they were, the result probably wouldn't be the expected one, as the description used would be the one present in the annotations.

Hope this helps 🙂

jon-nfc commented 1 month ago

ah, thanks. missed that!