BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
5ce9e03f
Commit
5ce9e03f
authored
Aug 26, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use new complex only/except policy internal scheme
parent
6a5097fd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
3 deletions
+7
-3
gitlab_ci_yaml_processor.rb
lib/ci/gitlab_ci_yaml_processor.rb
+1
-1
policy.rb
lib/gitlab/ci/config/entry/policy.rb
+4
-0
policy_spec.rb
spec/lib/gitlab/ci/config/entry/policy_spec.rb
+2
-2
No files found.
lib/ci/gitlab_ci_yaml_processor.rb
View file @
5ce9e03f
...
@@ -22,7 +22,7 @@ module Ci
...
@@ -22,7 +22,7 @@ module Ci
def
jobs_for_ref
(
ref
,
tag
=
false
,
source
=
nil
)
def
jobs_for_ref
(
ref
,
tag
=
false
,
source
=
nil
)
@jobs
.
select
do
|
_
,
job
|
@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
end
end
...
...
lib/gitlab/ci/config/entry/policy.rb
View file @
5ce9e03f
...
@@ -15,6 +15,10 @@ module Gitlab
...
@@ -15,6 +15,10 @@ module Gitlab
validations
do
validations
do
validates
:config
,
array_of_strings_or_regexps:
true
validates
:config
,
array_of_strings_or_regexps:
true
end
end
def
value
{
refs:
@config
}
end
end
end
class
ExpressionsPolicy
<
Entry
::
Node
class
ExpressionsPolicy
<
Entry
::
Node
...
...
spec/lib/gitlab/ci/config/entry/policy_spec.rb
View file @
5ce9e03f
...
@@ -16,8 +16,8 @@ describe Gitlab::Ci::Config::Entry::Policy do
...
@@ -16,8 +16,8 @@ describe Gitlab::Ci::Config::Entry::Policy do
end
end
describe
'#value'
do
describe
'#value'
do
it
'returns
key value
'
do
it
'returns
refs hash
'
do
expect
(
entry
.
value
).
to
eq
config
expect
(
entry
.
value
).
to
eq
(
refs:
config
)
end
end
end
end
end
end
...
...
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