summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-07-19 11:27:49 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-07-19 11:27:49 +0200
commit23223ba64e91cc3406ed6cf5889f8cc25f9a1337 (patch)
tree298e5dd0a4ef947ddfea39c7167769afef56403f
parentf49a906a5f805d44ce2b4c6c01e58a38a606761b (diff)
downloadgitlab-ce-23223ba64e91cc3406ed6cf5889f8cc25f9a1337.tar.gz
Do not allow to auto-retry a job more than 2 times
-rw-r--r--doc/ci/yaml/README.md2
-rw-r--r--lib/gitlab/ci/config/entry/job.rb2
-rw-r--r--spec/lib/gitlab/ci/config/entry/job_spec.rb2
3 files changed, 3 insertions, 3 deletions
diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md
index 6b17af1394a..808a23df554 100644
--- a/doc/ci/yaml/README.md
+++ b/doc/ci/yaml/README.md
@@ -1147,7 +1147,7 @@ up to the amount of times specified by the `retry` keyword.
If `retry` is set to 3, and a job succeeds in a second run, it won't be retried
again. `retry` value has to be a positive integer, equal or larger than 0, but
-lower than 10.
+lower or equal to 2 (two retries maximum, three runs in total).
A simple example:
diff --git a/lib/gitlab/ci/config/entry/job.rb b/lib/gitlab/ci/config/entry/job.rb
index 5f1144894b5..32f5c6ab142 100644
--- a/lib/gitlab/ci/config/entry/job.rb
+++ b/lib/gitlab/ci/config/entry/job.rb
@@ -25,7 +25,7 @@ module Gitlab
validates :allow_failure, boolean: true
validates :retry, numericality: { only_integer: true,
greater_than_or_equal_to: 0,
- less_than: 10 }
+ less_than_or_equal_to: 2 }
validates :when,
inclusion: { in: %w[on_success on_failure always manual],
message: 'should be on_success, on_failure, ' \
diff --git a/spec/lib/gitlab/ci/config/entry/job_spec.rb b/spec/lib/gitlab/ci/config/entry/job_spec.rb
index f8ed59a3a44..6769f64f950 100644
--- a/spec/lib/gitlab/ci/config/entry/job_spec.rb
+++ b/spec/lib/gitlab/ci/config/entry/job_spec.rb
@@ -115,7 +115,7 @@ describe Gitlab::Ci::Config::Entry::Job do
it 'returns error about value too high' do
expect(entry).not_to be_valid
- expect(entry.errors).to include 'job retry must be less than 10'
+ expect(entry.errors).to include 'job retry must be less than or equal to 2'
end
end
end