Commit a80a01e8 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Add comment for deprecated CI config `types` entry

parent e9b42067
......@@ -17,9 +17,7 @@ module Ci
def initialize(config, path = nil)
@ci_config = Gitlab::Ci::Config.new(config)
@config = @ci_config.to_hash
@path = path
@config, @path = @ci_config.to_hash, path
unless @ci_config.valid?
raise ValidationError, @ci_config.errors.first
......
......@@ -50,7 +50,7 @@ module Gitlab
compose_jobs!
end
def compose_stages!
def compose_jobs!
factory = Node::Factory.new(Node::Jobs)
factory.value(@config.except(*nodes.keys))
factory.with(key: :jobs, parent: self, global: self)
......@@ -59,7 +59,14 @@ module Gitlab
@entries[:jobs] = factory.create!
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?
@entries[:stages] = @entries[:types]
end
......
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