Skip to content

Add container registry to Namespace usage quotas page

What does this MR do and why?

Displays Container Registry Size in usage quotas pages of namespaces and groups.

Related to #356187 (closed)

Screenshots or screen recordings

before after
localhost_3000_groups_gitlab-instance-60b25789_-usage_quotas__1 localhost_3000_groups_gitlab-instance-60b25789_-usage_quotas__2

How to set up and validate locally

  1. Open a Rails console (rails c) and find a namespace to test the feature on (I used "gitlab-instance" group):
    Groups.all # will show you a list of groups, note the id of a particular group
    namespace = Namespace.find(<GROUP_ID>)
  2. Enable the container_registry_namespace_statistics feature flag via Rails console
    Feature.enable(:container_registry_namespace_statistics, namespace)
  3. Stub container registry statistics via Rails console:
    stats = namespace.build_root_storage_statistics
    stats.container_registry_size = 12_345_678
    stats.save
  4. Open local usage quotas page for a group, e.g. http://localhost:3000/groups/gitlab-instance-60b25789/-/usage_quotas#storage-quota-tab

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 Kos Palchyk

Merge request reports