reload instead, so that we don't have to change order
This commit is contained in:
parent
47dccfb329
commit
575dc2b0d7
1 changed files with 11 additions and 4 deletions
|
@ -69,15 +69,22 @@ class CommitStatus < ActiveRecord::Base
|
|||
commit_status.update_attributes finished_at: Time.now
|
||||
end
|
||||
|
||||
after_transition do |commit_status, transition|
|
||||
commit_status.pipeline.try(:build_updated) unless transition.loopback?
|
||||
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 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
|
||||
|
|
Loading…
Reference in a new issue