Update storage limit alert title
What does this MR do and why?
This MR makes some adjustments to the Storage Limit Alert
so we can solve some confusion that's described in https://gitlab.com/gitlab-org/gitlab/-/issues/421668
Before we jump to what's changed, it's important to understand the context. We have two types of limits:
- Project Storage Limits; sometimes referred as Repository Limits/enforcement
- Namespace Storage Limits; sometimes referred as Namespace Enforcement
To navigate the screenshots we need to understand the scenarios through the user journey:
- Scenario 1: A brand new group, with no storage overage
- Scenario 2: The group is approaching (>75%) their free tier limit (each limit type is applied differently, check steps to validate)
- Scenario 3: The group is over their free tier limit
- Scenario 4: The owner of the group buys storage, and has no overage
- Scenario 5: The group is approaching (>75%) their limit again, The owner might need to purchase more storage
- Scenario 6: The group is over their total (free+purchased) storage
In an attempt to simplify this MR description I'll refer to the scenarios number from now on.
What's changed
All the scenarios are described for completeness and understanding, as this is a complex feature
-
Project Storage Limits alerts:
-
Scenario 5: Changed the wording in the title from storage quota to purchased storage
-
Scenario 6: The title now has a different phrase and does not include the percentage
-
Screenshots or screen recordings
Project Storage Limits
Screenshots for a group inScenario 1: No Screenshots as there should be no alert
Scenario 2: We don't show an alert for this scenario in groups on Project Storage Limits
Scenario 4: No Screenshots as there should be no alert
Namespace Storage Limits
Screenshots for a group inScenario 1: No Screenshots as there should be no alert
Scenario 4: No Screenshots as there should be no alert
How to set up and validate locally
Since these apply to SaaS only, make sure you're simulating SaaS in your GDK.
Project Storage Limits
Reproducing steps for a group inClick to expand
To make it similar to the screenshots, I'll call this group project-limits-group
- Go to https://gdk.test:3443/groups/new and create a new group called project-limits-group. Make note of its id (e.g.
96
) - Create a project under this group. For this example I'll use
96-project1
. Make note of its id (e.g.26
) - From now on we can leave the browser in the Namespace Usage Quotas Page: https://gdk.test:3443/groups/project-limits-group/-/usage_quotas#storage-quota-tab
- You're now in Scenario 1
-
Scenario 2 (the instructions below are in
rails console
)- Enable the setting that tells your GitLab instance that it has the
purchase storage
featureGitlab::CurrentSettings.update!(automatic_purchased_storage_allocation: true)
- Add a repository size limit:
Gitlab::CurrentSettings.update!(repository_size_limit: 10.gigabytes)
- Add a storage usage to your project that goes over
75%
of this limit:Project.find(26).statistics.update(repository_size: 9.gigabytes)
- Aggregate this storage to the namespace:
Sidekiq.redis(&:flushdb)
Namespaces::ScheduleAggregationWorker.perform_sync(96)
Namespaces::RootStatisticsWorker.perform_sync(96)
- If the Namespace storage used card (in the browser) has not been updated, repeat all the steps again.
- In the browser, make sure no banner appears
- Enable the setting that tells your GitLab instance that it has the
-
Scenario 3 (the instructions below are in
rails console
)- Add a storage usage to your project that goes over
100%
of this limit:Project.find(26).statistics.update(repository_size: 15.gigabytes)
- Aggregate this storage to the namespace:
- Repeat the steps 5.4.1 to 5.4.3
- If the Namespace storage used card (in the browser) has not been updated, repeat all the steps again.
- In the browser, make sure the correct banner appears.
- Add a storage usage to your project that goes over
-
Scenario 4 (the instructions below are in
rails console
)- Add
purchased storage
enough to go over theexcess storage
:Group.find(96).update(additional_purchased_storage_size: 10*1024)
- Make sure the banner disappeared
- Add
-
Scenario 5 (the instructions below are in
rails console
)- Add a storage usage to your project that goes over
75%
of the total limit (free+purchased):Project.find(26).statistics.update(repository_size: 18.gigabytes)
- Aggregate this storage to the namespace:
- Repeat the steps 5.4.1 to 5.4.3
- If the Namespace storage used card (in the browser) has not been updated, repeat all the steps again.
- In the browser, make sure the correct banner appears.
- Add a storage usage to your project that goes over
-
Scenario 6 (the instructions below are in
rails console
)- Add a storage usage to your project that goes over
100%
of the total limit (free+purchased):Project.find(26).statistics.update(repository_size: 25.gigabytes)
- Aggregate this storage to the namespace:
- Repeat the steps 5.4.1 to 5.4.3
- If the Namespace storage used card (in the browser) has not been updated, repeat all the steps again.
- In the browser, make sure the correct banner appears.
- Add a storage usage to your project that goes over
Namespace Storage Limits
Reproducing steps for a group inClick to expand
To make it similar to the screenshots, I'll call this group namespace-limits-group
- Go to https://gdk.test:3443/groups/new and create a new group called namespace-limits-group. Make note of its id (e.g.
97
) - Create a project under this group. For this example I'll use
97-project1
. Make note of its id (e.g.27
) - From now on we can leave the browser in the Namespace Usage Quotas Page: https://gdk.test:3443/groups/project-limits-group/-/usage_quotas#storage-quota-tab
- Enable Namespace limits for this group:
- 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 this group (replace the command below by your group id)Feature.enable(:namespace_storage_limit, Group.find(97))
- Enable the setting that tells your GitLab instance that it has the
- You're now in Scenario 1
- Make sure (in the browser) that the cards in Usage Quotas are different from the cards in project-limits-group
-
Scenario 2 (the instructions below are in
rails console
)- Add a storage usage to your project that goes over
75%
of this limit:Project.find(27).statistics.update(repository_size: 4.gigabytes)
- Aggregate this storage to the namespace:
Sidekiq.redis(&:flushdb)
Namespaces::ScheduleAggregationWorker.perform_sync(97)
Namespaces::RootStatisticsWorker.perform_sync(97)
- If the Namespace storage used card (in the browser) has not been updated, repeat all the steps again.
- In the browser, make sure the correct banner appears
- Add a storage usage to your project that goes over
-
Scenario 3 (the instructions below are in
rails console
)- Add a storage usage to your project that goes over
100%
of this limit:Project.find(27).statistics.update(repository_size: 7.gigabytes)
- Aggregate this storage to the namespace:
- Repeat the steps 6.2.1 to 6.2.3
- If the Namespace storage used card (in the browser) has not been updated, repeat all the steps again.
- In the browser, make sure the correct banner appears.
- Add a storage usage to your project that goes over
-
Scenario 4 (the instructions below are in
rails console
)- Add
purchased storage
enough to go over theexcess storage
:Group.find(97).update(additional_purchased_storage_size: 10*1024)
- Leave
rails console
and execute the following in your terminal:rails cache:clear
- Make sure the banner disappeared
- Add
-
Scenario 5 (the instructions below are in
rails console
)- Add a storage usage to your project that goes over
75%
of the total limit (free+purchased):Project.find(27).statistics.update(repository_size: 12.gigabytes)
- Aggregate this storage to the namespace:
- Repeat the steps 6.2.1 to 6.2.3
- If the Namespace storage used card (in the browser) has not been updated, repeat all the steps again.
- In the browser, make sure the correct banner appears.
- Add a storage usage to your project that goes over
-
Scenario 6 (the instructions below are in
rails console
)- Add a storage usage to your project that goes over
100%
of the total limit (free+purchased):Project.find(27).statistics.update(repository_size: 20.gigabytes)
- Aggregate this storage to the namespace:
- Repeat the steps 6.2.1 to 6.2.3
- If the Namespace storage used card (in the browser) has not been updated, repeat all the steps again.
- In the browser, make sure the correct banner appears.
- Add a storage usage to your project that goes over
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.