Skip to content

Show storage graph with limits

Nicolas Dular requested to merge nicolasdular/storae-graph-with-limits into master

What does this MR do?

When a limit is set, users should see how much of their storage usage gets used in the storage usage graph. For the case when the limit is either 0 or the current usage exceeds the limit, we just render the distribution.

We will handle the design of exceeded usage at a later stage.

How to check it locally

It's easier to fake the storage usage, therefore I'd recommend the following:

  1. Sign in with root
  2. Go to http://localhost:3000/admin/application_settings/general -> Account and limit
  3. Set Maximum namespace storage (MB) to 20 (or something between 10 - 20)
  4. Execute the following script in bin/rails c:
n = Group.find_by(name: "Twitter")
n.root_storage_statistics&.destroy!
s = Namespace::RootStorageStatistics.new(
namespace: n,
build_artifacts_size: 400000,
wiki_size: 300000,
repository_size: 3900000,
packages_size: 3800000,
lfs_objects_size: 4800000
)
s.storage_size = s.repository_size + s.lfs_objects_size + s.wiki_size + s.build_artifacts_size + s.packages_size
s.save!
  1. Go to http://localhost:3000/groups/twitter/-/usage_quotas#storage-quota-tab for the usage (hint: needs EE license!)
  2. Change the limit in the admin panel to see the different use cases (below limit, no limit, exceeds limit).

Screenshots

No limit set Limit set Usage exceeds limit
Screenshot_2020-06-19_at_12.00.11 Screenshot_2020-06-19_at_11.59.53 Screenshot_2020-06-19_at_12.19.01

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Nicolas Dular

Merge request reports