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
df25c196
Commit
df25c196
authored
Jun 07, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Ci config validation helpers only where needed
parent
6bd67f52
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
29 deletions
+31
-29
lib/ci/gitlab_ci_yaml_processor.rb
lib/ci/gitlab_ci_yaml_processor.rb
+1
-1
lib/gitlab/ci/config/node/before_script.rb
lib/gitlab/ci/config/node/before_script.rb
+2
-0
lib/gitlab/ci/config/node/entry.rb
lib/gitlab/ci/config/node/entry.rb
+0
-2
lib/gitlab/ci/config/node/validation_helpers.rb
lib/gitlab/ci/config/node/validation_helpers.rb
+28
-0
lib/gitlab/ci/config/validation_helpers.rb
lib/gitlab/ci/config/validation_helpers.rb
+0
-26
No files found.
lib/ci/gitlab_ci_yaml_processor.rb
View file @
df25c196
...
...
@@ -2,7 +2,7 @@ module Ci
class
GitlabCiYamlProcessor
class
ValidationError
<
StandardError
;
end
include
Gitlab
::
Ci
::
Config
::
ValidationHelpers
include
Gitlab
::
Ci
::
Config
::
Node
::
ValidationHelpers
DEFAULT_STAGES
=
%w(build test deploy)
DEFAULT_STAGE
=
'test'
...
...
lib/gitlab/ci/config/node/before_script.rb
View file @
df25c196
...
...
@@ -3,6 +3,8 @@ module Gitlab
class
Config
module
Node
class
BeforeScript
<
Entry
include
ValidationHelpers
def
keys
{}
end
...
...
lib/gitlab/ci/config/node/entry.rb
View file @
df25c196
...
...
@@ -3,8 +3,6 @@ module Gitlab
class
Config
module
Node
class
Entry
include
Config
::
ValidationHelpers
attr_reader
:value
,
:nodes
,
:parent
def
initialize
(
value
,
root
=
nil
,
parent
=
nil
)
...
...
lib/gitlab/ci/config/node/validation_helpers.rb
0 → 100644
View file @
df25c196
module
Gitlab
module
Ci
class
Config
module
Node
module
ValidationHelpers
private
def
validate_array_of_strings
(
values
)
values
.
is_a?
(
Array
)
&&
values
.
all?
{
|
value
|
validate_string
(
value
)
}
end
def
validate_variables
(
variables
)
variables
.
is_a?
(
Hash
)
&&
variables
.
all?
{
|
key
,
value
|
validate_string
(
key
)
&&
validate_string
(
value
)
}
end
def
validate_string
(
value
)
value
.
is_a?
(
String
)
||
value
.
is_a?
(
Symbol
)
end
def
validate_boolean
(
value
)
value
.
in?
([
true
,
false
])
end
end
end
end
end
end
lib/gitlab/ci/config/validation_helpers.rb
deleted
100644 → 0
View file @
6bd67f52
module
Gitlab
module
Ci
class
Config
module
ValidationHelpers
private
def
validate_array_of_strings
(
values
)
values
.
is_a?
(
Array
)
&&
values
.
all?
{
|
value
|
validate_string
(
value
)
}
end
def
validate_variables
(
variables
)
variables
.
is_a?
(
Hash
)
&&
variables
.
all?
{
|
key
,
value
|
validate_string
(
key
)
&&
validate_string
(
value
)
}
end
def
validate_string
(
value
)
value
.
is_a?
(
String
)
||
value
.
is_a?
(
Symbol
)
end
def
validate_boolean
(
value
)
value
.
in?
([
true
,
false
])
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