diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-07-09 17:38:03 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-07-09 17:38:03 +0200 |
commit | a80a01e8411cee9e0f7d24ddddb65dca0c7a7fdf (patch) | |
tree | 802c379488833282593b4332af763ea5b23aa4ce /lib | |
parent | e9b42067fd4065e57a68e4b37732dda91444e3f7 (diff) | |
download | gitlab-ce-a80a01e8411cee9e0f7d24ddddb65dca0c7a7fdf.tar.gz |
Add comment for deprecated CI config `types` entry
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ci/gitlab_ci_yaml_processor.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/ci/config/node/global.rb | 11 |
2 files changed, 10 insertions, 5 deletions
diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb index 1ffbd0020bb..40d1b475013 100644 --- a/lib/ci/gitlab_ci_yaml_processor.rb +++ b/lib/ci/gitlab_ci_yaml_processor.rb @@ -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 diff --git a/lib/gitlab/ci/config/node/global.rb b/lib/gitlab/ci/config/node/global.rb index a2649e2c905..f59a967b1ef 100644 --- a/lib/gitlab/ci/config/node/global.rb +++ b/lib/gitlab/ci/config/node/global.rb @@ -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 |