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-12-15 18:09:59 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-12-15 18:09:59 +0300
commit0ff373dc416216d02760c7c162ee23382eb1f4a3 (patch)
tree45955917f14f68b0d2a2357766644f49a8476af6 /lib/gitlab/ci/pipeline/seed
parente894595ad8ebdbd565bacaeb126d44f80a636fd8 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/ci/pipeline/seed')
-rw-r--r--lib/gitlab/ci/pipeline/seed/build.rb22
1 files changed, 19 insertions, 3 deletions
diff --git a/lib/gitlab/ci/pipeline/seed/build.rb b/lib/gitlab/ci/pipeline/seed/build.rb
index 91dbcc616ea..105221dd6af 100644
--- a/lib/gitlab/ci/pipeline/seed/build.rb
+++ b/lib/gitlab/ci/pipeline/seed/build.rb
@@ -60,6 +60,7 @@ module Gitlab
@seed_attributes
.deep_merge(pipeline_attributes)
.deep_merge(rules_attributes)
+ .deep_merge(allow_failure_criteria_attributes)
.deep_merge(cache_attributes)
end
@@ -154,9 +155,13 @@ module Gitlab
end
def rules_attributes
- return {} unless @using_rules
-
- rules_result.build_attributes
+ strong_memoize(:rules_attributes) do
+ if @using_rules
+ rules_result.build_attributes
+ else
+ {}
+ end
+ end
end
def rules_result
@@ -176,6 +181,17 @@ module Gitlab
@cache.build_attributes
end
end
+
+ # If a job uses `allow_failure:exit_codes` and `rules:allow_failure`
+ # we need to prevent the exit codes from being persisted because they
+ # would break the behavior defined by `rules:allow_failure`.
+ def allow_failure_criteria_attributes
+ return {} unless ::Gitlab::Ci::Features.allow_failure_with_exit_codes_enabled?
+ return {} if rules_attributes[:allow_failure].nil?
+ return {} unless @seed_attributes.dig(:options, :allow_failure_criteria)
+
+ { options: { allow_failure_criteria: nil } }
+ end
end
end
end