Skip to content

Draft: Add artifacts node with downloadPath

rossfuhrman requested to merge 251015-add-artifacts into master

What does this MR do?

This work is in support of #251015 (closed)

It attempts to add artifacts and their download path to the securityReportTypes GraphQL query.

Example request:

{
  project(fullPath: "root/foo") {
    mergeRequest(iid: "6") {
      headPipeline {
        jobs(securityReportTypes: [SAST, DEPENDENCY_SCANNING, SECRET_DETECTION]) {
          nodes {
            name
            artifacts(types: [SAST, DEPENDENCY_SCANNING, SECRET_DETECTION]) {
              nodes {
                downloadPath
              }
            }
          }
        }
      }
    }
  }
}

Example response:

{
  "data": {
    "project": {
      "mergeRequest": {
        "headPipeline": {
          "jobs": {
            "nodes": [
              {
                "name": "bandit-sast",
                "artifacts": {
                  "nodes": [
                    {
                      "downloadPath": "https://some.url/1284"
                    }
                  ]
                }
              },
              {
                "name": "bandit-sast",
                "artifacts": {
                  "nodes": [
                    {
                      "downloadPath": "https://some.url/1282"
                    }
                  ]
                }
              },
              {
                "name": "secret_detection",
                "artifacts": {
                  "nodes": [
                    {
                      "downloadPath": "https://some.url/1283"
                    }
                  ]
                }
              }
            ]
          }
        }
      }
    }
  }
}

Screenshots (strongly suggested)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Related to #251015 (closed)

Edited by rossfuhrman

Merge request reports