Skip to content
Snippets Groups Projects
Commit de8b93bb authored by Grzegorz Bizon's avatar Grzegorz Bizon
Browse files

Improve validation of CI config entry if composite

parent fea77624
Branches
Tags
1 merge request!5087Move CI job config entries from legacy to new config
Pipeline #
Loading
@@ -20,12 +20,8 @@ module Gitlab
Loading
@@ -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?
Loading
@@ -90,12 +86,12 @@ module Gitlab
Loading
@@ -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
   
Loading
Loading
Loading
@@ -27,10 +27,6 @@ module Gitlab
Loading
@@ -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)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment