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