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

Add comment for deprecated CI config `types` entry

parent e9b42067
No related branches found
No related tags found
1 merge request!5087Move CI job config entries from legacy to new config
Pipeline #
Loading
@@ -17,9 +17,7 @@ module Ci
Loading
@@ -17,9 +17,7 @@ module Ci
   
def initialize(config, path = nil) def initialize(config, path = nil)
@ci_config = Gitlab::Ci::Config.new(config) @ci_config = Gitlab::Ci::Config.new(config)
@config = @ci_config.to_hash @config, @path = @ci_config.to_hash, path
@path = path
   
unless @ci_config.valid? unless @ci_config.valid?
raise ValidationError, @ci_config.errors.first raise ValidationError, @ci_config.errors.first
Loading
Loading
Loading
@@ -50,7 +50,7 @@ module Gitlab
Loading
@@ -50,7 +50,7 @@ module Gitlab
compose_jobs! compose_jobs!
end end
   
def compose_stages! def compose_jobs!
factory = Node::Factory.new(Node::Jobs) factory = Node::Factory.new(Node::Jobs)
factory.value(@config.except(*nodes.keys)) factory.value(@config.except(*nodes.keys))
factory.with(key: :jobs, parent: self, global: self) factory.with(key: :jobs, parent: self, global: self)
Loading
@@ -59,7 +59,14 @@ module Gitlab
Loading
@@ -59,7 +59,14 @@ module Gitlab
@entries[:jobs] = factory.create! @entries[:jobs] = factory.create!
end end
   
def compose_jobs! def compose_stages!
##
# Deprecated `:types` key workaround - if types are defined and
# stages are not defined we use types definition as stages.
#
# Otherwise we use stages in favor of types, and remove types from
# processing.
#
if types_defined? && !stages_defined? if types_defined? && !stages_defined?
@entries[:stages] = @entries[:types] @entries[:stages] = @entries[:types]
end end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment