Follow-up from "Remove security findings periodically"
The following discussion from !44336 (merged) should be addressed:
-
@mbobin started a discussion: (+1 comment) @minac @lulalala I think there are a few of major problems here:
- It will not break the loop until the timeout or limit is reached. This is not ideal because it will do unnecessary loops.
- In the loop it used like
destroy_batch(Ci::JobArtifact) || destroy_batch(Ci::PipelineArtifact)and because it returns always true, thedestroy_batch(Ci::PipelineArtifact)is never called. - Because
destroy_batchacceptsCi::PipelineArtifactfor destruction it means that it means thatrun_after_destroywill most likely fail when it will receive a pipeline artifact.
I came across this change because it conflicted with the work that I'm doing for https://gitlab.com/gitlab-org/gitlab/-/issues/233939 in !42242 (merged)