Commit 7f10fae1 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Merge branch 'enable-atomic-processing-by-default' into 'master'

Enable CI Atomic Processing by default

Closes #197930

See merge request gitlab-org/gitlab!34253
parents 2adda703 e60f9c4d
......@@ -24,7 +24,7 @@ module Ci
def status
strong_memoize(:status) do
if Feature.enabled?(:ci_composite_status, project, default_enabled: false)
if ::Gitlab::Ci::Features.composite_status?(project)
Gitlab::Ci::Status::Composite
.new(@jobs)
.status
......
......@@ -391,7 +391,7 @@ module Ci
end
def ordered_stages
if Feature.enabled?(:ci_atomic_processing, project, default_enabled: false)
if ::Gitlab::Ci::Features.atomic_processing?(project)
# The `Ci::Stage` contains all up-to date data
# as atomic processing updates all data in-bulk
stages
......@@ -439,7 +439,7 @@ module Ci
end
def legacy_stages
if Feature.enabled?(:ci_composite_status, project, default_enabled: false)
if ::Gitlab::Ci::Features.composite_status?(project)
legacy_stages_using_composite_status
else
legacy_stages_using_sql
......
......@@ -99,7 +99,7 @@ class CommitStatus < ApplicationRecord
# will not be refreshed to pick the change
self.processed_will_change!
if Feature.disabled?(:ci_atomic_processing, project)
if !::Gitlab::Ci::Features.atomic_processing?(project)
self.processed = nil
elsif latest?
self.processed = false # force refresh of all dependent ones
......@@ -287,7 +287,7 @@ class CommitStatus < ApplicationRecord
end
def schedule_stage_and_pipeline_update
if Feature.enabled?(:ci_atomic_processing, project)
if ::Gitlab::Ci::Features.atomic_processing?(project)
# Atomic Processing requires only single Worker
PipelineProcessWorker.perform_async(pipeline_id, [id])
else
......
......@@ -66,7 +66,7 @@ module HasStatus
# 1. By plucking all related objects,
# 2. Or executes expensive SQL query
def slow_composite_status(project:)
if Feature.enabled?(:ci_composite_status, project, default_enabled: false)
if ::Gitlab::Ci::Features.composite_status?(project)
Gitlab::Ci::Status::Composite
.new(all, with_allow_failure: columns_hash.key?('allow_failure'))
.status
......
......@@ -11,7 +11,7 @@ module Ci
def execute(trigger_build_ids = nil, initial_process: false)
update_retried
if Feature.enabled?(:ci_atomic_processing, pipeline.project)
if ::Gitlab::Ci::Features.atomic_processing?(pipeline.project)
Ci::PipelineProcessing::AtomicProcessingService
.new(pipeline)
.execute
......
---
title: Enable CI Atomic Processing by default
merge_request:
author:
type: performance
......@@ -29,6 +29,14 @@ module Gitlab
def self.instance_variables_ui_enabled?
::Feature.enabled?(:ci_instance_variables_ui, default_enabled: true)
end
def self.composite_status?(project)
::Feature.enabled?(:ci_composite_status, project, default_enabled: true)
end
def self.atomic_processing?(project)
::Feature.enabled?(:ci_atomic_processing, project, default_enabled: true)
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment