summaryrefslogtreecommitdiff
path: root/app/models/ci/pipeline.rb
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2019-08-02 16:32:52 +0200
committerKamil Trzciński <ayufan@ayufan.eu>2019-08-02 18:41:40 +0200
commit684751d3c2233ee1ac33cf623e8b7822c60209d3 (patch)
tree5696d3f3e6a99a806ff185f3d9c11c22e50db92c /app/models/ci/pipeline.rb
parent8156e77c1a25bc6050e5036fa3bbfd29201a6d5c (diff)
downloadgitlab-ce-684751d3c2233ee1ac33cf623e8b7822c60209d3.tar.gz
Make needs: to require previous jobsmake-needs-strong-connection
This changes `needs:` from weak reference to have a strong reference. This means that job will not be created unless all needs are present as part of a pipeline.
Diffstat (limited to 'app/models/ci/pipeline.rb')
-rw-r--r--app/models/ci/pipeline.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index 3515f0b83ee..ffab4e82f90 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -504,8 +504,9 @@ module Ci
return [] unless config_processor
strong_memoize(:stage_seeds) do
- seeds = config_processor.stages_attributes.map do |attributes|
- Gitlab::Ci::Pipeline::Seed::Stage.new(self, attributes)
+ seeds = config_processor.stages_attributes.inject([]) do |previous_stages, attributes|
+ seed = Gitlab::Ci::Pipeline::Seed::Stage.new(self, attributes, previous_stages)
+ previous_stages + [seed]
end
seeds.select(&:included?)