Skip to content

Use DestroyBatchService when erasing build trace and job artifacts

Albert requested to merge 369132-use-destroy-batch-service into master

What does this MR do and why?

Use DestroyBatchService to delete job artifacts in JobsController#erase and API projects/:id/jobs/:job_id/erase.

This is to make all job artifacts deletion consistent, using DestroyBatchService, regardless where the deletion is initiated.

How to set up and validate locally

  1. Create a project with pipeline that generates artifact and run the pipeline once.
test-job:
  script:
    - echo "test" > output.txt
  artifacts:
    paths:
      - output.txt
  1. Go to the job page and click on "Erase job log and artifacts"

Screenshot_2022-09-06_at_11.23.21_AM

  1. Validate that the job log and artifacts have been erased, with a record of the user and timestamp.

Screenshot_2022-09-06_at_11.21.37_AM

  1. Do the same through the API POST: /api/v4/projects/:id/jobs/:job_id/erase and validate.

MR acceptance checklist

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

Related to #369132 (closed)

Edited by Albert

Merge request reports