Use defauly `only` policy defined as a constant

We reuse this constant in EE.
This commit is contained in:
Grzegorz Bizon 2019-01-15 16:27:09 +01:00
parent 563942ee3d
commit 9f26729af5
2 changed files with 3 additions and 1 deletions

View File

@ -67,7 +67,7 @@ module Gitlab
entry :only, Entry::Policy,
description: 'Refs policy this job will be executed for.',
default: { refs: %w[branches tags] }
default: Entry::Policy::DEFAULT_ONLY
entry :except, Entry::Policy,
description: 'Refs policy this job will be executed for.'

View File

@ -11,6 +11,8 @@ module Gitlab
strategy :RefsPolicy, if: -> (config) { config.is_a?(Array) }
strategy :ComplexPolicy, if: -> (config) { config.is_a?(Hash) }
DEFAULT_ONLY = { refs: %w[branches tags] }.freeze
class RefsPolicy < ::Gitlab::Config::Entry::Node
include ::Gitlab::Config::Entry::Validatable