Skip to content

Add additional data to Release GraphQL endpoint

What does this MR do?

This MR is a follow-up to !30753 (merged). It exposes the Release assets property through the GraphQL endpoint.

Feature flag

Like !30753 (merged), this data is hidden behind a graphql_release_data feature flag, which is disabled by default.

Example query/response

Click to expand query
{
  project(fullPath: "root/release-test") {
    release(tagName: "v16.4") {
      assets {
        assetsCount
        evidenceFileUrl
        links {
          nodes {
            id
            name
            url
            external
          }
        }
        sources {
          nodes {
            url
            format
          }
        }
      }
    }
  }
}

When the user has full access to Releases data

For example, when the project is public, or if the project is private, when the user is a Developer or higher.

Click to expand response
{
  "data": {
    "project": {
      "release": {
        "assets": {
          "assetsCount": 5,
          "evidenceFileUrl": "http://0.0.0.0:3001/root/release-test/-/releases/v16.4/evidences/23.json",
          "links": {
            "nodes": [
              {
                "id": "gid://gitlab/Releases::Link/6",
                "name": "Type definitions",
                "url": "https://google.com",
                "external": true
              }
            ]
          },
          "sources": {
            "nodes": [
              {
                "url": "http://0.0.0.0:3001/root/release-test/-/archive/v16.4/release-test-v16.4.zip",
                "format": "zip"
              },
              {
                "url": "http://0.0.0.0:3001/root/release-test/-/archive/v16.4/release-test-v16.4.tar.gz",
                "format": "tar.gz"
              },
              {
                "url": "http://0.0.0.0:3001/root/release-test/-/archive/v16.4/release-test-v16.4.tar.bz2",
                "format": "tar.bz2"
              },
              {
                "url": "http://0.0.0.0:3001/root/release-test/-/archive/v16.4/release-test-v16.4.tar",
                "format": "tar"
              }
            ]
          }
        }
      }
    }
  }
}

When the user has partial access to Release data

For example, when the project is private and the user has Guest permissions.

Click to expand response
{
  "data": {
    "project": {
      "release": {
        "assets": {
          "assetsCount": 5,
          "evidenceFileUrl": "http://0.0.0.0:3001/root/release-test/-/releases/v16.4/evidences/23.json",
          "links": {
            "nodes": [
              {
                "id": "gid://gitlab/Releases::Link/6",
                "name": "Type definitions",
                "url": "https://google.com",
                "external": true
              }
            ]
          },
          "sources": {
            "nodes": []
          }
        }
      }
    }
  }
}

When the user has no access to Release data

For example, when the project is private and the user is a public user

Click to expand response
{
  "data": {
    "project": null
  }
}

Related to: #208702 (closed), #208724 (closed), !27448 (closed), !27614 (closed), !30753 (merged)

Edited by Alex Kalderimis

Merge request reports