Dedup Usage Quotas Storage helper method
What does this MR do and why?
This MR is a result of an investigation that started on slack. Where there was errors when we enable namespace storage limit but we don't enable the enforcement:
Error when namespace_storage_limit is enabled
To reproduce this have the following configuration
Feature.enable(:namespace_storage_limit)Feature.disable(:enforce_storage_limit_for_free)Feature.disable(:enforce_storage_limit_for_paid)Feature.disable(:namespace_storage_limit_bypass_date_check)
We should have the following output in the console:
g = Group.find(<id>)
::EE::Gitlab::Namespaces::Storage::Enforcement.enforce_limit?(g)
// needs to return false
Then you should see some errors in the browser console:
Duplication of code
We have 2 methods that do the same thing: usage_quotas_storage_app_data and storage_usage_app_data. This MR also deduplicates these methods and now we have just one for both Group and Profile usage quotas.
Removal of GraphQL conditionals
There were some attributes of the query that were conditional (@include(if: $withExcessStorageData)) but we don't need it to be conditional anymore, so we removed it. Details in this comment:
Removal of additional_repo_storage_by_namespace_enabled?
There's some historical context explained in this comment, so we can safely delete this method
Show purchased storage UI only in dotcom and when namespace limit is enforced
We implement Show purchased storage UI only in dotcom (#267760 - closed) by adding a check on the application setting should_check_namespace_plan, since checking .com? is discouraged: &7374 (closed).
We also implement https://gitlab.com/gitlab-org/gitlab/-/issues/388426+ here
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.
