Do not destroy empty ML model packages in cleanup worker

What does this MR do and why?

Do not destroy empty ML model packages

This change prevents ML model versions being left without a package

Related to #461322 (closed)

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

N/A

How to set up and validate locally

  1. Go to any project
  2. Go to Deploy/Model Registry
  3. Create a model FooGPT1, with a version 1.0.0 and some files.
  4. Delete all the files

At some point package file cleanup worker will delete empty packages, when files are deleted. You can simulate on rails console:

bin/rails c

Packages::CleanupPackageFileWorker.perform_sync

You can run the worker multiple times.

Merge request reports

Loading