Class: Gitlab::Ci::Config::Entry::Retry::FullRetry

Inherits:
Gitlab::Config::Entry::Node show all
Includes:
Gitlab::Config::Entry::Attributable, Gitlab::Config::Entry::Validatable
Defined in:
lib/gitlab/ci/config/entry/retry.rb

Constant Summary collapse

ALLOWED_KEYS =
%i[max when].freeze

Constants inherited from Gitlab::Config::Entry::Node

Gitlab::Config::Entry::Node::InvalidError

Instance Attribute Summary

Attributes inherited from Gitlab::Config::Entry::Node

#config, #default, #description, #key, #metadata, #parent

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Gitlab::Config::Entry::Validatable

#compose!, #errors, included, #validate, #validator

Methods inherited from Gitlab::Config::Entry::Node

#[], #add_warning, #ancestors, aspects, #compose!, default, #descendants, #errors, #hash?, #initialize, #inspect, #integer?, #leaf?, #opt, #relevant?, #specified?, #string?, #valid?, #warnings, with_aspect

Constructor Details

This class inherits a constructor from Gitlab::Config::Entry::Node

Class Method Details

.possible_retry_when_valuesObject


59
60
61
# File 'lib/gitlab/ci/config/entry/retry.rb', line 59

def self.possible_retry_when_values
  @possible_retry_when_values ||= ::Ci::Build.failure_reasons.keys.map(&:to_s) + ['always']
end

Instance Method Details

#locationObject


71
72
73
# File 'lib/gitlab/ci/config/entry/retry.rb', line 71

def location
  'retry'
end

#valueObject


63
64
65
66
67
68
69
# File 'lib/gitlab/ci/config/entry/retry.rb', line 63

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