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 ...@@ -24,7 +24,7 @@ module Ci
def status def status
strong_memoize(:status) do 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 Gitlab::Ci::Status::Composite
.new(@jobs) .new(@jobs)
.status .status
......
...@@ -391,7 +391,7 @@ module Ci ...@@ -391,7 +391,7 @@ module Ci
end end
def ordered_stages 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 # The `Ci::Stage` contains all up-to date data
# as atomic processing updates all data in-bulk # as atomic processing updates all data in-bulk
stages stages
...@@ -439,7 +439,7 @@ module Ci ...@@ -439,7 +439,7 @@ module Ci
end end
def legacy_stages 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 legacy_stages_using_composite_status
else else
legacy_stages_using_sql legacy_stages_using_sql
......
...@@ -99,7 +99,7 @@ class CommitStatus < ApplicationRecord ...@@ -99,7 +99,7 @@ class CommitStatus < ApplicationRecord
# will not be refreshed to pick the change # will not be refreshed to pick the change
self.processed_will_change! self.processed_will_change!
if Feature.disabled?(:ci_atomic_processing, project) if !::Gitlab::Ci::Features.atomic_processing?(project)
self.processed = nil self.processed = nil
elsif latest? elsif latest?
self.processed = false # force refresh of all dependent ones self.processed = false # force refresh of all dependent ones
...@@ -287,7 +287,7 @@ class CommitStatus < ApplicationRecord ...@@ -287,7 +287,7 @@ class CommitStatus < ApplicationRecord
end end
def schedule_stage_and_pipeline_update 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 # Atomic Processing requires only single Worker
PipelineProcessWorker.perform_async(pipeline_id, [id]) PipelineProcessWorker.perform_async(pipeline_id, [id])
else else
......
...@@ -66,7 +66,7 @@ module HasStatus ...@@ -66,7 +66,7 @@ module HasStatus
# 1. By plucking all related objects, # 1. By plucking all related objects,
# 2. Or executes expensive SQL query # 2. Or executes expensive SQL query
def slow_composite_status(project:) 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 Gitlab::Ci::Status::Composite
.new(all, with_allow_failure: columns_hash.key?('allow_failure')) .new(all, with_allow_failure: columns_hash.key?('allow_failure'))
.status .status
......
...@@ -11,7 +11,7 @@ module Ci ...@@ -11,7 +11,7 @@ module Ci
def execute(trigger_build_ids = nil, initial_process: false) def execute(trigger_build_ids = nil, initial_process: false)
update_retried update_retried
if Feature.enabled?(:ci_atomic_processing, pipeline.project) if ::Gitlab::Ci::Features.atomic_processing?(pipeline.project)
Ci::PipelineProcessing::AtomicProcessingService Ci::PipelineProcessing::AtomicProcessingService
.new(pipeline) .new(pipeline)
.execute .execute
......
---
title: Enable CI Atomic Processing by default
merge_request:
author:
type: performance
...@@ -29,6 +29,14 @@ module Gitlab ...@@ -29,6 +29,14 @@ module Gitlab
def self.instance_variables_ui_enabled? def self.instance_variables_ui_enabled?
::Feature.enabled?(:ci_instance_variables_ui, default_enabled: true) ::Feature.enabled?(:ci_instance_variables_ui, default_enabled: true)
end 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 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