Skip to content

Fix job sidebar when artifact access is restricted

What does this MR do and why?

Fix job sidebar when artifact access is restricted

Account for the case where job.artifact can be null/undefined when artifacts:public or artifacts:access is used to restrict access

Changelog: fixed

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Before After
Screenshot_2024-04-02_at_15.52.41 Screenshot_2024-04-02_at_15.52.18

How to set up and validate locally

  1. set up a job with artifacts that your role won't be able to see by setting artifacts:access to none or artifacts:public to false:
potato:
  stage: build
  script:
    - echo 'potato' >> potato.txt
  artifacts:
    access: 'none'
    expose_as: 'potato'
    paths: ['potato.txt']
  1. run that job and navigate to its job log page
  2. verify that the sidebar shows up
  3. verify that the artifacts section is not shown because the artifacts have been access-restricted

Related to #454144 (closed)

Edited by Miranda Fluharty

Merge request reports