Commit 9eb8ef78 authored by Grzegorz Bizon's avatar Grzegorz Bizon
Browse files

Use defauly `only` policy defined as a constant

We reuse this constant in EE.
parent 756a354ce74a
...@@ -67,7 +67,7 @@ class Job < ::Gitlab::Config::Entry::Node ...@@ -67,7 +67,7 @@ class Job < ::Gitlab::Config::Entry::Node
entry :only, Entry::Policy, entry :only, Entry::Policy,
description: 'Refs policy this job will be executed for.', description: 'Refs policy this job will be executed for.',
default: { refs: %w[branches tags] } default: Entry::Policy::DEFAULT_ONLY
entry :except, Entry::Policy, entry :except, Entry::Policy,
description: 'Refs policy this job will be executed for.' description: 'Refs policy this job will be executed for.'
......
...@@ -11,6 +11,8 @@ class Policy < ::Gitlab::Config::Entry::Simplifiable ...@@ -11,6 +11,8 @@ class Policy < ::Gitlab::Config::Entry::Simplifiable
strategy :RefsPolicy, if: -> (config) { config.is_a?(Array) } strategy :RefsPolicy, if: -> (config) { config.is_a?(Array) }
strategy :ComplexPolicy, if: -> (config) { config.is_a?(Hash) } strategy :ComplexPolicy, if: -> (config) { config.is_a?(Hash) }
DEFAULT_ONLY = { refs: %w[branches tags] }.freeze
class RefsPolicy < ::Gitlab::Config::Entry::Node class RefsPolicy < ::Gitlab::Config::Entry::Node
include ::Gitlab::Config::Entry::Validatable include ::Gitlab::Config::Entry::Validatable
......
Supports Markdown
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