Fix deleting job artifact objects
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
- 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.
- Run a pipeline.
- 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. - Run another pipeline to unlock the previous artifact so it can be deleted during expiration.
- Manually enqueue the cron jobs (
http://gdk.test:3000/admin/sidekiq/cron
):expire_build_artifacts_worker
ci_schedule_delete_objects_worker
- 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.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Michael Kozono