diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-11-07 13:48:29 +0000 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-11-07 13:48:29 +0000 |
commit | e60e591fca3dd720c9a8b3e767d7b1b9f4560967 (patch) | |
tree | 429c65cb68f5212691989ef7d10131b873239352 /lib | |
parent | 0cd22a382ef390cda6dab001ab5e4738dd25b3a5 (diff) | |
parent | d5919aeb1f751fd9d91cd051c0c14bc6e7bc3d63 (diff) | |
download | gitlab-ce-e60e591fca3dd720c9a8b3e767d7b1b9f4560967.tar.gz |
Merge branch 'touchup-ci-normalizer' into 'master'
Touchup Normalizer implementation
See merge request gitlab-org/gitlab-ce!22872
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/ci/config/normalizer.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/gitlab/ci/config/normalizer.rb b/lib/gitlab/ci/config/normalizer.rb index 969ae093e8b..b7743bd2090 100644 --- a/lib/gitlab/ci/config/normalizer.rb +++ b/lib/gitlab/ci/config/normalizer.rb @@ -9,14 +9,16 @@ module Gitlab end def normalize_jobs - extract_parallelized_jobs + extract_parallelized_jobs! + return @jobs_config if @parallelized_jobs.empty? + parallelized_config = parallelize_jobs parallelize_dependencies(parallelized_config) end private - def extract_parallelized_jobs + def extract_parallelized_jobs! @parallelized_jobs = {} @jobs_config.each do |job_name, config| @@ -41,8 +43,8 @@ module Gitlab end def parallelize_dependencies(parallelized_config) + parallelized_job_names = @parallelized_jobs.keys.map(&:to_s) parallelized_config.each_with_object({}) do |(job_name, config), hash| - parallelized_job_names = @parallelized_jobs.keys.map(&:to_s) if config[:dependencies] && (intersection = config[:dependencies] & parallelized_job_names).any? deps = intersection.map { |dep| @parallelized_jobs[dep.to_sym].map(&:first) }.flatten hash[job_name] = config.merge(dependencies: deps) |