Disable browse button when job has no metadata.gz or no artifacts
What does this MR do and why?
For #378959 (closed), #388848 (closed)
This MR disables the browse button next to a job on the artifacts page (CI/CD
> Artifacts
) if the job has no metadata.gz
file, because the metadata.gz
file holds the data used to render the page that the browse button links to.
Screenshots or screen recordings
before | with this MR |
---|---|
browse button enabled even when there's no metadata.gz for that job, leads to 404 |
browse button disabled when there's no metadata.gz for that job |
How to set up and validate locally
git checkout 378959-disable-browse-if-no-metadata
- find/make a project with a pipeline that generates artifacts
you can 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']
- run some pipelines to generate some artifacts
- navigate to the project and choose
CI/CD
=>Artifacts
in the sidebar (orBuild
=>Artifacts
in the new sidebar) - each job's browse button should be dependent on the presence of an artifact file called
metadata.gz
- if a job has a
metadata.gz
file, clicking its browse button should take you to the browse page - if a job has no
metadata.gz
file, its browse button should be disabled
- if a job has a
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
If you delete a job's metadata.gz
but don't reload the page, does the browse button still get disabled for that job?
yes:
Screen_Recording_2023-05-23_at_12.48.38
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Miranda Fluharty