Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2019-08-02 17:51:20 +0300
committerSean McGivern <sean@gitlab.com>2019-08-02 17:51:20 +0300
commit8156e77c1a25bc6050e5036fa3bbfd29201a6d5c (patch)
tree16345b3f34d3e936c5bb64d3d0710e7454927974 /app
parenteb2d4adf38726da62f62e850d181cedf12c64c5e (diff)
parent181b9b3e7328070f6846c9547d166ba0128e415c (diff)
Merge branch 'respect-needs-on-artifacts' into 'master'
Respect needs on artifacts Closes #65466 See merge request gitlab-org/gitlab-ce!31413
Diffstat (limited to 'app')
-rw-r--r--app/models/ci/build.rb16
1 files changed, 6 insertions, 10 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index dd2bfc42af9..ac88d9714ac 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -715,18 +715,14 @@ module Ci
depended_jobs = depends_on_builds
- # find all jobs that are dependent on
- if options[:dependencies].present?
- depended_jobs = depended_jobs.select do |job|
- options[:dependencies].include?(job.name)
- end
+ # find all jobs that are needed
+ if Feature.enabled?(:ci_dag_support, project) && needs.exists?
+ depended_jobs = depended_jobs.where(name: needs.select(:name))
end
- # find all jobs that are needed by this one
- if options[:needs].present?
- depended_jobs = depended_jobs.select do |job|
- options[:needs].include?(job.name)
- end
+ # find all jobs that are dependent on
+ if options[:dependencies].present?
+ depended_jobs = depended_jobs.where(name: options[:dependencies])
end
depended_jobs