Skip to content

Persists container_registry_size and adds container_registry_size in storage_size

What does this MR do and why?

Persists container_registry_size and adds container_registry_size in storage_size

Ref: https://gitlab.com/gitlab-org/gitlab/-/issues/358389

Screenshots or screen recordings

How to set up and validate locally

Firstly, ensure you have a Namespace with an associated RootStorageStatistics:

  namespace = Namespace.last
  stats = namespace.root_storage_statistics

All Namespace should have an associated statistics record, but if not you can build one with:

  stats = namespace.build_root_storage_statistics

Quick method:

  1. Modify Namespace#container_repositories_size to return an integer, e.g.

    def container_repositories_size
      35
    end
  2. Comment the feature_flag within Namespace::RootStorageStatistics#attributes_for_container_registry_size

  3. Test that the statistics get updated accordingly:

      > stats.container_registry_size
      => 0
    
      > stats.recalculate!
      > stats.container_registry_size
      => 35

Full integration method:

  1. Follow the Container Registry setup steps described in !83980 (merged)
  2. Perform step 2,3 of the Quick method above

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 Suraj Tripathi

Merge request reports