Commit 473ce756 authored by Stan Hu's avatar Stan Hu

Merge branch 'fix/gb/fix-hidden-bridge-jobs' into 'master'

Fix bridge jobs than can be hidden keys too

Closes gitlab-ce#58358

See merge request gitlab-org/gitlab-ee!9796
parents 3b1daa55 232c3206
---
title: Fix bridge jobs than can be hidden keys too
merge_request: 9796
author:
type: fixed
...@@ -10,10 +10,12 @@ module EE ...@@ -10,10 +10,12 @@ module EE
override :node_type override :node_type
def node_type(name) def node_type(name)
if bridge?(name) if hidden?(name)
::Gitlab::Ci::Config::Entry::Hidden
elsif bridge?(name)
::EE::Gitlab::Ci::Config::Entry::Bridge ::EE::Gitlab::Ci::Config::Entry::Bridge
else else
super ::Gitlab::Ci::Config::Entry::Job
end end
end end
......
...@@ -5,6 +5,7 @@ describe Gitlab::Ci::Config::Entry::Jobs do ...@@ -5,6 +5,7 @@ describe Gitlab::Ci::Config::Entry::Jobs do
described_class.new( described_class.new(
{ {
'.hidden_job'.to_sym => { script: 'something' }, '.hidden_job'.to_sym => { script: 'something' },
'.hidden_bridge'.to_sym => { trigger: 'my/project' },
regular_job: { script: 'something' }, regular_job: { script: 'something' },
my_trigger: { trigger: 'my/project' } my_trigger: { trigger: 'my/project' }
} }
...@@ -24,6 +25,11 @@ describe Gitlab::Ci::Config::Entry::Jobs do ...@@ -24,6 +25,11 @@ describe Gitlab::Ci::Config::Entry::Jobs do
.to eq ::Gitlab::Ci::Config::Entry::Hidden .to eq ::Gitlab::Ci::Config::Entry::Hidden
end end
it 'correctly identifies hidden bridge jobs' do
expect(subject.node_type(:'.hidden_bridge'))
.to eq ::Gitlab::Ci::Config::Entry::Hidden
end
it 'correctly identifies regular jobs' do it 'correctly identifies regular jobs' do
expect(subject.node_type(:regular_job)) expect(subject.node_type(:regular_job))
.to eq ::Gitlab::Ci::Config::Entry::Job .to eq ::Gitlab::Ci::Config::Entry::Job
......
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