Skip to content

Fix deleting job artifact objects

Erick Bajao requested to merge eb-fix-delete-object-final-upload into master

What does this MR do and why?

This fixes deleting job artifact objects that were direct uploaded to its final location.

The fix for this is quite simple. Most of the changes here are to improve test coverage. The delete objects service previously only covered the local storage configuration.

Resolves #419920 (closed)

To read more about the problem, see #419920 (comment 1496155355).

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

  1. Set up a project that has artifacts set to expire in a short time (e.g. 1 min) so you can easily validate the fix.
  2. Run a pipeline.
  3. In the rails console, keep track of the file_final_path of the archive artifact that was generated, and confirm on minio that it exists.
  4. Run another pipeline to unlock the previous artifact so it can be deleted during expiration.
  5. Manually enqueue the cron jobs (http://gdk.test:3000/admin/sidekiq/cron):
    • expire_build_artifacts_worker
    • ci_schedule_delete_objects_worker
  6. Check in minio that the object has been deleted.

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 Michael Kozono

Merge request reports