Prevent CI Minutes purchase for unlimited quota groups
Problem to solve
On GitLab.com, we have the concept of unlimited minutes for certain groups (typically, GitLab owned groups).
This is represented by Namespace#shared_runners_minutes_limit
value being 0
.
It is possible that this value could be changed if someone were to purchase minutes for one of those groups, which would re-enable a typical quota check for CI Minutes.
Using GitLab as an example, this would almost immediately cause a production incident as we would run out of minutes very quickly.
Proposal
We should check if a group has unlimited minutes enabled (something like namespace.shared_runners_minutes_limit == 0
) before allowing a CI minutes purchase to proceed.
We have to purchase flows to consider/support:
- CustomersDot flow
- Soon-to-be released GitLab flow
Both flows can likely be resolved with the same solution (but will need to be tested/confirmed separately).
We likely could address this by adding a new scope for applicable groups.
Further details
This was first raised as a potential concern here: gitlab!68646 (comment 656349362) when addressing production incidents.