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
0cc8e93a
Commit
0cc8e93a
authored
Dec 06, 2019
by
Cédric Tabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds 'tags' keyword in 'default'
parent
a6ad3119
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
38 additions
and
30 deletions
+38
-30
doc/ci/yaml/README.md
doc/ci/yaml/README.md
+1
-0
ee/spec/lib/ee/gitlab/ci/config/entry/bridge_spec.rb
ee/spec/lib/ee/gitlab/ci/config/entry/bridge_spec.rb
+2
-1
lib/gitlab/ci/config/entry/boolean.rb
lib/gitlab/ci/config/entry/boolean.rb
+0
-20
lib/gitlab/ci/config/entry/default.rb
lib/gitlab/ci/config/entry/default.rb
+8
-3
lib/gitlab/ci/config/entry/job.rb
lib/gitlab/ci/config/entry/job.rb
+5
-2
lib/gitlab/config/entry/array_of_strings.rb
lib/gitlab/config/entry/array_of_strings.rb
+18
-0
spec/lib/gitlab/ci/config/entry/default_spec.rb
spec/lib/gitlab/ci/config/entry/default_spec.rb
+1
-1
spec/lib/gitlab/ci/config/entry/job_spec.rb
spec/lib/gitlab/ci/config/entry/job_spec.rb
+1
-1
spec/lib/gitlab/ci/yaml_processor_spec.rb
spec/lib/gitlab/ci/yaml_processor_spec.rb
+2
-2
No files found.
doc/ci/yaml/README.md
View file @
0cc8e93a
...
...
@@ -135,6 +135,7 @@ The following job parameters can be defined inside a `default:` block:
-
[
`services`
](
#services
)
-
[
`before_script`
](
#before_script-and-after_script
)
-
[
`after_script`
](
#before_script-and-after_script
)
-
[
`tags`
](
#tags
)
-
[
`cache`
](
#cache
)
-
[
`retry`
](
#retry
)
-
[
`timeout`
](
#timeout
)
...
...
ee/spec/lib/ee/gitlab/ci/config/entry/bridge_spec.rb
View file @
0cc8e93a
...
...
@@ -13,7 +13,8 @@ describe EE::Gitlab::Ci::Config::Entry::Bridge do
# that we know that we don't want to inherit
# as they do not have sense in context of Bridge
let
(
:ignored_inheritable_columns
)
do
%i[before_script after_script image services cache interruptible timeout retry]
%i[before_script after_script image services cache interruptible timeout
retry tags]
end
end
...
...
lib/gitlab/ci/config/entry/boolean.rb
deleted
100644 → 0
View file @
a6ad3119
# frozen_string_literal: true
module
Gitlab
module
Ci
class
Config
module
Entry
##
# Entry that represents the interrutible value.
#
class
Boolean
<
::
Gitlab
::
Config
::
Entry
::
Node
include
::
Gitlab
::
Config
::
Entry
::
Validatable
validations
do
validates
:config
,
boolean:
true
end
end
end
end
end
end
lib/gitlab/ci/config/entry/default.rb
View file @
0cc8e93a
...
...
@@ -15,7 +15,7 @@ module Gitlab
ALLOWED_KEYS
=
%i[before_script image services
after_script cache interruptible
timeout retry]
.
freeze
timeout retry
tags
]
.
freeze
validations
do
validates
:config
,
allowed_keys:
ALLOWED_KEYS
...
...
@@ -41,7 +41,7 @@ module Gitlab
description:
'Configure caching between build jobs.'
,
inherit:
true
entry
:interruptible
,
Entry
::
Boolean
,
entry
:interruptible
,
::
Gitlab
::
Config
::
Entry
::
Boolean
,
description:
'Set jobs interruptible default value.'
,
inherit:
false
...
...
@@ -53,7 +53,12 @@ module Gitlab
description:
'Set retry default value.'
,
inherit:
false
helpers
:before_script
,
:image
,
:services
,
:after_script
,
:cache
,
:interruptible
,
:timeout
,
:retry
entry
:tags
,
::
Gitlab
::
Config
::
Entry
::
ArrayOfStrings
,
description:
'Set the default tags.'
,
inherit:
false
helpers
:before_script
,
:image
,
:services
,
:after_script
,
:cache
,
:interruptible
,
:timeout
,
:retry
,
:tags
private
...
...
lib/gitlab/ci/config/entry/job.rb
View file @
0cc8e93a
...
...
@@ -36,7 +36,6 @@ module Gitlab
if: :has_rules?
with_options
allow_nil:
true
do
validates
:tags
,
array_of_strings:
true
validates
:allow_failure
,
boolean:
true
validates
:parallel
,
numericality:
{
only_integer:
true
,
greater_than_or_equal_to:
2
,
...
...
@@ -97,7 +96,7 @@ module Gitlab
description:
'Services that will be used to execute this job.'
,
inherit:
true
entry
:interruptible
,
Entry
::
Boolean
,
entry
:interruptible
,
::
Gitlab
::
Config
::
Entry
::
Boolean
,
description:
'Set jobs interruptible value.'
,
inherit:
true
...
...
@@ -109,6 +108,10 @@ module Gitlab
description:
'Retry configuration for this job.'
,
inherit:
true
entry
:tags
,
::
Gitlab
::
Config
::
Entry
::
ArrayOfStrings
,
description:
'Set the tags.'
,
inherit:
true
entry
:only
,
Entry
::
Policy
,
description:
'Refs policy this job will be executed for.'
,
default:
Entry
::
Policy
::
DEFAULT_ONLY
,
...
...
lib/gitlab/config/entry/array_of_strings.rb
0 → 100644
View file @
0cc8e93a
# frozen_string_literal: true
module
Gitlab
module
Config
module
Entry
##
# Entry that represents a array of strings value.
#
class
ArrayOfStrings
<
Node
include
Validatable
validations
do
validates
:config
,
array_of_strings:
true
end
end
end
end
end
spec/lib/gitlab/ci/config/entry/default_spec.rb
View file @
0cc8e93a
...
...
@@ -27,7 +27,7 @@ describe Gitlab::Ci::Config::Entry::Default do
expect
(
described_class
.
nodes
.
keys
)
.
to
match_array
(
%i[before_script image services
after_script cache interruptible
timeout retry]
)
timeout retry
tags
]
)
end
end
end
...
...
spec/lib/gitlab/ci/config/entry/job_spec.rb
View file @
0cc8e93a
...
...
@@ -24,7 +24,7 @@ describe Gitlab::Ci::Config::Entry::Job do
let
(
:result
)
do
%i[before_script script stage type after_script cache
image services only except rules needs variables artifacts
environment coverage retry interruptible timeout]
environment coverage retry interruptible timeout
tags
]
end
it
{
is_expected
.
to
match_array
result
}
...
...
spec/lib/gitlab/ci/yaml_processor_spec.rb
View file @
0cc8e93a
...
...
@@ -1849,7 +1849,7 @@ module Gitlab
config
=
YAML
.
dump
({
rspec:
{
script:
"test"
,
tags:
"mysql"
}
})
expect
do
Gitlab
::
Ci
::
YamlProcessor
.
new
(
config
)
end
.
to
raise_error
(
Gitlab
::
Ci
::
YamlProcessor
::
ValidationError
,
"jobs:rspec
tags
should be an array of strings"
)
end
.
to
raise_error
(
Gitlab
::
Ci
::
YamlProcessor
::
ValidationError
,
"jobs:rspec
:tags config
should be an array of strings"
)
end
it
"returns errors if before_script parameter is invalid"
do
...
...
@@ -2197,7 +2197,7 @@ module Gitlab
context
"when the tags parameter is invalid"
do
let
(
:content
)
{
YAML
.
dump
({
rspec:
{
script:
"test"
,
tags:
"mysql"
}
})
}
it
{
is_expected
.
to
eq
"jobs:rspec
tags
should be an array of strings"
}
it
{
is_expected
.
to
eq
"jobs:rspec
:tags config
should be an array of strings"
}
end
context
"when YAML content is empty"
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