diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-10-03 12:45:34 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-10-04 14:42:32 +0200 |
commit | 68774452a47ec71a490eb5eaeedd5a3222aa2c68 (patch) | |
tree | 1b1026a3f0b424a7de9de72f65abf4f7fbd8997c /app/models | |
parent | 4567e624a06358f0e3451be51d134f8dd22c199d (diff) | |
download | gitlab-ce-68774452a47ec71a490eb5eaeedd5a3222aa2c68.tar.gz |
Fix async pipeline and remove unrelated changes
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/ci/build.rb | 2 | ||||
-rw-r--r-- | app/models/ci/pipeline.rb | 8 | ||||
-rw-r--r-- | app/models/commit_status.rb | 7 |
3 files changed, 2 insertions, 15 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index 7c9899334ad..5dbf66173de 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -67,7 +67,7 @@ module Ci environment: build.environment, status_event: 'enqueue' ) - MergeRequests::AddTodoWhenBuildFailsService.new(build.project, nil).close(new_build.pipeline) + MergeRequests::AddTodoWhenBuildFailsService.new(build.project, nil).close(new_build) build.pipeline.mark_as_processable_after_stage(build.stage_idx) new_build end diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb index da0b9d83e1d..4c38a54ea3a 100644 --- a/app/models/ci/pipeline.rb +++ b/app/models/ci/pipeline.rb @@ -73,14 +73,6 @@ module Ci after_transition do |pipeline, transition| pipeline.execute_hooks unless transition.loopback? end - - after_transition [:created, :pending, :running] => :success do |pipeline| - MergeRequests::MergeWhenBuildSucceedsService.new(pipeline.project, nil).trigger(pipeline) - end - - after_transition any => :failed do |pipeline| - MergeRequests::AddTodoWhenBuildFailsService.new(pipeline.project, nil).execute(pipeline) - end end # ref can't be HEAD or SHA, can only be branch/tag name diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb index 3d5e449f403..b0718e2213c 100644 --- a/app/models/commit_status.rb +++ b/app/models/commit_status.rb @@ -69,11 +69,6 @@ class CommitStatus < ActiveRecord::Base commit_status.update_attributes finished_at: Time.now end - after_transition any => [:success, :failed, :canceled] do |commit_status| - commit_status.pipeline.try(:process!) - true - end - after_transition [:created, :pending, :running] => :success do |commit_status| MergeRequests::MergeWhenBuildSucceedsService.new(commit_status.pipeline.project, nil).trigger(commit_status) end @@ -86,7 +81,7 @@ class CommitStatus < ActiveRecord::Base if commit_status.pipeline && !transition.loopback? ProcessPipelineWorker.perform_async( commit_status.pipeline.id, - process: HasStatus.COMPLETED_STATUSES.include?(commit_status.status)) + process: HasStatus::COMPLETED_STATUSES.include?(commit_status.status)) end true |