Skip to content

Add purchased storage available breakdown card

What does this MR do and why?

This implements the card on the right-hand-side of the design in https://gitlab.com/gitlab-org/gitlab/-/issues/419922

MR description MR Link
Update storage statistics card for namespaces under project limits !127746 (merged)
Move total-storage-available-breakdown-card to its own component !128897 (merged)
Add purchased storage available breakdown card for namespaces under project limits 👈 you're here

Screenshots or screen recordings

This is the comparison between the state in !127746 (merged) and here:

Before After
127746_after 129757_after_over

These screenshots below would follow how the user progress in their storage usage:

  1. All their projects are under the free tier limit
  2. One of their projects is over the free tier limit
  3. They've purchased additional storage and namespace is now under purchased limit (Although almost over the purchased limit)
  4. They're over the purchased limit and the project is read-only again
Screenshoots Screenshoots
under free tier and no purchased storage 129757_after_underlimit_nopurchased over free tier and no purchased storage 129757_after_overlimit_nopurchased
with purchased storage and under purchased limit 129757_after_withpurchased_underpurchasedlimit with purchased storage and over purchased limit 129757_after_withpurchased_overpurchasedlimit

How to set up and validate locally

Go to rails console:

  1. Grab a group: g = Group.find(<group id>)
  2. Add some storage to the group's project: g.projects.first.statistics.update(repository_size: 10*1024*1024*1024)
  3. Play around with the purchased storage: g.update(additional_purchased_storage_size: 5*1024)
  4. Clean redis queue: Sidekiq.redis(&:flushdb)
  5. Perform the these job:
    1. Namespaces::ScheduleAggregationWorker.perform_sync(g.id)
    2. Namespaces::RootStatisticsWorker.perform_sync(g.id)
  6. Check the UI (in the browswer 😅 ): https://gdk.test:3443/groups/<your group here>/-/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 Sheldon Led

Merge request reports