Skip to content
Snippets Groups Projects
Commit 052683a3 authored by Shinya Maeda's avatar Shinya Maeda
Browse files

Cleanup ci_reduce_persistent_ref_writes feature flag

This commit cleans up ci_reduce_persistent_ref_writes
feature flag.

Changelog: other
parent 836a94c8
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -327,11 +327,7 @@ def clone_accessors
 
after_transition pending: :running do |build|
build.run_after_commit do
if ::Feature.enabled?(:ci_reduce_persistent_ref_writes, build.project)
build.ensure_persistent_ref
else
build.pipeline.persistent_ref.create
end
build.ensure_persistent_ref
 
BuildHooksWorker.perform_async(id)
end
Loading
Loading
Loading
Loading
@@ -253,10 +253,6 @@ class Pipeline < Ci::ApplicationRecord
 
after_transition any => ::Ci::Pipeline.completed_statuses do |pipeline|
pipeline.run_after_commit do
if ::Feature.disabled?(:ci_reduce_persistent_ref_writes, pipeline.project)
pipeline.persistent_ref.delete
end
pipeline.all_merge_requests.each do |merge_request|
next unless merge_request.auto_merge_enabled?
 
Loading
Loading
@@ -292,9 +288,7 @@ class Pipeline < Ci::ApplicationRecord
 
after_transition any => ::Ci::Pipeline.stopped_statuses do |pipeline|
pipeline.run_after_commit do
if ::Feature.enabled?(:ci_reduce_persistent_ref_writes, pipeline.project)
pipeline.persistent_ref.delete
end
pipeline.persistent_ref.delete
end
end
 
Loading
Loading
Loading
Loading
@@ -13,9 +13,7 @@ def execute
##
# Create a persistent ref for the pipeline.
# The pipeline ref is fetched in the jobs and deleted when the pipeline transitions to a finished state.
if ::Feature.enabled?(:ci_reduce_persistent_ref_writes, pipeline.project)
pipeline.ensure_persistent_ref
end
pipeline.ensure_persistent_ref
 
Ci::ProcessPipelineService.new(pipeline).execute
end
Loading
Loading
---
name: ci_reduce_persistent_ref_writes
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/83730
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/354837
milestone: '14.10'
type: development
group: group::pipeline execution
default_enabled: false
Loading
Loading
@@ -3785,19 +3785,6 @@ def run_job_without_exception
 
run_job_without_exception
end
context 'when ci_reduce_persistent_ref_writes feature flag is disabled' do
before do
stub_feature_flags(ci_reduce_persistent_ref_writes: false)
end
it 'falls back to the previous behavior' do
expect(job.pipeline).not_to receive(:ensure_persistent_ref)
expect(job.pipeline.persistent_ref).to receive(:create).once
run_job_without_exception
end
end
end
 
shared_examples 'saves data on transition' do
Loading
Loading
Loading
Loading
@@ -1433,32 +1433,6 @@ def create_build(name, status)
end
end
 
context 'when ci_reduce_persistent_ref_writes feature flag is disabled' do
before do
stub_feature_flags(ci_reduce_persistent_ref_writes: false)
end
%w[succeed! drop! cancel! skip!].each do |action|
context "when the pipeline recieved #{action} event" do
it 'deletes a persistent ref' do
expect(pipeline.persistent_ref).to receive(:delete).once
pipeline.public_send(action)
end
end
end
%w[block! delay!].each do |action|
context "when the pipeline recieved #{action} event" do
it 'does not delete a persistent ref' do
expect(pipeline.persistent_ref).not_to receive(:delete)
pipeline.public_send(action)
end
end
end
end
describe 'synching status to Jira' do
let(:worker) { ::JiraConnect::SyncBuildsWorker }
 
Loading
Loading
Loading
Loading
@@ -22,17 +22,5 @@
 
service.execute
end
context 'when ci_reduce_persistent_ref_writes feature flag is disabled' do
before do
stub_feature_flags(ci_reduce_persistent_ref_writes: false)
end
it 'does not populate pipeline ref' do
expect(pipeline.persistent_ref).not_to receive(:create)
service.execute
end
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment