Commit b95c60a0 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Do not process Ci config node when node is a leaf

parent 940763e0
......@@ -16,6 +16,8 @@ module Gitlab
end
def process!
return if leaf?
keys.each_pair do |key, entry|
next unless @value.include?(key)
@nodes[key] = entry.new(@value[key], @config, self)
......@@ -29,12 +31,16 @@ module Gitlab
@errors + nodes.map(&:errors).flatten
end
def nodes
@nodes.values
end
def valid?
errors.none?
end
def nodes
@nodes.values
def leaf?
keys.none?
end
def keys
......
......@@ -31,6 +31,12 @@ describe Gitlab::Ci::Config::Node::Global do
.to be_an_instance_of Gitlab::Ci::Config::Node::BeforeScript
end
end
describe '#leaf?' do
it 'is not leaf' do
expect(global).not_to be_leaf
end
end
end
context 'when hash is not valid' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment