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 |
||
Project limits The The |
||
SM The The namespace overview card now contains total storage value explanation. |
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
- Ensure you have fixtures for
ee/spec/frontend/fixtures/namespace.rb
andee/spec/frontend/fixtures/projects.rb
generated (or downloaded) - Run
npm run storybook:start
- And go to http://localhost:9002/?path=/story/ee-usage-quotas-storage-namespace-storage-app--saas-with-namespace-limits
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
- Make sure you're NOT simulating SaaS in your GDK
- Access your Group Usage Quotas Page
Project Storage Limits UI
ReproducingClick to expand
- Make sure you ARE simulating SaaS in your GDK
- In
rails console
, add a repository size limit:-
Gitlab::CurrentSettings.update!(repository_size_limit: 10.gigabytes)
for limits > 0 -
Gitlab::CurrentSettings.update!(repository_size_limit: 0)
for limits = 0
-
Namespace Storage Limits
Reproducing steps for a group inClick to expand
- Make sure you ARE simulating SaaS in your GDK
- Enable the setting that tells your GitLab instance that it has the
purchase storage
featureGitlab::CurrentSettings.update!(automatic_purchased_storage_allocation: true)
- Enable the setting that tells your GitLab instance that it is enforcing
namespace limits
Gitlab::CurrentSettings.update!(enforce_namespace_storage_limit: true)
- Enable the
namespace limits
for your group (replace the command below by your group id)Feature.enable(:namespace_storage_limit, Group.find(89))
- Add a limit to the
Free
Plan:Plan.free.actual_limits.update!(storage_size_limit: 5 * 1024)
- Go back to the browser and check the Usage Quotas page. Note the text:
This namespace has 5.0 GiB of storage. How are limits applied?
- Remove the plan limit:
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.
-
I have evaluated the MR acceptance checklist for this MR.