Skip to content

Change `set_enforcement_limit` to work with `build` groups

What does this MR do and why?

Groups created with build in tests don't have the gitlab_subscription object/record, so we can't use set_enforcement_limit

  1) Namespace#actual_size_limit when in namespace enforcement returns the plan limit
     Failure/Error: set_enforcement_limit(namespace, megabytes: enforceable_storage_limit)

     NoMethodError:
       undefined method `hosted_plan' for nil:NilClass

           namespace.gitlab_subscription.hosted_plan.actual_limits.update!(enforcement_limit: megabytes)

Screenshots or screen recordings

N/A

How to set up and validate locally

  • Pipelines being green are enough validation

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