Skip to content

Add artifacts bulk delete

What does this MR do and why?

Feature issue: #33348 (closed)
Rollout issue: #398581 (closed)

This MR removes the ci_job_artifact_bulk_destroy feature flag to fully enable the bulk delete feature on the artifacts page.

This feature should only be visible if you have the maintainer or higher role for the project.

Screenshots or screen recordings

Before After
Screenshot_2023-05-31_at_3.38.36_PM artifacts can only be deleted individually Screenshot_2023-05-31_at_3.39.25_PM artifacts can be selected using checkboxes and deleted all at once

How to set up and validate locally

  1. find/make a project that generates artifacts (one where you have at least the maintainer role)
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']
  1. run a few pipelines in the project
  2. navigate to the project, and in the sidebar choose CI/CD => Artifacts (or Build => Artifacts in the new sidebar)
  3. checkboxes should appear next to each job (and next to each artifact file within each job) that allow you to select artifacts for deletion

to run tests

# run rspec tests
bundle exec rspec spec/requests/api/graphql/mutations/ci/job_artifact/bulk_destroy_spec.rb

# generate fixture
bundle exec rspec spec/frontend/fixtures/job_artifacts.rb

# run jest tests
yarn install && yarn jest ci/artifacts

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Miranda Fluharty

Merge request reports