diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2017-04-03 20:59:21 +0000 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2017-04-03 20:59:21 +0000 |
commit | e473a90700cad4dea6c883122f793b5d6453c7c8 (patch) | |
tree | 581c25630664c2fa9f3b6bda6d591550d29c1342 | |
parent | c2b35320e05c5e0cb3bdc11fa1418ed5f3e5c76f (diff) | |
parent | 068f4b47c82f6c30dd2ab332f6af29abf8f4a6ae (diff) | |
download | gitlab-ce-e473a90700cad4dea6c883122f793b5d6453c7c8.tar.gz |
Merge branch 'fix/gb/remove-deprecated-pipeline-processing-code' into 'master'
Remove deprecated code from pipeline processing service
Closes #30052
See merge request !10266
3 files changed, 4 insertions, 74 deletions
diff --git a/app/services/ci/process_pipeline_service.rb b/app/services/ci/process_pipeline_service.rb index 2935d00c075..33edcd60944 100644 --- a/app/services/ci/process_pipeline_service.rb +++ b/app/services/ci/process_pipeline_service.rb @@ -5,8 +5,6 @@ module Ci def execute(pipeline) @pipeline = pipeline - ensure_created_builds! # TODO, remove me in 9.0 - new_builds = stage_indexes_of_created_builds.map do |index| process_stage(index) @@ -73,18 +71,5 @@ module Ci def created_builds pipeline.builds.created end - - # This method is DEPRECATED and should be removed in 9.0. - # - # We need it to maintain backwards compatibility with previous versions - # when builds were not created within one transaction with the pipeline. - # - def ensure_created_builds! - return if created_builds.any? - - Ci::CreatePipelineBuildsService - .new(project, current_user) - .execute(pipeline) - end end end diff --git a/changelogs/unreleased/fix-gb-remove-deprecated-pipeline-processing-code.yml b/changelogs/unreleased/fix-gb-remove-deprecated-pipeline-processing-code.yml new file mode 100644 index 00000000000..32862b527fd --- /dev/null +++ b/changelogs/unreleased/fix-gb-remove-deprecated-pipeline-processing-code.yml @@ -0,0 +1,4 @@ +--- +title: Drop support for correctly processing legacy pipelines +merge_request: 10266 +author: diff --git a/spec/services/ci/process_pipeline_service_spec.rb b/spec/services/ci/process_pipeline_service_spec.rb index d93616c4f50..bb98fb37a90 100644 --- a/spec/services/ci/process_pipeline_service_spec.rb +++ b/spec/services/ci/process_pipeline_service_spec.rb @@ -418,65 +418,6 @@ describe Ci::ProcessPipelineService, '#execute', :services do end end - context 'when there are builds that are not created yet' do - let(:pipeline) do - create(:ci_pipeline, config: config) - end - - let(:config) do - { rspec: { stage: 'test', script: 'rspec' }, - deploy: { stage: 'deploy', script: 'rsync' } } - end - - before do - create_build('linux', stage: 'build', stage_idx: 0) - create_build('mac', stage: 'build', stage_idx: 0) - end - - it 'processes the pipeline' do - # Currently we have five builds with state created - # - expect(builds.count).to eq(0) - expect(all_builds.count).to eq(2) - - # Process builds service will enqueue builds from the first stage. - # - process_pipeline - - expect(builds.count).to eq(2) - expect(all_builds.count).to eq(2) - - # When builds succeed we will enqueue remaining builds. - # - # We will have 2 succeeded, 1 pending (from stage test), total 4 (two - # additional build from `.gitlab-ci.yml`). - # - succeed_pending - process_pipeline - - expect(builds.success.count).to eq(2) - expect(builds.pending.count).to eq(1) - expect(all_builds.count).to eq(4) - - # When pending merge_when_pipeline_succeeds in stage test, we enqueue deploy stage. - # - succeed_pending - process_pipeline - - expect(builds.pending.count).to eq(1) - expect(builds.success.count).to eq(3) - expect(all_builds.count).to eq(4) - - # When the last one succeeds we have 4 successful builds. - # - succeed_pending - process_pipeline - - expect(builds.success.count).to eq(4) - expect(all_builds.count).to eq(4) - end - end - def process_pipeline described_class.new(pipeline.project, user).execute(pipeline) end |