diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-12 06:09:05 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-12 06:09:05 +0000 |
commit | 8c9dc985b90c353b33cb829caf51f8320171bc15 (patch) | |
tree | 9a68886dbea1aefabddb46bbd3faf961eab22ae6 /lib | |
parent | 500626a5c953ad81cfc3ed74bf0148c075617e58 (diff) | |
download | gitlab-ce-8c9dc985b90c353b33cb829caf51f8320171bc15.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/ci/build/rules.rb | 8 | ||||
-rw-r--r-- | lib/gitlab/ci/config/entry/bridge.rb | 3 | ||||
-rw-r--r-- | lib/gitlab/ci/config/entry/job.rb | 3 | ||||
-rw-r--r-- | lib/gitlab/ci/config/entry/rules/rule.rb | 5 | ||||
-rw-r--r-- | lib/gitlab/ci/yaml_processor.rb | 1 |
5 files changed, 13 insertions, 7 deletions
diff --git a/lib/gitlab/ci/build/rules.rb b/lib/gitlab/ci/build/rules.rb index c705b6f86c7..a500a0cc35d 100644 --- a/lib/gitlab/ci/build/rules.rb +++ b/lib/gitlab/ci/build/rules.rb @@ -6,11 +6,12 @@ module Gitlab class Rules include ::Gitlab::Utils::StrongMemoize - Result = Struct.new(:when, :start_in) do + Result = Struct.new(:when, :start_in, :allow_failure) do def build_attributes { when: self.when, - options: { start_in: start_in }.compact + options: { start_in: start_in }.compact, + allow_failure: allow_failure }.compact end @@ -30,7 +31,8 @@ module Gitlab elsif matched_rule = match_rule(pipeline, context) Result.new( matched_rule.attributes[:when] || @default_when, - matched_rule.attributes[:start_in] + matched_rule.attributes[:start_in], + matched_rule.attributes[:allow_failure] ) else Result.new('never') diff --git a/lib/gitlab/ci/config/entry/bridge.rb b/lib/gitlab/ci/config/entry/bridge.rb index 7a6840218e1..c0247dca73d 100644 --- a/lib/gitlab/ci/config/entry/bridge.rb +++ b/lib/gitlab/ci/config/entry/bridge.rb @@ -132,7 +132,8 @@ module Gitlab variables: (variables_value if variables_defined?), rules: (rules_value if has_rules?), only: only_value, - except: except_value }.compact + except: except_value, + scheduling_type: needs_defined? && !bridge_needs ? :dag : :stage }.compact end def bridge_needs diff --git a/lib/gitlab/ci/config/entry/job.rb b/lib/gitlab/ci/config/entry/job.rb index 124581c961f..ffc8cb887e8 100644 --- a/lib/gitlab/ci/config/entry/job.rb +++ b/lib/gitlab/ci/config/entry/job.rb @@ -258,7 +258,8 @@ module Gitlab after_script: after_script_value, ignore: ignored?, needs: needs_defined? ? needs_value : nil, - resource_group: resource_group } + resource_group: resource_group, + scheduling_type: needs_defined? ? :dag : :stage } end end end diff --git a/lib/gitlab/ci/config/entry/rules/rule.rb b/lib/gitlab/ci/config/entry/rules/rule.rb index 59e0ef583ae..8ffd49b8a93 100644 --- a/lib/gitlab/ci/config/entry/rules/rule.rb +++ b/lib/gitlab/ci/config/entry/rules/rule.rb @@ -9,10 +9,10 @@ module Gitlab include ::Gitlab::Config::Entry::Attributable CLAUSES = %i[if changes exists].freeze - ALLOWED_KEYS = %i[if changes exists when start_in].freeze + ALLOWED_KEYS = %i[if changes exists when start_in allow_failure].freeze ALLOWABLE_WHEN = %w[on_success on_failure always never manual delayed].freeze - attributes :if, :changes, :exists, :when, :start_in + attributes :if, :changes, :exists, :when, :start_in, :allow_failure validations do validates :config, presence: true @@ -26,6 +26,7 @@ module Gitlab validates :if, expression: true validates :changes, :exists, array_of_strings: true, length: { maximum: 50 } validates :when, allowed_values: { in: ALLOWABLE_WHEN } + validates :allow_failure, boolean: true end validate do diff --git a/lib/gitlab/ci/yaml_processor.rb b/lib/gitlab/ci/yaml_processor.rb index 080a8ac107d..ae3ff4a51e2 100644 --- a/lib/gitlab/ci/yaml_processor.rb +++ b/lib/gitlab/ci/yaml_processor.rb @@ -65,6 +65,7 @@ module Gitlab rules: job[:rules], cache: job[:cache], resource_group_key: job[:resource_group], + scheduling_type: job[:scheduling_type], options: { image: job[:image], services: job[:services], |