diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2016-09-12 21:27:46 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2016-09-12 21:27:46 +0800 |
commit | 6baf9971db231a2c9923bd4d73e1f59fe255aab8 (patch) | |
tree | 13322110eac7f8f2fd88f9678b8df300681b9800 | |
parent | 575dc2b0d78b2680d6e5bb43f293c98d378b8733 (diff) | |
download | gitlab-ce-6baf9971db231a2c9923bd4d73e1f59fe255aab8.tar.gz |
Revert "reload instead, so that we don't have to change order"
This reverts commit 575dc2b0d78b2680d6e5bb43f293c98d378b8733.
-rw-r--r-- | app/models/commit_status.rb | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb index ad4e1c25231..438f807b118 100644 --- a/app/models/commit_status.rb +++ b/app/models/commit_status.rb @@ -69,22 +69,15 @@ class CommitStatus < ActiveRecord::Base commit_status.update_attributes finished_at: Time.now end - # We use around_transition to process pipeline on next stages as soon as possible, before the `after_*` is executed - around_transition any => [:success, :failed, :canceled] do |commit_status, block| - block.call + after_transition do |commit_status, transition| + commit_status.pipeline.try(:build_updated) unless transition.loopback? + end + after_transition any => [:success, :failed, :canceled] do |commit_status| commit_status.pipeline.try(:process!) true end - after_transition do |commit_status, transition| - pipeline = commit_status.pipeline - if !transition.loopback? && pipeline - pipeline.reload - pipeline.build_updated - end - end - after_transition [:created, :pending, :running] => :success do |commit_status| MergeRequests::MergeWhenBuildSucceedsService.new(commit_status.pipeline.project, nil).trigger(commit_status) end |