diff --git a/app/services/ci/external_pull_requests/create_pipeline_service.rb b/app/services/ci/external_pull_requests/create_pipeline_service.rb index dd93ca4708ecf8b02d85983207492a228f578e68..66127c94d35286a6d541228c858a2619ca9175e2 100644 --- a/app/services/ci/external_pull_requests/create_pipeline_service.rb +++ b/app/services/ci/external_pull_requests/create_pipeline_service.rb @@ -16,14 +16,9 @@ def execute(pull_request) private def create_pipeline_for(pull_request) - if ::Feature.enabled?(:ci_create_external_pr_pipeline_async, project, default_enabled: :yaml) - Ci::ExternalPullRequests::CreatePipelineWorker.perform_async( - project.id, current_user.id, pull_request.id - ) - else - Ci::CreatePipelineService.new(project, current_user, create_params(pull_request)) - .execute(:external_pull_request_event, external_pull_request: pull_request) - end + Ci::ExternalPullRequests::CreatePipelineWorker.perform_async( + project.id, current_user.id, pull_request.id + ) end def create_params(pull_request) diff --git a/config/feature_flags/development/ci_create_external_pr_pipeline_async.yml b/config/feature_flags/development/ci_create_external_pr_pipeline_async.yml deleted file mode 100644 index 48c7dbcf740cf354f875acb5eef910ea03cabbc9..0000000000000000000000000000000000000000 --- a/config/feature_flags/development/ci_create_external_pr_pipeline_async.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: ci_create_external_pr_pipeline_async -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68567 -rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/338908 -milestone: '14.3' -type: development -group: group::pipeline authoring -default_enabled: true diff --git a/ee/spec/requests/api/project_mirror_spec.rb b/ee/spec/requests/api/project_mirror_spec.rb index 7a1ddd8757a1c9f0c23d4115e94890f612809672..1e74f2f9f88fbc7c23e6feafc47c7db7105c40cf 100644 --- a/ee/spec/requests/api/project_mirror_spec.rb +++ b/ee/spec/requests/api/project_mirror_spec.rb @@ -84,29 +84,6 @@ def do_post(user: nil, params: {}, headers: { 'X-Hub-Signature' => 'signature' } subject(:send_request) { do_post(params: params) } shared_examples_for 'triggering pipeline creation' do - context 'when the FF ci_create_external_pr_pipeline_async is disabled' do - before do - stub_feature_flags(ci_create_external_pr_pipeline_async: false) - end - - let(:create_pipeline_service) { instance_double(Ci::CreatePipelineService) } - - it 'triggers a pipeline for pull request' do - expect(Ci::CreatePipelineService) - .to receive(:new) - .with(project_mirrored, user, pipeline_params) - .and_return(create_pipeline_service) - - expect(create_pipeline_service) - .to receive(:execute) - .with(:external_pull_request_event, any_args) - - send_request - - expect(response).to have_gitlab_http_status(:ok) - end - end - it 'enqueues Ci::ExternalPullRequests::CreatePipelineWorker' do expect { send_request } .to change { ExternalPullRequest.count }.by(1) diff --git a/ee/spec/services/ci/external_pull_requests/process_github_event_service_spec.rb b/ee/spec/services/ci/external_pull_requests/process_github_event_service_spec.rb index 506af653a56be77930136a8dff3d35a416944ac3..ede93fa105506c238fc40334d132203f9e65ca4f 100644 --- a/ee/spec/services/ci/external_pull_requests/process_github_event_service_spec.rb +++ b/ee/spec/services/ci/external_pull_requests/process_github_event_service_spec.rb @@ -53,29 +53,6 @@ let(:source_branch) { branch.name } let(:source_sha) { branch.target } - context 'when the FF ci_create_external_pr_pipeline_async is disabled' do - before do - stub_feature_flags(ci_create_external_pr_pipeline_async: false) - end - - let(:create_pipeline_service) { instance_double(Ci::CreatePipelineService) } - - it 'creates a pipeline and the external pull request' do - pipeline_params = { - ref: Gitlab::Git::BRANCH_REF_PREFIX + branch.name, - source_sha: branch.target, - target_sha: 'a09386439ca39abe575675ffd4b89ae824fec22f' - } - expect(Ci::CreatePipelineService).to receive(:new) - .with(project, user, pipeline_params) - .and_return(create_pipeline_service) - expect(create_pipeline_service).to receive(:execute) - .with(:external_pull_request_event, any_args) - - expect { subject.execute(params) }.to change { ExternalPullRequest.count }.by(1) - end - end - it 'enqueues Ci::ExternalPullRequests::CreatePipelineWorker' do expect { subject.execute(params) } .to change { ExternalPullRequest.count }.by(1) diff --git a/spec/services/ci/external_pull_requests/create_pipeline_service_spec.rb b/spec/services/ci/external_pull_requests/create_pipeline_service_spec.rb index 04d7563029501241c4b5732c107178499adc564f..d5881d3b204d2fa037c3c596249a08dc0197798f 100644 --- a/spec/services/ci/external_pull_requests/create_pipeline_service_spec.rb +++ b/spec/services/ci/external_pull_requests/create_pipeline_service_spec.rb @@ -26,28 +26,6 @@ pull_request.update!(source_branch: source_branch.name, source_sha: source_branch.target) end - context 'when the FF ci_create_external_pr_pipeline_async is disabled' do - before do - stub_feature_flags(ci_create_external_pr_pipeline_async: false) - end - - it 'creates a pipeline for external pull request', :aggregate_failures do - pipeline = execute.payload - - expect(execute).to be_success - expect(pipeline).to be_valid - expect(pipeline).to be_persisted - expect(pipeline).to be_external_pull_request_event - expect(pipeline).to eq(project.ci_pipelines.last) - expect(pipeline.external_pull_request).to eq(pull_request) - expect(pipeline.user).to eq(user) - expect(pipeline.status).to eq('created') - expect(pipeline.ref).to eq(pull_request.source_branch) - expect(pipeline.sha).to eq(pull_request.source_sha) - expect(pipeline.source_sha).to eq(pull_request.source_sha) - end - end - it 'enqueues Ci::ExternalPullRequests::CreatePipelineWorker' do expect { execute } .to change { ::Ci::ExternalPullRequests::CreatePipelineWorker.jobs.count }