diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
commit | b76ae638462ab0f673e5915986070518dd3f9ad3 (patch) | |
tree | bdab0533383b52873be0ec0eb4d3c66598ff8b91 /lib/gitlab/ci/config/entry/processable.rb | |
parent | 434373eabe7b4be9593d18a585fb763f1e5f1a6f (diff) |
Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42
Diffstat (limited to 'lib/gitlab/ci/config/entry/processable.rb')
-rw-r--r-- | lib/gitlab/ci/config/entry/processable.rb | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/lib/gitlab/ci/config/entry/processable.rb b/lib/gitlab/ci/config/entry/processable.rb index 79dfb0eec1d..3543b5493bd 100644 --- a/lib/gitlab/ci/config/entry/processable.rb +++ b/lib/gitlab/ci/config/entry/processable.rb @@ -31,7 +31,7 @@ module Gitlab with_options allow_nil: true do validates :extends, array_of_strings_or_string: true - validates :rules, array_of_hashes: true + validates :rules, nested_array_of_hashes: true validates :resource_group, type: String end end @@ -88,9 +88,6 @@ module Gitlab validate_against_warnings end - # inherit root variables - @root_variables_value = deps&.variables_value # rubocop:disable Gitlab/ModuleWithInstanceVariables - yield if block_given? end end @@ -123,27 +120,13 @@ module Gitlab stage: stage_value, extends: extends, rules: rules_value, - variables: root_and_job_variables_value, # https://gitlab.com/gitlab-org/gitlab/-/issues/300581 - job_variables: job_variables, + job_variables: variables_value.to_h, root_variables_inheritance: root_variables_inheritance, only: only_value, except: except_value, resource_group: resource_group }.compact end - def root_and_job_variables_value - root_variables = @root_variables_value.to_h # rubocop:disable Gitlab/ModuleWithInstanceVariables - root_variables = root_variables.select do |key, _| - inherit_entry&.variables_entry&.inherit?(key) - end - - root_variables.merge(variables_value.to_h) - end - - def job_variables - variables_value.to_h - end - def root_variables_inheritance inherit_entry&.variables_entry&.value end |