Skip to content

Add Helm metadata to GraphQL

Mathieu Parent requested to merge sathieu/gitlab:helm_graphql into master

What does this MR do and why?

Fixes: #336548 (closed).

Example query:

query {
  package(id: "gid://gitlab/Packages::Package/1") {
    id
    name
    version
    project {
      id
      fullPath
    }
    packageFiles {
      nodes {
        id
        fileName
        fileMetadata {
          ... on HelmFileMetadata {
            
            channel
            metadata {
              annotations
              appVersion
              condition
              deprecated
              description
              home
              icon
              kubeVersion
              tags
              type
              apiVersion
              dependencies {
                name
                version
                repository
                condition
                tags
                enabled
                importValues
                alias
              }
              keywords
              maintainers {
                name
              }
              sources
              version
            }
          }
        }
      }
    }
  }
}

And result:

{
  "data": {
    "package": {
      "id": "gid://gitlab/Packages::Package/1",
      "name": "package-1",
      "version": "v1.0.1",
      "project": {
        "id": "gid://gitlab/Project/6",
        "fullPath": "flightjs/Flight"
      },
      "packageFiles": {
        "nodes": [
          {
            "id": "gid://gitlab/Packages::PackageFile/1",
            "fileName": "package-1-v1.0.1.tgz",
            "fileMetadata": {
              "channel": "stable",
              "metadata": {
                "annotations": null,
                "appVersion": null,
                "condition": null,
                "deprecated": null,
                "description": null,
                "home": null,
                "icon": null,
                "kubeVersion": null,
                "tags": null,
                "type": null,
                "apiVersion": "v2",
                "dependencies": [
                  {
                    "name": "gatekeeper",
                    "version": "3.6.0",
                    "repository": "https://open-policy-agent.github.io/gatekeeper/charts",
                    "condition": null,
                    "tags": null,
                    "enabled": null,
                    "importValues": [
                      "foo",
                      {
                        "child": "bar",
                        "parent": "baz"
                      }
                    ],
                    "alias": null
                  }
                ],
                "keywords": null,
                "maintainers": null,
                "sources": null,
                "version": "v1.0.1"
              }
            }
          }
        ]
      }
    }
  }
}
Edited by Mathieu Parent

Merge request reports