Skip to content

Consolidate namespace storage app setting check

What does this MR do?

This MR includes the app setting check (::Gitlab::CurrentSettings.automatic_purchased_storage_allocation?) in Namespace#additional_repo_storage_by_namespace_enabled?. This method is used in many places in the app in conjunction with the app setting check already so this allows us to consolidate this logic in one place. With the feature flag checks and app setting checks in one place, the method more accurately reflects whether the additional purchased storage feature is enabled.

This also allows us to remove a lot of duplicated code and simplify the tests quite a bit.

I chose not to include changelog as this is basically a refactor. Let me know if you disagree.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • [-] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • [-] Security reports checked/validated by a reviewer from the AppSec team

Related to #273183

Edited by Tyler Amos

Merge request reports