Skip to content

Change namespace factory to set new CI minutes tracking

Fabio Pitino requested to merge refactor-shared-runners-seconds-2 into master

Related to #277448 (closed)

This MR is based on top of !71180 (merged)

Background

In order to retire the legacy tracking of CI minutes that uses namespace_statistics.shared_runners_seconds in favour of the new monthly tracking using ci_namespace_monthly_usages.amount_used we need to first isolate all the places where shared_runners_seconds is set in the specs code and is read in the production code.

Then we will be able to add a feature flag that will enable us to make the switch between the legacy tracking and the monthly tracking.

What does this MR do and why?

This MR introduces changes to the namespace factory to accept ci_minutes_used and ci_minutes_limit attributes. These abstractions allow us to eventually switch strategy and retire the legacy one.

On production, currently both legacy and new monthly tracking are being updated side-by-side but we read the data from the legacy shared_runners_seconds.

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

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 Fabio Pitino

Merge request reports