Artifacts: Make browse button work at job level

What does this MR do and why?

For #33418 (closed) / #370151

This MR makes the browse button for a job in the artifacts table work 🎉

We added browseArtifactsPath to graphql in !99276 (merged), now we can make the button take you to the browse page.

Screenshots or screen recordings

Screen_Shot_2022-10-21_at_17.12.57

How to set up and validate locally

  1. git checkout 370151-browse-archive-artifacts
  2. echo "Feature.enable(:artifacts_management_page)" | bundle exec rails console
  3. set up a local runner for GDK or enable runners in gitpod
  4. find/make a project in your chosen environment where you can run a pipeline that generates artifacts
use this CI yaml to generate some sample artifacts to manage:
# .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']
  1. run some pipelines in the project
  2. navigate to the project, then in the sidebar select CI/CD => Artifacts
  3. click on the browse button (the one with the folder icon) next to a job and verify that it takes you to the browse page for artifacts generated by that job
    • the URL should be something like /-/jobs/[job id]/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.

Related to

Edited by Miranda Fluharty

Merge request reports

Loading