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
4f11dd77
Commit
4f11dd77
authored
Nov 27, 2019
by
Will Layton
Committed by
Kamil Trzciński
Nov 27, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Increase CI job 'when delayed' limit to 1 week
parent
bd024427
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
10 deletions
+14
-10
changelogs/unreleased/feat-increase-start-in.yml
changelogs/unreleased/feat-increase-start-in.yml
+5
-0
doc/ci/yaml/README.md
doc/ci/yaml/README.md
+3
-2
lib/gitlab/ci/config/entry/job.rb
lib/gitlab/ci/config/entry/job.rb
+1
-1
spec/lib/gitlab/ci/config/entry/job_spec.rb
spec/lib/gitlab/ci/config/entry/job_spec.rb
+5
-7
No files found.
changelogs/unreleased/feat-increase-start-in.yml
0 → 100644
View file @
4f11dd77
---
title
:
Increase upper limit of start_in attribute to 1 week
merge_request
:
20323
author
:
Will Layton
type
:
changed
doc/ci/yaml/README.md
View file @
4f11dd77
...
...
@@ -1245,11 +1245,12 @@ Delayed job are for executing scripts after a certain period.
This is useful if you want to avoid jobs entering
`pending`
state immediately.
You can set the period with
`start_in`
key. The value of
`start_in`
key is an elapsed time in seconds, unless a unit is
provided.
`start_in`
key must be less than or equal to one
hour
. Examples of valid values include:
provided.
`start_in`
key must be less than or equal to one
week
. Examples of valid values include:
-
`10 seconds`
-
`30 minutes`
-
`1 hour`
-
`1 day`
-
`1 week`
When there is a delayed job in a stage, the pipeline will not progress until the delayed job has finished.
This means this keyword can also be used for inserting delays between different stages.
...
...
lib/gitlab/ci/config/entry/job.rb
View file @
4f11dd77
...
...
@@ -51,7 +51,7 @@ module Gitlab
validates
:rules
,
array_of_hashes:
true
end
validates
:start_in
,
duration:
{
limit:
'1
day
'
},
if: :delayed?
validates
:start_in
,
duration:
{
limit:
'1
week
'
},
if: :delayed?
validates
:start_in
,
absence:
true
,
if:
->
{
has_rules?
||
!
delayed?
}
validate
do
...
...
spec/lib/gitlab/ci/config/entry/job_spec.rb
View file @
4f11dd77
...
...
@@ -93,7 +93,7 @@ describe Gitlab::Ci::Config::Entry::Job do
context
'when delayed job'
do
context
'when start_in is specified'
do
let
(
:config
)
{
{
script:
'echo'
,
when:
'delayed'
,
start_in:
'1
day
'
}
}
let
(
:config
)
{
{
script:
'echo'
,
when:
'delayed'
,
start_in:
'1
week
'
}
}
it
{
expect
(
entry
).
to
be_valid
}
end
...
...
@@ -232,11 +232,9 @@ describe Gitlab::Ci::Config::Entry::Job do
context
'when delayed job'
do
context
'when start_in is specified'
do
let
(
:config
)
{
{
script:
'echo'
,
when:
'delayed'
,
start_in:
'1
day
'
}
}
let
(
:config
)
{
{
script:
'echo'
,
when:
'delayed'
,
start_in:
'1
week
'
}
}
it
'returns error about invalid type'
do
expect
(
entry
).
to
be_valid
end
it
{
expect
(
entry
).
to
be_valid
}
end
context
'when start_in is empty'
do
...
...
@@ -257,8 +255,8 @@ describe Gitlab::Ci::Config::Entry::Job do
end
end
context
'when start_in is longer than one
day
'
do
let
(
:config
)
{
{
when:
'delayed'
,
start_in:
'
2
days'
}
}
context
'when start_in is longer than one
week
'
do
let
(
:config
)
{
{
when:
'delayed'
,
start_in:
'
8
days'
}
}
it
'returns error about exceeding the limit'
do
expect
(
entry
).
not_to
be_valid
...
...
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