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
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-16 15:08:32 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-16 15:08:32 +0300
commitc158fa8d69c704663d289341a014c44c062cda88 (patch)
treed0cac82a9ac9e9ad28bb0030266eb8d5dc91fbbc /lib/gitlab/ci/config/entry/job.rb
parentb806264d29b8d52ccb78a41dcc3d67f2b040700c (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/ci/config/entry/job.rb')
-rw-r--r--lib/gitlab/ci/config/entry/job.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/gitlab/ci/config/entry/job.rb b/lib/gitlab/ci/config/entry/job.rb
index 1b9daa2dbc7..967db0c628c 100644
--- a/lib/gitlab/ci/config/entry/job.rb
+++ b/lib/gitlab/ci/config/entry/job.rb
@@ -55,11 +55,12 @@ module Gitlab
validates :start_in, duration: { limit: '1 week' }, if: :delayed?
validates :start_in, absence: true, if: -> { has_rules? || !delayed? }
- validate do
+ validate on: :composed do
next unless dependencies.present?
- next unless needs.present?
+ next unless needs_value.present?
+
+ missing_needs = dependencies - needs_value[:job].pluck(:name) # rubocop:disable CodeReuse/ActiveRecord (Array#pluck)
- missing_needs = dependencies - needs
if missing_needs.any?
errors.add(:dependencies, "the #{missing_needs.join(", ")} should be part of needs")
end