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
Tatuya Kamada
gitlab-ce
Commits
b95c60a0
Commit
b95c60a0
authored
Jun 07, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not process Ci config node when node is a leaf
parent
940763e0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
lib/gitlab/ci/config/node/entry.rb
lib/gitlab/ci/config/node/entry.rb
+8
-2
spec/lib/gitlab/ci/config/node/global_spec.rb
spec/lib/gitlab/ci/config/node/global_spec.rb
+6
-0
No files found.
lib/gitlab/ci/config/node/entry.rb
View file @
b95c60a0
...
...
@@ -16,6 +16,8 @@ module Gitlab
end
def
process!
return
if
leaf?
keys
.
each_pair
do
|
key
,
entry
|
next
unless
@value
.
include?
(
key
)
@nodes
[
key
]
=
entry
.
new
(
@value
[
key
],
@config
,
self
)
...
...
@@ -29,12 +31,16 @@ module Gitlab
@errors
+
nodes
.
map
(
&
:errors
).
flatten
end
def
nodes
@nodes
.
values
end
def
valid?
errors
.
none?
end
def
nodes
@nodes
.
values
def
leaf?
keys
.
none?
end
def
keys
...
...
spec/lib/gitlab/ci/config/node/global_spec.rb
View file @
b95c60a0
...
...
@@ -31,6 +31,12 @@ describe Gitlab::Ci::Config::Node::Global do
.
to
be_an_instance_of
Gitlab
::
Ci
::
Config
::
Node
::
BeforeScript
end
end
describe
'#leaf?'
do
it
'is not leaf'
do
expect
(
global
).
not_to
be_leaf
end
end
end
context
'when hash is not valid'
do
...
...
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