Update the combined banner when exceeding both storage and user limits
What does this MR do and why?
This implements https://gitlab.com/gitlab-org/gitlab/-/issues/416794 where we make some updates to the banner for namespaces over user and storage limits:
- Swap the buttons
- Adjust the copy
- Amend the FAQ link
Screenshots or screen recordings
Group Owners
Before | After |
---|---|
![]() |
![]() |
non-Owners members
Minor addition of the word Free in the first phrase.
Before | After |
---|---|
![]() |
![]() |
How to set up and validate locally
Setting this up is a bit cumbersome given the dozens of possible states. Here's a list of steps:
- Make sure these FFs are disabled:
Feature.disable(:free_user_cap)
andFeature.disable(:free_user_cap_new_namespaces)
- Make sure free user cap dashboard is disabled:
::Gitlab::CurrentSettings.update(dashboard_limit_enabled: false)
- Make sure this other setting is disabled:
::Gitlab::CurrentSettings.update(dashboard_limit_new_namespace_creation_enforcement_date: nil)
- Make sure FF for storage check is disabled:
Feature.disable(:free_user_cap_without_storage_check)
- Create a new group, take note of its ID, e.g.:
88
- Add 6+ members to that group
- Enable Free user cap notification FF:
Feature.enable(:preview_free_user_cap)
-
Set UserCap Dashboard limit:
::Gitlab::CurrentSettings.update(dashboard_limit_enabled: true, dashboard_limit: 5)
- You should see a banner saying something about
Your top-level group will move to a read-only state soon
, a.k.a the UserCap pre-enforcement banner
- You should see a banner saying something about
- Now with your Group (
g = Group.find(88)
where88
is your group ID from step 2)-
Set Storage Dashboard limit:
g.actual_plan.actual_limits.update(storage_size_limit: 5 * 1024)
This means5 GB
- Set pre-enforcement notification limit, like
6 GB
:g.actual_limits.update(notification_limit: 6 * 1024)
-
⚠ ️ Important:notification_limit
should be higher thanstorage_size_limit
. There's no validation in the backend though, discussion: !124075 (comment 1439722242)
-
- Set used storage over the notification limit:
g.root_storage_statistics.update(storage_size: 7.gigabytes)
- If you get an error, try creating the record like so
Namespace::RootStorageStatistics.new(namespace: g, storage_size: 7.gigabytes).save!
- If you get an error, try creating the record like so
-
Set Storage Dashboard limit:
- Make sure pre-enforcement FF is enabled:
Feature.enable(:namespace_storage_limit_show_preenforcement_banner)
- Turn on automatic purchased storage allocation:
::Gitlab::CurrentSettings.update(automatic_purchased_storage_allocation: true)
- Clear the cache:
rails cache:clear
- You should now see a banner saying something about
A namespace storage limit will soon be enforced for the namespace
, a.k.a the Storage pre-enforcement banner - Now enabling the combined banner is possible:
- Via
free_user_cap
by simply enablingFeature.enable(:free_user_cap)
, or... - Via
free_user_cap_new_namespaces
:Feature.disable(:free_user_cap)
Feature.enable(:free_user_cap_new_namespaces)
Gitlab::CurrentSettings.update(dashboard_limit_new_namespace_creation_enforcement_date: g.created_at - 1.day)
- Via
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.
Edited by Sheldon Led