Skip to content

Splits storage usage statistics cards per limit type

What does this MR do and why?

This MR splits and renames cards in Usage Quotas > Storage tab in accordance to their storage enforcement type.

We have three main storage enforcement types: namespace limits (upcoming SaaS feature), project limits (current SaaS feature), and no limits (as seen on SelfManaged instances). With this change, cards at the top of the namespace Usage Quotas > Storage page get a more clear separation by the storage enforcement type. This will let us easier adjust them for particular state.

This is a maintenancerefactor MR, with small UX change, and a typebug fix. This is a preparation to https://gitlab.com/gitlab-org/gitlab/-/issues/429072+ issue.

Screenshots or screen recordings

state \ changes

before after

Namespace Limits

No UI changes

image.png

image.png

Project limits

The (?) link leading to project limits was removed. The same link is still present on the right card.

The 10.0 MiB Storage per project included in free subscription part was moved to the right card. I think it makes more sense there.

image.png

image.png

SM

The (?) link leading to namespace limits was removed, and the card now has a description. This probably was a typebug

The namespace overview card now contains total storage value explanation.

image.png

image.png

How to set up and validate locally

One can reproduce the UI states on an actual instance, or use storybook to check the UI updates.

Storybook

Instance reproduction steps

The UI changed is accessed by http://localhost:3000/groups/gitlab-org/-/usage_quotas#storage-quota-tab

Reproducing Self-Managed UI

Click to expand
  1. Make sure you're NOT simulating SaaS in your GDK
  2. Access your Group Usage Quotas Page

Reproducing Project Storage Limits UI

Click to expand
  1. Make sure you ARE simulating SaaS in your GDK
  2. In rails console, add a repository size limit:
    1. Gitlab::CurrentSettings.update!(repository_size_limit: 10.gigabytes) for limits > 0
    2. Gitlab::CurrentSettings.update!(repository_size_limit: 0) for limits = 0

Reproducing steps for a group in Namespace Storage Limits

Click to expand
  1. Make sure you ARE simulating SaaS in your GDK
  2. Enable the setting that tells your GitLab instance that it has the purchase storage feature
    1. Gitlab::CurrentSettings.update!(automatic_purchased_storage_allocation: true)
  3. Enable the setting that tells your GitLab instance that it is enforcing namespace limits
    1. Gitlab::CurrentSettings.update!(enforce_namespace_storage_limit: true)
  4. Enable the namespace limits for your group (replace the command below by your group id)
    1. Feature.enable(:namespace_storage_limit, Group.find(89))
  5. Add a limit to the Free Plan:
    1. Plan.free.actual_limits.update!(storage_size_limit: 5 * 1024)
  6. Go back to the browser and check the Usage Quotas page. Note the text:
    1. This namespace has 5.0 GiB of storage. How are limits applied?
  7. Remove the plan limit:
    1. Plan.free.actual_limits.update!(storage_size_limit: 0)

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