Class: Gitlab::Ci::Config::Entry::Rules::Rule

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

Defined Under Namespace

Classes: Changes

Constant Summary collapse

ALLOWED_KEYS =
%i[if changes exists when start_in allow_failure variables needs].freeze
ALLOWED_WHEN =
%w[on_success on_failure always never manual delayed].freeze

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

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

Instance Attribute Summary

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

#config, #deprecation, #description, #key, #metadata, #parent

Instance Method Summary collapse

Methods included from Gitlab::Config::Entry::Configurable

#compose!, #entry_create!, #skip_config_hash_validation?

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

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

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

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

Constructor Details

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

Instance Method Details

#defaultObject



63
64
# File 'lib/gitlab/ci/config/entry/rules/rule.rb', line 63

def default
end

#specifies_delay?Boolean

Returns:

  • (Boolean)


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

def specifies_delay?
  self.when == 'delayed'
end

#valueObject



51
52
53
54
55
56
57
# File 'lib/gitlab/ci/config/entry/rules/rule.rb', line 51

def value
  config.merge(
    changes: (changes_value if changes_defined?),
    variables: (variables_value if variables_defined?),
    needs: (needs_value if needs_defined?)
  ).compact
end