Class: Gitlab::Ci::Config::Entry::Root

Inherits:
Gitlab::Config::Entry::Node show all
Extended by:
Utils::StrongMemoize
Includes:
Gitlab::Config::Entry::Configurable
Defined in:
lib/gitlab/ci/config/entry/root.rb

Overview

This class represents a global entry - root Entry for entire GitLab CI Configuration file.

Constant Summary collapse

ALLOWED_KEYS =
%i[default include before_script image services
after_script variables stages types cache workflow].freeze

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

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

Instance Attribute Summary collapse

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

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

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Utils::StrongMemoize

clear_memoization, strong_memoize, strong_memoized?

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

#entry_create!, #skip_config_hash_validation?

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

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

Constructor Details

#initialize(config, **metadata) ⇒ Root

Returns a new instance of Root.


93
94
95
96
97
# File 'lib/gitlab/ci/config/entry/root.rb', line 93

def initialize(config, **)
  super do
    filter_jobs!
  end
end

Instance Attribute Details

#jobs_configObject (readonly)

Returns the value of attribute jobs_config


79
80
81
# File 'lib/gitlab/ci/config/entry/root.rb', line 79

def jobs_config
  @jobs_config
end

Class Method Details

.reserved_nodes_namesObject


84
85
86
87
88
89
90
# File 'lib/gitlab/ci/config/entry/root.rb', line 84

def reserved_nodes_names
  strong_memoize(:reserved_nodes_names) do
    self.nodes.select do |_, node|
      node.reserved?
    end.keys
  end
end

Instance Method Details

#compose!(_deps = nil) ⇒ Object


99
100
101
102
103
104
# File 'lib/gitlab/ci/config/entry/root.rb', line 99

def compose!(_deps = nil)
  super(self) do
    compose_deprecated_entries!
    compose_jobs!
  end
end