summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-03-22 15:25:53 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2016-03-22 18:29:54 +0100
commit80de2a8a64b5993a23441c05181b41aa8fad9f30 (patch)
treed43c525f8873ed5b7b1c03ea27cddf99d7b6c3d4
parent37093af6d6d5371a2930ea8aa6938d93e6c27949 (diff)
downloadgitlab-ce-80de2a8a64b5993a23441c05181b41aa8fad9f30.tar.gz
Fix build dependencies, when the dependency is a string
-rw-r--r--CHANGELOG1
-rw-r--r--lib/ci/gitlab_ci_yaml_processor.rb4
-rw-r--r--spec/lib/ci/gitlab_ci_yaml_processor_spec.rb6
3 files changed, 6 insertions, 5 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 00822465e3a..c7dc33bfd16 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -15,6 +15,7 @@ v 8.6.0
- Fix diff image view modes (2-up, swipe, onion skin) not working (Stan Hu)
- Support Golang subpackage fetching (Stan Hu)
- Bump Capybara gem to 2.6.2 (Stan Hu)
+ - Fix build dependencies, when the dependency is a string
- New branch button appears on issues where applicable
- Contributions to forked projects are included in calendar
- Improve the formatting for the user page bio (Connor Shea)
diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb
index 2228425076b..b7209c14148 100644
--- a/lib/ci/gitlab_ci_yaml_processor.rb
+++ b/lib/ci/gitlab_ci_yaml_processor.rb
@@ -242,9 +242,9 @@ module Ci
stage_index = stages.index(job[:stage])
job[:dependencies].each do |dependency|
- raise ValidationError, "#{name} job: undefined dependency: #{dependency}" unless @jobs[dependency]
+ raise ValidationError, "#{name} job: undefined dependency: #{dependency}" unless @jobs[dependency.to_sym]
- unless stages.index(@jobs[dependency][:stage]) < stage_index
+ unless stages.index(@jobs[dependency.to_sym][:stage]) < stage_index
raise ValidationError, "#{name} job: dependency #{dependency} is not defined in prior stages"
end
end
diff --git a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
index b79b8147ce0..d9812032c85 100644
--- a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
+++ b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
@@ -492,19 +492,19 @@ module Ci
end
context 'dependencies to builds' do
- let(:dependencies) { [:build1, :build2] }
+ let(:dependencies) { ['build1', 'build2'] }
it { expect { subject }.to_not raise_error }
end
context 'undefined dependency' do
- let(:dependencies) { [:undefined] }
+ let(:dependencies) { ['undefined'] }
it { expect { subject }.to raise_error(GitlabCiYamlProcessor::ValidationError, 'test1 job: undefined dependency: undefined') }
end
context 'dependencies to deploy' do
- let(:dependencies) { [:deploy] }
+ let(:dependencies) { ['deploy'] }
it { expect { subject }.to raise_error(GitlabCiYamlProcessor::ValidationError, 'test1 job: dependency deploy is not defined in prior stages') }
end