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
e042dc0a
Commit
e042dc0a
authored
Nov 24, 2019
by
Cédric Tabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds retry keyword in default values
parent
4a525497
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
8 deletions
+35
-8
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
+1
-1
lib/gitlab/ci/config/entry/default.rb
lib/gitlab/ci/config/entry/default.rb
+6
-2
lib/gitlab/ci/config/entry/job.rb
lib/gitlab/ci/config/entry/job.rb
+4
-4
spec/lib/gitlab/ci/config/entry/default_spec.rb
spec/lib/gitlab/ci/config/entry/default_spec.rb
+1
-1
spec/lib/gitlab/ci/yaml_processor_spec.rb
spec/lib/gitlab/ci/yaml_processor_spec.rb
+22
-0
No files found.
doc/ci/yaml/README.md
View file @
e042dc0a
...
...
@@ -135,6 +135,7 @@ The following job parameters can be defined inside a `default:` block:
-
[
`before_script`
](
#before_script-and-after_script
)
-
[
`after_script`
](
#before_script-and-after_script
)
-
[
`cache`
](
#cache
)
-
[
`retry`
](
#retry
)
-
[
`timeout`
](
#timeout
)
-
[
`interruptible`
](
#interruptible
)
...
...
ee/spec/lib/ee/gitlab/ci/config/entry/bridge_spec.rb
View file @
e042dc0a
...
...
@@ -13,7 +13,7 @@ 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]
%i[before_script after_script image services cache interruptible timeout
retry
]
end
end
...
...
lib/gitlab/ci/config/entry/default.rb
View file @
e042dc0a
...
...
@@ -15,7 +15,7 @@ module Gitlab
ALLOWED_KEYS
=
%i[before_script image services
after_script cache interruptible
timeout]
.
freeze
timeout
retry
]
.
freeze
validations
do
validates
:config
,
allowed_keys:
ALLOWED_KEYS
...
...
@@ -49,7 +49,11 @@ module Gitlab
description:
'Set jobs default timeout.'
,
inherit:
false
helpers
:before_script
,
:image
,
:services
,
:after_script
,
:cache
,
:interruptible
,
:timeout
entry
:retry
,
Entry
::
Retry
,
description:
'Set retry default value.'
,
inherit:
false
helpers
:before_script
,
:image
,
:services
,
:after_script
,
:cache
,
:interruptible
,
:timeout
,
:retry
private
...
...
lib/gitlab/ci/config/entry/job.rb
View file @
e042dc0a
...
...
@@ -105,6 +105,10 @@ module Gitlab
description:
'Timeout duration of this job.'
,
inherit:
true
entry
:retry
,
Entry
::
Retry
,
description:
'Retry configuration for this job.'
,
inherit:
true
entry
:only
,
Entry
::
Policy
,
description:
'Refs policy this job will be executed for.'
,
default:
Entry
::
Policy
::
DEFAULT_ONLY
,
...
...
@@ -142,10 +146,6 @@ module Gitlab
description:
'Coverage configuration for this job.'
,
inherit:
false
entry
:retry
,
Entry
::
Retry
,
description:
'Retry configuration for this job.'
,
inherit:
false
helpers
:before_script
,
:script
,
:stage
,
:type
,
:after_script
,
:cache
,
:image
,
:services
,
:only
,
:except
,
:variables
,
:artifacts
,
:environment
,
:coverage
,
:retry
,
:rules
,
...
...
spec/lib/gitlab/ci/config/entry/default_spec.rb
View file @
e042dc0a
...
...
@@ -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]
)
timeout
retry
]
)
end
end
end
...
...
spec/lib/gitlab/ci/yaml_processor_spec.rb
View file @
e042dc0a
...
...
@@ -149,6 +149,28 @@ module Gitlab
expect
(
subject
[
:options
]).
not_to
have_key
(
:retry
)
end
end
context
'when retry count is specified by default'
do
let
(
:config
)
do
YAML
.
dump
(
default:
{
retry:
{
max:
1
}
},
rspec:
{
script:
'rspec'
})
end
it
'does use the default value'
do
expect
(
subject
[
:options
]).
to
include
(
retry:
{
max:
1
})
end
end
context
'when retry count default value is overridden'
do
let
(
:config
)
do
YAML
.
dump
(
default:
{
retry:
{
max:
1
}
},
rspec:
{
script:
'rspec'
,
retry:
{
max:
2
}
})
end
it
'does use the job value'
do
expect
(
subject
[
:options
]).
to
include
(
retry:
{
max:
2
})
end
end
end
describe
'allow failure entry'
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