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/lib
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-12 09:09:05 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-12 09:09:05 +0300
commit8c9dc985b90c353b33cb829caf51f8320171bc15 (patch)
tree9a68886dbea1aefabddb46bbd3faf961eab22ae6 /lib
parent500626a5c953ad81cfc3ed74bf0148c075617e58 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/ci/build/rules.rb8
-rw-r--r--lib/gitlab/ci/config/entry/bridge.rb3
-rw-r--r--lib/gitlab/ci/config/entry/job.rb3
-rw-r--r--lib/gitlab/ci/config/entry/rules/rule.rb5
-rw-r--r--lib/gitlab/ci/yaml_processor.rb1
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],