Add browseArtifactsPath to GraphQL CiJob
What does this MR do and why?
This MR adds a browseArtifactsPath
to the GraphQL CiJob
type so we can use it in the artifacts management page to link from a job to page where the user can browse the job's artifacts.
Screenshots or screen recordings
How to set up and validate locally
- run a pipeline in a project that generates artifacts
use this CI yaml to generate some sample artifacts
# .gitlab-ci.yml
potato:
stage: build
script:
- echo 'potato' >> potato.txt
artifacts:
expose_as: 'potato'
paths: ['potato.txt']
tomato:
stage: build
script:
- echo 'tomato' >> tomato.txt
artifacts:
expose_as: 'tomato'
paths: ['tomato.txt']
pineapple:
stage: build
script:
- echo 'pineapple' >> pineapple.txt
artifacts:
expose_as: 'pineapple'
paths: ['pineapple.txt']
apple:
stage: build
script:
- echo 'apple' >> apple.txt
artifacts:
expose_as: 'apple'
paths: ['apple.txt']
toblerone:
stage: build
script:
- echo 'toblerone' >> toblerone.txt
artifacts:
expose_as: 'toblerone'
paths: ['toblerone.txt']
git checkout 33418-artifacts-view-browse-path
- use GraphiQL (
http://gdk.test:3000/-/graphql-explorer
) to query for job artifacts:
query getJobArtifacts {
project(fullPath: "path/to/project") {
jobs(statuses: [SUCCESS, FAILED]) {
nodes {
__typename
id
artifactsBrowsePath
}
}
}
}
- check that the
browseArtifactsPath
for each job looks something like/path/to/project/project-name/-/jobs/123/artifacts/browse
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #33418 (closed)
Edited by Miranda Fluharty