Improve dangling packages observability
🔥 Problem
In !80386 (closed), we introduced a way to quickly "disconnect" packages from a project. This was done to improve project destruction execution times.
By disconnecting a package, we create dangling packages: Packages that are not part of any project but still count towards object storage usage.
To mitigate this, we also updated app/workers/packages/cleanup_package_registry_worker.rb
to properly remove those dangling packages.
This worker could log the amount of dangling packages before processing them. This would allow us to improve the current Package cleanup dashboard(internal)
🚒 Solution
- Log the amount of dangling packages using
log_extra_metadata_on_done
-
⚠ A database review is needed as this is a new query. The existing one simply checks if dangling packages exist but with this issue we need to know the actual count.