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 ...@@ -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
......
...@@ -50,7 +50,7 @@ module Gitlab ...@@ -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)
...@@ -59,7 +59,14 @@ module Gitlab ...@@ -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
......
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