Skip to content

Move (extra_)shared_runners_minutes to Ci::Minutes::Quota

Fabio Pitino requested to merge ci-move-shared-runners-minutes-to-ci-quota into master

What does this MR do?

Related to #213964 (closed)

In this MR we move:

  • NamespaceStatistics#shared_runners_minutes(include_extra: true) to Ci::Minutes::Quota#total_minutes_used
  • NamespaceStatistics#shared_runners_minutes(include_extra: false) to Ci::Minutes::Quota#monthly_minutes_used
  • NamespaceStatistics#extra_shared_runners_minutes to Ci::Minutes::Quota#purchased_minutes_used

As per #213964 (closed), this is an ongoing effort to consolidate all the CI Minutes logic into a single responsibility class.

It seems we used Namespace and NamespaceStatistics before because that's where the data is being persisted but these models are already overloaded with responsibilities. Moving this logic into a dedicated class not only makes it more cohesive now but also abstracts it away from where the data comes from, which will change soon.

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
Edited by Mayra Cabrera

Merge request reports