Limit selected artifacts to 50
What does this MR do and why?
For #33348 (closed)
artifacts_management_page
and ci_job_artifact_bulk_destroy
feature flags.
This MR caps the number of artifacts that can be selected at 50 to match the maximum number of artifacts that the bulkDestroyJobArtifacts
mutation can handle (see JOB_ARTIFACTS_COUNT_LIMIT
).
Screenshots or screen recordings
note: This recording was taken with SELECTED_ARTIFACTS_MAX_COUNT
set to 10
Screen_Recording_2023-04-14_at_17.13.09
How to set up and validate locally
-
echo "Feature.enable(:artifacts_management_page)" | bundle exec rails console
to show the artifacts page (and the link to it in the sidebar) -
echo "Feature.enable(:ci_job_artifact_bulk_destroy)" | bundle exec rails console
to enable more than one artifact to be deleted at once git checkout 33348-limit-number-of-artifacts-that-can-be-selected
- 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']
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
- select 50 artifacts OR edit
SELECTED_ARTIFACTS_MAX_COUNT
inapp/assets/javascripts/ci/artifacts/constants.js
to make it a lower number and select that many artifacts - an alert should appear at the top of the page
- you should able to un-check artifacts, but be unable to select any more artifacts (unselected artifacts' checkboxes should be disabled, but selected artifacts' checkboxes should still be enabled)
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