Skip to content

Make AR scopes using interruptible able to read from ci_job_definitions

Problem

The scopes Ci::Processable.interruptible and Ci::Processable.not_interruptible currently join with ci_builds_metadata because interruptible is defined there. After Introduce `Ci::JobDefinition` model (#551830 - closed) the new home for interruptible column will be ci_job_definitions.

Between enabling the feature flag read_from_new_ci_destinations and before we migrate data from ci_builds_metadata we will have a period of time in which interruptible will be set on both ci_builds_metadata and ci_job_definitions.

Proposal

In the PoC from Draft: PoC: split build metadata into `job_prot... (!193948 - closed) we modified the scopes to query from 2 tables at the same time. However, this may not be necessary. We could leverage a feature flag (maybe read_from_new_ci_destinations but with a different actor) where we simply switch which table we want to use for querying this data from.

The data should exist in both tables at the same time so reverting the FF back would be simple.

With interruptible we cancel pipelines that are not older than 1 week so, as long as we have been writing to both tables for 1 week, we should be fine to enable the feature flag. However, we need to take in consideration how this could behave on self-managed customers.

Status

Implemented in !203541 (merged) under the ci_read_interruptible_from_job_definitions feature flag.

Edited by Marius Bobin