Prevent pre-enforcement and threshold banners both displaying
What does this MR do and why?
This implements https://gitlab.com/gitlab-org/gitlab/-/issues/432082
Screenshots or screen recordings
Before | After | After - over limit |
---|---|---|
How to set up and validate locally
Use these commands in rails console
:
Gitlab::CurrentSettings.update!(automatic_purchased_storage_allocation: true)
Gitlab::CurrentSettings.update!(enforce_namespace_storage_limit: true)
Plan.free.actual_limits.update!(notification_limit: 5*1024)
Plan.free.actual_limits.update!(enforcement_limit: 10*1024)
Plan.free.actual_limits.update!(storage_size_limit: 5*1024)
-
Project.find(29).statistics.update(repository_size: 8.gigabytes)
Sidekiq.redis(&:flushdb)
Namespaces::ScheduleAggregationWorker.perform_sync(89)
Namespaces::RootStatisticsWorker.perform_sync(89)
Feature.enable(:namespace_storage_limit_show_preenforcement_banner, Group.find(89))
Feature.enable(:namespace_storage_limit, Group.find(89))
Check the following scenarios:
- Namespace with
8.gigabytes
of used storage: only show pre-enforcement banner - Namespace with
12.gigabytes
of used storage: only show enforcement banner - All the
actual_limits
set to5*1024
- Namespace with
8.gigabytes
of used storage: show enforcement banner - Namespace with
4.gigabytes
of used storage: shows threshold banner
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 Kos Palchyk