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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
69269efb
Commit
69269efb
authored
Jan 15, 2019
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove duplication between bridge and job only policies
parent
536eb638
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
15 deletions
+7
-15
ee/lib/ee/gitlab/ci/config/entry/bridge.rb
ee/lib/ee/gitlab/ci/config/entry/bridge.rb
+4
-12
ee/spec/lib/gitlab/ci/config/entry/jobs_spec.rb
ee/spec/lib/gitlab/ci/config/entry/jobs_spec.rb
+0
-2
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.
ee/lib/ee/gitlab/ci/config/entry/bridge.rb
View file @
69269efb
...
...
@@ -15,15 +15,6 @@ module EE
ALLOWED_KEYS
=
%i[trigger stage allow_failure only except]
.
freeze
# TODO we probably need a common ancestor for a status / job
#
DEFAULT_ONLY_POLICY
=
{
refs:
%w(branches tags)
}.
freeze
DEFAULT_EXCEPT_POLICY
=
{
}.
freeze
validations
do
validates
:config
,
allowed_keys:
ALLOWED_KEYS
validates
:config
,
presence:
true
...
...
@@ -39,7 +30,8 @@ module EE
description:
'Pipeline stage this job will be executed into.'
entry
:only
,
::
Gitlab
::
Ci
::
Config
::
Entry
::
Policy
,
description:
'Refs policy this job will be executed for.'
description:
'Refs policy this job will be executed for.'
,
default:
::
Gitlab
::
Ci
::
Config
::
Entry
::
Policy
::
DEFAULT_ONLY
entry
:except
,
::
Gitlab
::
Ci
::
Config
::
Entry
::
Policy
,
description:
'Refs policy this job will be executed for.'
...
...
@@ -56,8 +48,8 @@ module EE
trigger:
trigger_value
,
ignore:
!!
allow_failure
,
stage:
stage_value
,
only:
DEFAULT_ONLY_POLICY
.
deep_merge
(
only_value
.
to_h
)
,
except:
DEFAULT_EXCEPT_POLICY
.
deep_merge
(
except_value
.
to_h
)
}
only:
only_value
,
except:
except_value
}.
compact
end
end
end
...
...
ee/spec/lib/gitlab/ci/config/entry/jobs_spec.rb
View file @
69269efb
...
...
@@ -63,7 +63,6 @@ describe Gitlab::Ci::Config::Entry::Jobs do
trigger:
{
project:
'my/project'
},
stage:
'test'
,
only:
{
refs:
%w[branches tags]
},
except:
{},
ignore:
false
},
regular_job:
{
...
...
@@ -71,7 +70,6 @@ describe Gitlab::Ci::Config::Entry::Jobs do
name: :regular_job
,
stage:
'test'
,
only:
{
refs:
%w[branches tags]
},
except:
{},
ignore:
false
})
end
...
...
lib/gitlab/ci/config/entry/job.rb
View file @
69269efb
...
...
@@ -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 @
69269efb
...
...
@@ -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