diff options
author | Markus Doits <markus.doits@stellenticket.de> | 2018-10-19 17:47:18 +0300 |
---|---|---|
committer | Markus Doits <markus.doits@stellenticket.de> | 2018-11-07 15:04:43 +0300 |
commit | 9818bb561889579ed1031e90b7879ec1c3f0e25a (patch) | |
tree | 445a085e087644243d8e67f1bb22d04c63abcf57 /lib/gitlab/ci | |
parent | ff3484a0b331456b36f82b0d6cda2afd56da566e (diff) |
refactoring after latest feedback
Diffstat (limited to 'lib/gitlab/ci')
-rw-r--r-- | lib/gitlab/ci/config/entry/retry.rb | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/gitlab/ci/config/entry/retry.rb b/lib/gitlab/ci/config/entry/retry.rb index 1f9539dafdb..a89d9f05117 100644 --- a/lib/gitlab/ci/config/entry/retry.rb +++ b/lib/gitlab/ci/config/entry/retry.rb @@ -18,6 +18,12 @@ module Gitlab less_than_or_equal_to: 2 } end + def value + { + max: config + } + end + def location 'retry' end @@ -49,7 +55,15 @@ module Gitlab end def self.possible_retry_when_values - @possible_retry_when_values ||= Gitlab::Ci::Status::Build::Failed.reasons.keys.map(&:to_s) + ['always'] + @possible_retry_when_values ||= CommitStatus.failure_reasons.keys.map(&:to_s) + ['always'] + end + + def value + super.tap do |config| + # make sure that `when` is an array, because we allow it to + # be passed as a String in config for simplicity + config[:when] = Array.wrap(config[:when]) if config[:when] + end end def location |