Limit storage banners to namespaces with project storage enforced
What does this MR do and why?
It limit the storage notifications to namespaces with project-level storage enforcement enabled.
Screenshots or screen recordings
project-level storage enforcement | namespace-level storage enforcement |
---|---|
How to set up and validate locally
The namespace storage page have different views (that's being consolidated into one with #375651), to make sure you're always on the correct "cards" view apply this patch (e.g. copy the whole code then in terminal run pbpaste | git apply -
):
diff --git a/ee/app/assets/javascripts/usage_quotas/storage/components/namespace_storage_app.vue b/ee/app/assets/javascripts/usage_quotas/storage/components/namespace_storage_app.vue
index 4df6d0636ab0..1846f39e6d54 100644
--- a/ee/app/assets/javascripts/usage_quotas/storage/components/namespace_storage_app.vue
+++ b/ee/app/assets/javascripts/usage_quotas/storage/components/namespace_storage_app.vue
@@ -216,7 +216,7 @@ export default {
:additional-purchased-storage-size="namespace.additionalPurchasedStorageSize"
:actual-repository-size-limit="namespace.actualRepositorySizeLimit"
/>
- <div v-if="isAdditionalStorageFlagEnabled && storageStatistics">
+ <div v-if="storageStatistics">
<storage-usage-statistics
v-if="shouldUseNewStorageDesign"
:storage-limit-enforced="storageLimitEnforced"
- Navigate to a namespace that has a project (where you're the owner of)
- From left sidebar go to: Settings > Usage Quotas > Storage tab
To have project-level storage enforcement enabled
- Disable
namespace_storage_limit
feature flag, inrails console
run:Feature.disable(:namespace_storage_limit)
- Make sure
::Gitlab::CurrentSettings.automatic_purchased_storage_allocation?
isfalse
(in console run:::Gitlab::CurrentSettings.update(automatic_purchased_storage_allocation: false)
) - Ensure the notification is showing (above the cards)
To have namespace-level storage enforcement enabled
- Enable
namespace_storage_limit
feature flag, inrails console
run:Feature.enable(:namespace_storage_limit)
- Make sure
::Gitlab::CurrentSettings.automatic_purchased_storage_allocation?
istrue
(in console run:::Gitlab::CurrentSettings.update(automatic_purchased_storage_allocation: true)
) - Ensure the notification is not showing
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.
Related to #371963
Edited by Ammar Alakkad