Keep job expanded while deleting artifact from it
What does this MR do and why?
For #370150 (closed)
This MR preserves the expanded state of the rows in the job artifacts table when an artifact is deleted - without it, the rows all return to their default collapsed state when an artifact is deleted. It accomplishes this by adding a local-only field called _showDetails
to the job stored in the Apollo cache, which is used by the table to determine whether to show the extra row-details
for that row. Then when a row is expanded or collapsed, we update its _showDetails
value in the cache.
Screenshots or screen recordings
before | after |
---|---|
Screen_Recording_2022-11-01_at_13.15.06 | Screen_Recording_2022-11-01_at_13.13.47 |
How to set up and validate locally
echo "Feature.enable(:artifacts_management_page)" | bundle exec rails console
git checkout 370150-keep-job-expanded-when-deleting-artifact
- find/make/import a project with a pipeline with a job that generates more than one artifact
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']
toblerone:
stage: build
script:
- echo 'toblerone' >> toblerone.txt
artifacts:
expose_as: 'toblerone'
paths: ['toblerone.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
CI/CD
=>Artifacts
- expand a job that has more than one artifact
- delete one of its artifacts
- check that the job is still expanded after the delete operation is complete
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.
Edited by Miranda Fluharty