Skip to content

Add JobArtifactType with downloadPath field

Avielle Wolfe requested to merge 251015-artifact-download into master

What does this MR do?

Adds GraphQL functionality that will be used to allow users to download security reports generated by CI jobs.

  • Adds artifacts connection of type JobArtifactType to JobType
  • Adds JobArtifactType with a downloadPath field and a fileType field

Example query

Query: this is the actual query the frontend will be making for the first feature this work will support

{
  project(fullPath: "project-full-path") {
    mergeRequest(iid: "the-mr-iid") {
      headPipeline {
        jobs(reportTypes: [FUZZING, SAST, COBERTURA]) {
          nodes {
            artifacts {
              nodes {
                downloadPath
              }
            }
          }
        }
      }
    }
  }
}

Result:

{
  "data": {
    "project": {
      "pipelines": {
        "nodes": [
          {
            "jobs": {
              "nodes": [
                {
                  "name": "rspec:osx",
                  "artifacts": {
                    "nodes": [
                      {
                        "downloadPath": "/flightjs/flight/-/jobs/214/artifacts/download?file_type=junit"
                      }
                    ]
                  }
                }
              ]
            }
          }
        ]
      }
    }
  }
}

Issue

This is the final MR for #251015 (closed)

Edited by rossfuhrman

Merge request reports