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
939fe31a
Commit
939fe31a
authored
Nov 08, 2019
by
Cédric Tabin
Committed by
Kamil Trzciński
Nov 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allows interruptible keyword in default
parent
36a02ae4
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
53 additions
and
6 deletions
+53
-6
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/boolean.rb
lib/gitlab/ci/config/entry/boolean.rb
+20
-0
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
-1
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
+19
-0
No files found.
doc/ci/yaml/README.md
View file @
939fe31a
...
...
@@ -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
)
-
[
`interruptible`
](
#interruptible
)
In the following example, the
`ruby:2.5`
image is set as the default for all
jobs except the
`rspec 2.6`
job, which uses the
`ruby:2.6`
image:
...
...
ee/spec/lib/ee/gitlab/ci/config/entry/bridge_spec.rb
View file @
939fe31a
...
...
@@ -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]
%i[before_script after_script image services cache
interruptible
]
end
end
...
...
lib/gitlab/ci/config/entry/boolean.rb
0 → 100644
View file @
939fe31a
# 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 @
939fe31a
...
...
@@ -14,7 +14,7 @@ module Gitlab
include
::
Gitlab
::
Config
::
Entry
::
Inheritable
ALLOWED_KEYS
=
%i[before_script image services
after_script cache]
.
freeze
after_script cache
interruptible
]
.
freeze
validations
do
validates
:config
,
allowed_keys:
ALLOWED_KEYS
...
...
@@ -40,7 +40,11 @@ module Gitlab
description:
'Configure caching between build jobs.'
,
inherit:
true
helpers
:before_script
,
:image
,
:services
,
:after_script
,
:cache
entry
:interruptible
,
Entry
::
Boolean
,
description:
'Set jobs interruptible default value.'
,
inherit:
false
helpers
:before_script
,
:image
,
:services
,
:after_script
,
:cache
,
:interruptible
private
...
...
lib/gitlab/ci/config/entry/job.rb
View file @
939fe31a
...
...
@@ -38,7 +38,6 @@ module Gitlab
with_options
allow_nil:
true
do
validates
:tags
,
array_of_strings:
true
validates
:allow_failure
,
boolean:
true
validates
:interruptible
,
boolean:
true
validates
:parallel
,
numericality:
{
only_integer:
true
,
greater_than_or_equal_to:
2
,
less_than_or_equal_to:
50
}
...
...
@@ -100,6 +99,10 @@ module Gitlab
description:
'Services that will be used to execute this job.'
,
inherit:
true
entry
:interruptible
,
Entry
::
Boolean
,
description:
'Set jobs interruptible value.'
,
inherit:
true
entry
:only
,
Entry
::
Policy
,
description:
'Refs policy this job will be executed for.'
,
default:
Entry
::
Policy
::
DEFAULT_ONLY
,
...
...
spec/lib/gitlab/ci/config/entry/default_spec.rb
View file @
939fe31a
...
...
@@ -26,7 +26,7 @@ describe Gitlab::Ci::Config::Entry::Default do
it
'contains the expected node names'
do
expect
(
described_class
.
nodes
.
keys
)
.
to
match_array
(
%i[before_script image services
after_script cache]
)
after_script cache
interruptible
]
)
end
end
end
...
...
spec/lib/gitlab/ci/config/entry/job_spec.rb
View file @
939fe31a
...
...
@@ -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]
environment coverage retry
interruptible
]
end
it
{
is_expected
.
to
match_array
result
}
...
...
spec/lib/gitlab/ci/yaml_processor_spec.rb
View file @
939fe31a
...
...
@@ -108,6 +108,25 @@ module Gitlab
it
{
expect
(
subject
[
:interruptible
]).
to
be_falsy
}
end
it
"returns interruptible when overridden for job"
do
config
=
YAML
.
dump
({
default:
{
interruptible:
true
},
rspec:
{
script:
"rspec"
}
})
config_processor
=
Gitlab
::
Ci
::
YamlProcessor
.
new
(
config
)
expect
(
config_processor
.
stage_builds_attributes
(
"test"
).
size
).
to
eq
(
1
)
expect
(
config_processor
.
stage_builds_attributes
(
"test"
).
first
).
to
eq
({
stage:
"test"
,
stage_idx:
2
,
name:
"rspec"
,
options:
{
script:
[
"rspec"
]
},
interruptible:
true
,
allow_failure:
false
,
when:
"on_success"
,
yaml_variables:
[]
})
end
end
describe
'retry 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