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
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
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,30 +41,12 @@ 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!
expect(::Ci::CreateCrossProjectPipelineWorker.jobs).to be_empty
end
end
end
end
describe '#inherit_status_from_upstream!' do
......
......@@ -73,11 +73,6 @@ 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
......@@ -87,47 +82,12 @@ RSpec.describe Ci::Bridge do
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])
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])
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
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,29 +29,11 @@ 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
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
end
context 'when a subsequent job is skipped' do
let!(:job) { create(:ci_build, :skipped, pipeline: pipeline, stage_idx: bridge.stage_idx + 1) }
......
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