Class: Gitlab::Ci::Config::Entry::Needs

Inherits:
Gitlab::Config::Entry::ComposableArray show all
Includes:
Gitlab::Config::Entry::Validatable
Defined in:
lib/gitlab/ci/config/entry/needs.rb

Overview

Entry that represents a set of needs dependencies.

Constant Summary collapse

NEEDS_CROSS_PIPELINE_DEPENDENCIES_LIMIT =
5

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

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

Instance Attribute Summary

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

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

Instance Method Summary collapse

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

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

Methods inherited from Gitlab::Config::Entry::ComposableArray

#compose!, #descendants

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

#composable_classObject



62
63
64
# File 'lib/gitlab/ci/config/entry/needs.rb', line 62

def composable_class
  Entry::Need
end

#number_parallel_build?Boolean

Returns:

  • (Boolean)


54
55
56
57
58
59
60
# File 'lib/gitlab/ci/config/entry/needs.rb', line 54

def number_parallel_build?
  if config.is_a?(Array)
    config.any? { |need_values| need_values.is_a?(Hash) && need_values[:parallel].is_a?(Numeric) }
  elsif config.is_a?(Hash)
    config[:parallel].is_a?(Numeric)
  end
end

#valueObject



47
48
49
50
51
52
# File 'lib/gitlab/ci/config/entry/needs.rb', line 47

def value
  values = @entries.select(&:type)
  values.group_by(&:type).transform_values do |values|
    values.map(&:value)
  end
end