Commit d0834485 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch 'mc/feature/remove-create_cross_project_pipeline_worker_rename-ff' into 'master'

Remove create_cross_project_pipeline_worker_rename FF

See merge request gitlab-org/gitlab!71065
parents 8abf12af 6abb1eee
...@@ -31,11 +31,7 @@ module Ci ...@@ -31,11 +31,7 @@ module Ci
next unless bridge.triggers_downstream_pipeline? next unless bridge.triggers_downstream_pipeline?
bridge.run_after_commit do bridge.run_after_commit do
if ::Feature.enabled?(:create_cross_project_pipeline_worker_rename, default_enabled: :yaml) ::Ci::CreateDownstreamPipelineWorker.perform_async(bridge.id)
::Ci::CreateDownstreamPipelineWorker.perform_async(bridge.id)
else
::Ci::CreateCrossProjectPipelineWorker.perform_async(bridge.id)
end
end end
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 ...@@ -41,28 +41,10 @@ RSpec.describe Ci::Bridge do
bridge.enqueue! bridge.enqueue!
end end
context 'when the create_cross_project_pipeline_worker_rename feature is enabled' do it 'does not schedule downstream pipeline creation' do
before do bridge.enqueue!
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!
expect(::Ci::CreateCrossProjectPipelineWorker.jobs).to be_empty expect(::Ci::CreateDownstreamPipelineWorker.jobs).to be_empty
end
end end
end end
end end
......
...@@ -73,61 +73,21 @@ RSpec.describe Ci::Bridge do ...@@ -73,61 +73,21 @@ RSpec.describe Ci::Bridge do
describe 'state machine transitions' do describe 'state machine transitions' do
context 'when bridge points towards downstream' do context 'when bridge points towards downstream' do
%i[created manual].each do |status| %i[created manual].each do |status|
context 'when the create_cross_project_pipeline_worker_rename feature is enabled' do it "schedules downstream pipeline creation when the status is #{status}" do
before do bridge.status = status
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!
expect(::Ci::CreateCrossProjectPipelineWorker.jobs.last['args']).to eq([bridge.id]) bridge.enqueue!
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!
expect(::Ci::CreateDownstreamPipelineWorker.jobs.last['args']).to eq([bridge.id]) expect(::Ci::CreateDownstreamPipelineWorker.jobs.last['args']).to eq([bridge.id])
end end
end end
context 'when the create_cross_project_pipeline_worker_rename feature is not enabled' do it "schedules downstream pipeline creation when the status is waiting for resource" do
before do bridge.status = :waiting_for_resource
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.enqueue_waiting_for_resource!
bridge.status = :waiting_for_resource
bridge.enqueue_waiting_for_resource! expect(::Ci::CreateDownstreamPipelineWorker.jobs.last['args']).to match_array([bridge.id])
expect(::Ci::CreateCrossProjectPipelineWorker.jobs.last['args']).to eq([bridge.id])
end
end end
it 'raises error when the status is failed' do it 'raises error when the status is failed' do
......
...@@ -29,28 +29,10 @@ RSpec.describe Ci::PlayBridgeService, '#execute' do ...@@ -29,28 +29,10 @@ RSpec.describe Ci::PlayBridgeService, '#execute' do
expect(bridge.reload.user).to eq(user) expect(bridge.reload.user).to eq(user)
end end
context 'when the create_cross_project_pipeline_worker_rename feature is enabled' do it 'enqueues Ci::CreateDownstreamPipelineWorker' do
before do expect(::Ci::CreateDownstreamPipelineWorker).to receive(:perform_async).with(bridge.id)
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
context 'when the create_cross_project_pipeline_worker_rename feature is not enabled' do execute_service
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
end end
context 'when a subsequent job is skipped' do 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