Fix plan limits for different types of enforcement alert

What does this MR do and why?

This is tracked in https://gitlab.com/gitlab-org/gitlab/-/issues/412991. We need to make sure the actual_size_limit method returns the actual limit depending on the enforcement type:

This method is used in a few places, but the visible places are the storage banner and the usage overview. The fix on usage overview is going to be tackled in https://gitlab.com/gitlab-org/gitlab/-/issues/413759 once this MR gets merged.

Screenshots or screen recordings

Project Enforcement

No change expected

Before After
repo_before repo_after

Namespace Enforcement

The limit in the banner is the correct one, not the project enforcement one.

Before After
namespace_before namespace_after

How to set up and validate locally

For the screenshots I had:

pry(main)> Group.find(75).actual_plan.actual_limits.storage_size_limit
=> 500 # Megabytes
pry(main)> Gitlab::CurrentSettings.repository_size_limit / 1.megabyte
=> 1000

MR acceptance checklist

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

Edited by Sheldon Led

Merge request reports

Loading