summaryrefslogtreecommitdiff
path: root/app/models/ci/build.rb
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2019-08-02 13:28:59 +0200
committerKamil Trzciński <ayufan@ayufan.eu>2019-08-02 13:29:04 +0200
commit181b9b3e7328070f6846c9547d166ba0128e415c (patch)
tree382ad3ee9b0d4fb68275247cb098d8cc618dec21 /app/models/ci/build.rb
parentdb104aaf9236050ea5fd921efab664892a6b1880 (diff)
downloadgitlab-ce-181b9b3e7328070f6846c9547d166ba0128e415c.tar.gz
Respect needs for artifactsrespect-needs-on-artifacts
When `needs:` is defined, the value of it is not respected when returning a list of artifacts to the runner from the job.
Diffstat (limited to 'app/models/ci/build.rb')
-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