Move (extra_)shared_runners_minutes to Ci::Minutes::Quota
What does this MR do?
Related to #213964 (closed)
In this MR we move:
-
NamespaceStatistics#shared_runners_minutes(include_extra: true)
toCi::Minutes::Quota#total_minutes_used
-
NamespaceStatistics#shared_runners_minutes(include_extra: false)
toCi::Minutes::Quota#monthly_minutes_used
-
NamespaceStatistics#extra_shared_runners_minutes
toCi::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
- [-] Changelog entry
- [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
-
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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