Skip to content

Reverts storage limits banner offers

What does this MR do and why?

Reverts storage limits banner offers, added in Update storage banner to include offer details (!128728 - merged).

It's not a full revert, as I'm trying to preserve some security improvements done in that MR.

Screenshots or screen recordings

before after
combined image image
pre-enforcement image image

How to set up and validate locally

Copying reproduction steps from Update storage banner to include offer details (!128728 - merged):

To test combined banner changes

Apply this patch (e.g. copy then run pbpaste | git apply -)

diff --git a/ee/app/components/namespaces/combined_storage_users/owner_alert_component.rb b/ee/app/components/namespaces/combined_storage_users/owner_alert_component.rb
index ac030b4c9fd9..0c88e359ac4a 100644
--- a/ee/app/components/namespaces/combined_storage_users/owner_alert_component.rb
+++ b/ee/app/components/namespaces/combined_storage_users/owner_alert_component.rb
@@ -6,6 +6,7 @@ class OwnerAlertComponent < BaseAlertComponent
       private
 
       def render?
+        return true
         return false unless Ability.allowed?(user, :owner_access, root_namespace)
 
         super
  1. Go to a group where you have owner role
  2. Observe the banner at the top of the page

To test pre-enforcement banners

Checkout any old patches git checkout -- ., then apply this patch (e.g. copy then run pbpaste | git apply -)

diff --git a/ee/app/models/namespaces/storage/enforcement.rb b/ee/app/models/namespaces/storage/enforcement.rb
index 59217346bf4f..f5db502fc0b1 100644
--- a/ee/app/models/namespaces/storage/enforcement.rb
+++ b/ee/app/models/namespaces/storage/enforcement.rb
@@ -15,6 +15,7 @@ def enforce_limit?(namespace)
       end
 
       def show_pre_enforcement_alert?(namespace)
+        return true
         root_namespace = namespace.root_ancestor
 
         return false unless in_pre_enforcement_phase?(root_namespace)

There are four types of banners:

  • for a group (/groups/h5bp/-/usage_quotas#storage-quota-tab)
  • a subgroup (/gitlab-org/subgroup)
  • a project (/gitlab-org/subgroup/test)
  • and a user namespace (/-/profile/usage_quotas#storage-quota-tab)
  1. Visit relevant page
  2. Observe the banner at the top of the page

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #425345

Edited by Kos Palchyk

Merge request reports