summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-11-22 09:09:38 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-11-22 09:09:38 +0100
commitc048d5d2d964292bddb567bbad6caffd8b275bfa (patch)
tree74b6f6b8e0affe0bf4d542a894c64aedef675714
parent4c34b4e5171596bd09b621b66d9c2765f042483c (diff)
downloadgitlab-ce-c048d5d2d964292bddb567bbad6caffd8b275bfa.tar.gz
Fix entry lookup in CI config inheritance rules
-rw-r--r--lib/gitlab/ci/config/entry/job.rb2
-rw-r--r--spec/lib/gitlab/ci/config/entry/global_spec.rb4
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/gitlab/ci/config/entry/job.rb b/lib/gitlab/ci/config/entry/job.rb
index 20dcc024b4e..a55362f0b6b 100644
--- a/lib/gitlab/ci/config/entry/job.rb
+++ b/lib/gitlab/ci/config/entry/job.rb
@@ -108,7 +108,7 @@ module Gitlab
self.class.nodes.each_key do |key|
global_entry = deps[key]
- job_entry = @entries[key]
+ job_entry = self[key]
if global_entry.specified? && !job_entry.specified?
@entries[key] = global_entry
diff --git a/spec/lib/gitlab/ci/config/entry/global_spec.rb b/spec/lib/gitlab/ci/config/entry/global_spec.rb
index 5683d875dd6..e64c8d46bd8 100644
--- a/spec/lib/gitlab/ci/config/entry/global_spec.rb
+++ b/spec/lib/gitlab/ci/config/entry/global_spec.rb
@@ -254,7 +254,9 @@ describe Gitlab::Ci::Config::Entry::Global do
end
context 'when job does not have commands' do
- let(:hash) { { rspec: { stage: 'test' } } }
+ let(:hash) do
+ { before_script: ['echo 123'], rspec: { stage: 'test' } }
+ end
describe '#errors' do
it 'reports errors about missing script' do