Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
9f26729a
Commit
9f26729a
authored
Jan 15, 2019
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use defauly `only` policy defined as a constant
We reuse this constant in EE.
parent
563942ee
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletion
+3
-1
lib/gitlab/ci/config/entry/job.rb
lib/gitlab/ci/config/entry/job.rb
+1
-1
lib/gitlab/ci/config/entry/policy.rb
lib/gitlab/ci/config/entry/policy.rb
+2
-0
No files found.
lib/gitlab/ci/config/entry/job.rb
View file @
9f26729a
...
...
@@ -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.'
...
...
lib/gitlab/ci/config/entry/policy.rb
View file @
9f26729a
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment