Skip to content

Use new cost factor columns behind a feature flag

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Problem

Today we have the subsidized cost factor 0.008 that overrides the runner cost factors public_projects_minutes_cost_factor or private_projects_minutes_cost_factor depending on some conditions (if the project exists in a namespace created after July 2021, or if the project is a fork of a public project, etc.).

After we enforce CI minutes for all public projects we should remove this condition in the code and convert the cost factor to be set in the database. We realized that choosing a cost factor based on the project visibility become irrelevant. We need to switch cost factor based on standard condition (applied to most of the projects) and discounted condition (subsidized cost factor applied based on some rules: e.g. project is fork of OSS project).

Plan

Step Issue
Add new columns ci_runners.discounted_cost_factor with DEFAULT 0.008 and ci_runners.standard_cost_factor with DEFAULT 1.0 #363215 (closed)
Add feature flag to switch to the new columns (cost factor, Admin UI, RunnerMatcher, GraphQL) 👈 You are here
Enable the feature flag #352420
Cleanup old cost factor columns #363217

Full plan described in #352420

Proposal

Step 2 of #352420

Add feature flag to switch to the new columns

  • Control selection of new runner cost factors - If Gitlab.com and project meets requirement for discounted cost factor (project is a public fork) use discounted_cost_factor, otherwise standard_cost_factor.
  • Control the Admin UI to set cost factors for shared runners - Allow setting new cost factors and hide legacy ones.
  • Change Gitlab::Ci::Matching::RunnerMatcher to use the new cost factor columns.
  • Add new cost factor columns to GraphQL types and mutations and deprecate old cost factors.
Edited by 🤖 GitLab Bot 🤖