Skip to content

Create Columns for standard and OSS cost factor admin

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 👈 You are here
Add feature flag to switch to the new columns (cost factor, Admin UI, RunnerMatcher, GraphQL) #363216
Enable the feature flag #352420
Cleanup old cost factor columns #363217

Full plan described in #352420

Proposal

Introduce ci_cost_factors table, with a row for each shared runner.

Columns ci_runner_id, standard, os_contribution, os_plan.

Edited by Allison Browne