Refetch job list when an artifactless job remains
What does this MR do and why?
Refetch job list when an artifactless job remains
When artifacts are deleted from the artifacts page in a way that leaves a job with no artifacts in the list, refetch the list of jobs
Changelog: changed
Screenshots or screen recordings
Scenario | Before | After |
---|---|---|
delete artifacts in a way that leaves an empty job |
Screen_Recording_2024-02-27_at_15.56.20 job remains on page, displays 0 files |
Screen_Recording_2024-04-29_at_17.12.42 list of jobs reloads, empty job(s) disappear |
delete artifacts in a way that each job still has some artifacts |
Screen_Recording_2024-02-27_at_16.19.45 list is not reloaded |
Screen_Recording_2024-04-29_at_17.12.03 no change |
How to set up and validate locally
git checkout 415927-refetch-artifacts-on-delete
- find/make/import a project with a pipeline with a job 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 a pipeline for that project - for this you'll need to set up a local runner for GDK or enable runners in gitpod
- navigate to the project, and in the sidebar select
Build
=>Artifacts
- delete all artifact files from one or more of the jobs
- the list of jobs should refetch so that any now-empty jobs disappear (and if >20 jobs are present, are replaced by jobs from the next page)
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 #415927
Edited by Miranda Fluharty