Commit 5ce9e03f authored by Grzegorz Bizon's avatar Grzegorz Bizon

Use new complex only/except policy internal scheme

parent 6a5097fd
...@@ -22,7 +22,7 @@ module Ci ...@@ -22,7 +22,7 @@ module Ci
def jobs_for_ref(ref, tag = false, source = nil) def jobs_for_ref(ref, tag = false, source = nil)
@jobs.select do |_, job| @jobs.select do |_, job|
process?(job[:only], job[:except], ref, tag, source) process?(job.dig(:only, :refs), job.dig(:except, :refs), ref, tag, source)
end end
end end
......
...@@ -15,6 +15,10 @@ module Gitlab ...@@ -15,6 +15,10 @@ module Gitlab
validations do validations do
validates :config, array_of_strings_or_regexps: true validates :config, array_of_strings_or_regexps: true
end end
def value
{ refs: @config }
end
end end
class ExpressionsPolicy < Entry::Node class ExpressionsPolicy < Entry::Node
......
...@@ -16,8 +16,8 @@ describe Gitlab::Ci::Config::Entry::Policy do ...@@ -16,8 +16,8 @@ describe Gitlab::Ci::Config::Entry::Policy do
end end
describe '#value' do describe '#value' do
it 'returns key value' do it 'returns refs hash' do
expect(entry.value).to eq config expect(entry.value).to eq(refs: config)
end end
end end
end end
......
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