Commit 6abb1eee authored by Matija Čupić's avatar Matija Čupić Committed by Douglas Barbosa Alexandre

Remove create_cross_project_pipeline_worker_rename FF

parent 0f316f43
......@@ -31,11 +31,7 @@ module Ci
next unless bridge.triggers_downstream_pipeline?
bridge.run_after_commit do
if ::Feature.enabled?(:create_cross_project_pipeline_worker_rename, default_enabled: :yaml)
::Ci::CreateDownstreamPipelineWorker.perform_async(bridge.id)
else
::Ci::CreateCrossProjectPipelineWorker.perform_async(bridge.id)
end
::Ci::CreateDownstreamPipelineWorker.perform_async(bridge.id)
end
end
......
---
name: create_cross_project_pipeline_worker_rename
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/70816
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/341410
milestone: '14.4'
type: development
group: group::pipeline authoring
default_enabled: false
......@@ -41,28 +41,10 @@ RSpec.describe Ci::Bridge do
bridge.enqueue!
end
context 'when the create_cross_project_pipeline_worker_rename feature is enabled' do
before do
stub_feature_flags(create_cross_project_pipeline_worker_rename: true)
end
it 'does not schedule downstream pipeline creation' do
bridge.enqueue!
expect(::Ci::CreateDownstreamPipelineWorker.jobs).to be_empty
end
end
context 'when the create_cross_project_pipeline_worker_rename feature is not enabled' do
before do
stub_feature_flags(create_cross_project_pipeline_worker_rename: false)
end
it 'does not schedule downstream pipeline creation' do
bridge.enqueue!
it 'does not schedule downstream pipeline creation' do
bridge.enqueue!
expect(::Ci::CreateCrossProjectPipelineWorker.jobs).to be_empty
end
expect(::Ci::CreateDownstreamPipelineWorker.jobs).to be_empty
end
end
end
......
......@@ -73,61 +73,21 @@ RSpec.describe Ci::Bridge do
describe 'state machine transitions' do
context 'when bridge points towards downstream' do
%i[created manual].each do |status|
context 'when the create_cross_project_pipeline_worker_rename feature is enabled' do
before do
stub_feature_flags(create_cross_project_pipeline_worker_rename: true)
end
it "schedules downstream pipeline creation when the status is #{status}" do
bridge.status = status
bridge.enqueue!
expect(::Ci::CreateDownstreamPipelineWorker.jobs.last['args']).to eq([bridge.id])
end
end
context 'when the create_cross_project_pipeline_worker_rename feature is not enabled' do
before do
stub_feature_flags(create_cross_project_pipeline_worker_rename: false)
end
it "schedules downstream pipeline creation when the status is #{status}" do
bridge.status = status
bridge.enqueue!
it "schedules downstream pipeline creation when the status is #{status}" do
bridge.status = status
expect(::Ci::CreateCrossProjectPipelineWorker.jobs.last['args']).to eq([bridge.id])
end
end
end
context 'when the create_cross_project_pipeline_worker_rename feature is enabled' do
before do
stub_feature_flags(create_cross_project_pipeline_worker_rename: true)
end
it "schedules downstream pipeline creation when the status is waiting for resource" do
bridge.status = :waiting_for_resource
bridge.enqueue_waiting_for_resource!
bridge.enqueue!
expect(::Ci::CreateDownstreamPipelineWorker.jobs.last['args']).to eq([bridge.id])
end
end
context 'when the create_cross_project_pipeline_worker_rename feature is not enabled' do
before do
stub_feature_flags(create_cross_project_pipeline_worker_rename: false)
end
it "schedules downstream pipeline creation when the status is waiting for resource" do
bridge.status = :waiting_for_resource
it "schedules downstream pipeline creation when the status is waiting for resource" do
bridge.status = :waiting_for_resource
bridge.enqueue_waiting_for_resource!
bridge.enqueue_waiting_for_resource!
expect(::Ci::CreateCrossProjectPipelineWorker.jobs.last['args']).to eq([bridge.id])
end
expect(::Ci::CreateDownstreamPipelineWorker.jobs.last['args']).to match_array([bridge.id])
end
it 'raises error when the status is failed' do
......
......@@ -29,28 +29,10 @@ RSpec.describe Ci::PlayBridgeService, '#execute' do
expect(bridge.reload.user).to eq(user)
end
context 'when the create_cross_project_pipeline_worker_rename feature is enabled' do
before do
stub_feature_flags(create_cross_project_pipeline_worker_rename: true)
end
it 'enqueues Ci::CreateDownstreamPipelineWorker' do
expect(::Ci::CreateDownstreamPipelineWorker).to receive(:perform_async).with(bridge.id)
execute_service
end
end
it 'enqueues Ci::CreateDownstreamPipelineWorker' do
expect(::Ci::CreateDownstreamPipelineWorker).to receive(:perform_async).with(bridge.id)
context 'when the create_cross_project_pipeline_worker_rename feature is not enabled' do
before do
stub_feature_flags(create_cross_project_pipeline_worker_rename: false)
end
it 'enqueues Ci::CreateCrossProjectPipelineWorker' do
expect(::Ci::CreateCrossProjectPipelineWorker).to receive(:perform_async).with(bridge.id)
execute_service
end
execute_service
end
context 'when a subsequent job is skipped' do
......
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