diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb index b74c65c2627c748710cff41f5aa6df7d0ebfbd76..1e76cbe7c01bda9e4bf33f7c50aaa427ef53e6c7 100644 --- a/app/models/ci/pipeline.rb +++ b/app/models/ci/pipeline.rb @@ -63,7 +63,7 @@ module Ci push: 1, web: 2, trigger: 3, - schedule: 4, + source_schedule: 4, api: 5, external: 6 } diff --git a/app/workers/pipeline_schedule_worker.rb b/app/workers/pipeline_schedule_worker.rb index 85d1ffe0fa92c062552412a880e8d6503882a5bf..412df94d238aaae77dcc740caaa691178ed63da2 100644 --- a/app/workers/pipeline_schedule_worker.rb +++ b/app/workers/pipeline_schedule_worker.rb @@ -12,7 +12,7 @@ class PipelineScheduleWorker pipeline = Ci::CreatePipelineService.new(schedule.project, schedule.owner, ref: schedule.ref) - .execute(:schedule, ignore_skip_ci: true, save_on_errors: false, schedule: schedule) + .execute(:source_schedule, ignore_skip_ci: true, save_on_errors: false, schedule: schedule) schedule.deactivate! unless pipeline.persisted? rescue => e diff --git a/app/workers/run_pipeline_schedule_worker.rb b/app/workers/run_pipeline_schedule_worker.rb index f72331c003a7b502cae0321646c33fe6deb81c54..626c3e23f73d7171eb4daadf4223674c83673dd4 100644 --- a/app/workers/run_pipeline_schedule_worker.rb +++ b/app/workers/run_pipeline_schedule_worker.rb @@ -21,6 +21,6 @@ class RunPipelineScheduleWorker Ci::CreatePipelineService.new(schedule.project, user, ref: schedule.ref) - .execute(:schedule, ignore_skip_ci: true, save_on_errors: false, schedule: schedule) + .execute(:source_schedule, ignore_skip_ci: true, save_on_errors: false, schedule: schedule) end end diff --git a/spec/workers/pipeline_schedule_worker_spec.rb b/spec/workers/pipeline_schedule_worker_spec.rb index a2fe4734d47606a9d3322e6a0d1a23a96de027f3..3ce394789be5f477d4ddbdde01c3b2aa30e41aa7 100644 --- a/spec/workers/pipeline_schedule_worker_spec.rb +++ b/spec/workers/pipeline_schedule_worker_spec.rb @@ -25,7 +25,7 @@ describe PipelineScheduleWorker do shared_examples 'successful scheduling' do it 'creates a new pipeline' do expect { subject }.to change { project.pipelines.count }.by(1) - expect(Ci::Pipeline.last).to be_schedule + expect(Ci::Pipeline.last).to be_source_schedule pipeline_schedule.reload expect(pipeline_schedule.next_run_at).to be > Time.now diff --git a/spec/workers/run_pipeline_schedule_worker_spec.rb b/spec/workers/run_pipeline_schedule_worker_spec.rb index 481a84837f99bd06bf39be26a4233e161593f520..afda3d9287bf79996a431b77aa2dc72e47497dc8 100644 --- a/spec/workers/run_pipeline_schedule_worker_spec.rb +++ b/spec/workers/run_pipeline_schedule_worker_spec.rb @@ -30,7 +30,7 @@ describe RunPipelineScheduleWorker do it 'calls the Service' do expect(Ci::CreatePipelineService).to receive(:new).with(project, user, ref: pipeline_schedule.ref).and_return(create_pipeline_service) - expect(create_pipeline_service).to receive(:execute).with(:schedule, ignore_skip_ci: true, save_on_errors: false, schedule: pipeline_schedule) + expect(create_pipeline_service).to receive(:execute).with(:source_schedule, ignore_skip_ci: true, save_on_errors: false, schedule: pipeline_schedule) worker.perform(pipeline_schedule.id, user.id) end