Commit de8b93bb authored by Grzegorz Bizon's avatar Grzegorz Bizon

Improve validation of CI config entry if composite

parent fea77624
...@@ -20,12 +20,8 @@ module Gitlab ...@@ -20,12 +20,8 @@ module Gitlab
end end
def process! def process!
return if leaf? compose! unless leaf?
return unless valid? @validator.validate(:processed) if valid?
compose!
process_nodes!
@validator.validate(:processed)
end end
def leaf? def leaf?
...@@ -90,12 +86,12 @@ module Gitlab ...@@ -90,12 +86,12 @@ module Gitlab
private private
def compose! def compose!
return unless valid?
nodes.each do |key, essence| nodes.each do |key, essence|
@nodes[key] = create_node(key, essence) @nodes[key] = create_node(key, essence)
end end
end
def process_nodes!
@nodes.each_value(&:process!) @nodes.each_value(&:process!)
end end
......
...@@ -27,10 +27,6 @@ module Gitlab ...@@ -27,10 +27,6 @@ module Gitlab
@nodes.values.any?(&:relevant?) @nodes.values.any?(&:relevant?)
end end
def leaf?
false
end
private private
def create_node(key, value) def create_node(key, value)
......
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