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
615c9730
Commit
615c9730
authored
Jul 14, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove job cache configfrom legacy yaml processor
parent
5923741f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
25 deletions
+8
-25
gitlab_ci_yaml_processor.rb
lib/ci/gitlab_ci_yaml_processor.rb
+0
-21
job.rb
lib/gitlab/ci/config/node/job.rb
+5
-1
gitlab_ci_yaml_processor_spec.rb
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
+3
-3
No files found.
lib/ci/gitlab_ci_yaml_processor.rb
View file @
615c9730
...
@@ -107,7 +107,6 @@ module Ci
...
@@ -107,7 +107,6 @@ module Ci
validate_job_stage!
(
name
,
job
)
if
job
[
:stage
]
validate_job_stage!
(
name
,
job
)
if
job
[
:stage
]
validate_job_variables!
(
name
,
job
)
if
job
[
:variables
]
validate_job_variables!
(
name
,
job
)
if
job
[
:variables
]
validate_job_cache!
(
name
,
job
)
if
job
[
:cache
]
validate_job_artifacts!
(
name
,
job
)
if
job
[
:artifacts
]
validate_job_artifacts!
(
name
,
job
)
if
job
[
:artifacts
]
validate_job_dependencies!
(
name
,
job
)
if
job
[
:dependencies
]
validate_job_dependencies!
(
name
,
job
)
if
job
[
:dependencies
]
end
end
...
@@ -167,26 +166,6 @@ module Ci
...
@@ -167,26 +166,6 @@ module Ci
end
end
end
end
def
validate_job_cache!
(
name
,
job
)
job
[
:cache
].
keys
.
each
do
|
key
|
unless
ALLOWED_CACHE_KEYS
.
include?
key
raise
ValidationError
,
"
#{
name
}
job: cache unknown parameter
#{
key
}
"
end
end
if
job
[
:cache
][
:key
]
&&
!
validate_string
(
job
[
:cache
][
:key
])
raise
ValidationError
,
"
#{
name
}
job: cache:key parameter should be a string"
end
if
job
[
:cache
][
:untracked
]
&&
!
validate_boolean
(
job
[
:cache
][
:untracked
])
raise
ValidationError
,
"
#{
name
}
job: cache:untracked parameter should be an boolean"
end
if
job
[
:cache
][
:paths
]
&&
!
validate_array_of_strings
(
job
[
:cache
][
:paths
])
raise
ValidationError
,
"
#{
name
}
job: cache:paths parameter should be an array of strings"
end
end
def
validate_job_artifacts!
(
name
,
job
)
def
validate_job_artifacts!
(
name
,
job
)
job
[
:artifacts
].
keys
.
each
do
|
key
|
job
[
:artifacts
].
keys
.
each
do
|
key
|
unless
ALLOWED_ARTIFACTS_KEYS
.
include?
key
unless
ALLOWED_ARTIFACTS_KEYS
.
include?
key
...
...
lib/gitlab/ci/config/node/job.rb
View file @
615c9730
...
@@ -32,7 +32,10 @@ module Gitlab
...
@@ -32,7 +32,10 @@ module Gitlab
node
:after_script
,
Script
,
node
:after_script
,
Script
,
description:
'Commands that will be executed when finishing job.'
description:
'Commands that will be executed when finishing job.'
helpers
:before_script
,
:script
,
:stage
,
:type
,
:after_script
node
:cache
,
Cache
,
description:
'Cache definition for this job.'
helpers
:before_script
,
:script
,
:stage
,
:type
,
:after_script
,
:cache
def
name
def
name
@key
@key
...
@@ -48,6 +51,7 @@ module Gitlab
...
@@ -48,6 +51,7 @@ module Gitlab
{
before_script:
before_script_value
,
{
before_script:
before_script_value
,
script:
script_value
,
script:
script_value
,
stage:
stage_value
,
stage:
stage_value
,
cache:
cache_value
,
after_script:
after_script_value
}
after_script:
after_script_value
}
end
end
...
...
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
View file @
615c9730
...
@@ -1201,21 +1201,21 @@ EOT
...
@@ -1201,21 +1201,21 @@ EOT
config
=
YAML
.
dump
({
types:
[
"build"
,
"test"
],
rspec:
{
script:
"test"
,
cache:
{
key:
1
}
}
})
config
=
YAML
.
dump
({
types:
[
"build"
,
"test"
],
rspec:
{
script:
"test"
,
cache:
{
key:
1
}
}
})
expect
do
expect
do
GitlabCiYamlProcessor
.
new
(
config
)
GitlabCiYamlProcessor
.
new
(
config
)
end
.
to
raise_error
(
GitlabCiYamlProcessor
::
ValidationError
,
"
rspec job: cache:key parameter should be a string
"
)
end
.
to
raise_error
(
GitlabCiYamlProcessor
::
ValidationError
,
"
jobs:rspec:cache:key config should be a string or symbol
"
)
end
end
it
"returns errors if job cache:untracked is not an array of strings"
do
it
"returns errors if job cache:untracked is not an array of strings"
do
config
=
YAML
.
dump
({
types:
[
"build"
,
"test"
],
rspec:
{
script:
"test"
,
cache:
{
untracked:
"string"
}
}
})
config
=
YAML
.
dump
({
types:
[
"build"
,
"test"
],
rspec:
{
script:
"test"
,
cache:
{
untracked:
"string"
}
}
})
expect
do
expect
do
GitlabCiYamlProcessor
.
new
(
config
)
GitlabCiYamlProcessor
.
new
(
config
)
end
.
to
raise_error
(
GitlabCiYamlProcessor
::
ValidationError
,
"
rspec job: cache:untracked parameter should be an boolean
"
)
end
.
to
raise_error
(
GitlabCiYamlProcessor
::
ValidationError
,
"
jobs:rspec:cache:untracked config should be a boolean value
"
)
end
end
it
"returns errors if job cache:paths is not an array of strings"
do
it
"returns errors if job cache:paths is not an array of strings"
do
config
=
YAML
.
dump
({
types:
[
"build"
,
"test"
],
rspec:
{
script:
"test"
,
cache:
{
paths:
"string"
}
}
})
config
=
YAML
.
dump
({
types:
[
"build"
,
"test"
],
rspec:
{
script:
"test"
,
cache:
{
paths:
"string"
}
}
})
expect
do
expect
do
GitlabCiYamlProcessor
.
new
(
config
)
GitlabCiYamlProcessor
.
new
(
config
)
end
.
to
raise_error
(
GitlabCiYamlProcessor
::
ValidationError
,
"
rspec job: cache:paths parameter
should be an array of strings"
)
end
.
to
raise_error
(
GitlabCiYamlProcessor
::
ValidationError
,
"
jobs:rspec:cache:paths config
should be an array of strings"
)
end
end
it
"returns errors if job dependencies is not an array of strings"
do
it
"returns errors if job dependencies is not an array of strings"
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