Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
parent
265dc26fed
commit
28bc8eafd3
|
@ -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
|
||||
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
---
|
||||
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
|
|
@ -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
|
||||
|
||||
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])
|
||||
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)
|
||||
|
||||
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
|
||||
execute_service
|
||||
end
|
||||
|
||||
context 'when a subsequent job is skipped' do
|
||||
|
|
Loading…
Reference in New Issue