summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2017-12-04 18:49:50 +0000
committerKamil Trzciński <ayufan@ayufan.eu>2017-12-04 18:49:50 +0000
commit08125a6bd549a852ff0bb39f274081bb71ca9ae9 (patch)
tree4ce53e74fa4b912e6e4dce385736e5920ca53c3d
parent6e12e83d71b0b3783344c2258a9b4c2af000c90a (diff)
parent9737f582a10ff43cac0ee47f20f200ffd744b93a (diff)
downloadgitlab-ce-40818-last-push-widget-does-not-appear-after-pushing-new-commit-to-a-branch-that-was-previously-merged-to-master.tar.gz
Merge branch 'backstage/gb/improve-pipeline-chain-reduce-side-effects' into 'master'40818-last-push-widget-does-not-appear-after-pushing-new-commit-to-a-branch-that-was-previously-merged-to-master
Reduce pipeline chain life span to minimize side effects See merge request gitlab-org/gitlab-ce!15716
-rw-r--r--lib/gitlab/ci/pipeline/chain/sequence.rb13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/gitlab/ci/pipeline/chain/sequence.rb b/lib/gitlab/ci/pipeline/chain/sequence.rb
index 015f2988327..e24630656d3 100644
--- a/lib/gitlab/ci/pipeline/chain/sequence.rb
+++ b/lib/gitlab/ci/pipeline/chain/sequence.rb
@@ -5,20 +5,19 @@ module Gitlab
class Sequence
def initialize(pipeline, command, sequence)
@pipeline = pipeline
+ @command = command
+ @sequence = sequence
@completed = []
-
- @sequence = sequence.map do |chain|
- chain.new(pipeline, command)
- end
end
def build!
- @sequence.each do |step|
- step.perform!
+ @sequence.each do |chain|
+ step = chain.new(@pipeline, @command)
+ step.perform!
break if step.break?
- @completed << step
+ @completed.push(step)
end
@pipeline.tap do