Show storage graph with limits
What does this MR do?
- Part of https://gitlab.com/gitlab-org/gitlab/-/issues/217128
- Needs !34882 (merged) to be merged
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:
- Sign in with
root
- Go to http://localhost:3000/admin/application_settings/general -> Account and limit
- Set Maximum namespace storage (MB) to 20 (or something between 10 - 20)
- 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!
- Go to http://localhost:3000/groups/twitter/-/usage_quotas#storage-quota-tab for the usage (hint: needs EE license!)
- 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 |
---|---|---|
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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