Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorMarkus Doits <markus.doits@stellenticket.de>2018-11-05 21:36:51 +0300
committerMarkus Doits <markus.doits@stellenticket.de>2018-11-07 15:05:28 +0300
commit1c807d01d461e391d1d0ef56d198784c1884eacc (patch)
tree6d5f157652394d1852291eb82987d7706f366bae /app
parent65e2731f8316d614b9002f5c80f6afbd08925543 (diff)
amend method description a little bit
Diffstat (limited to 'app')
-rw-r--r--app/models/ci/build.rb11
1 files changed, 5 insertions, 6 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index 9d6bfbb0db7..045228b4226 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -893,12 +893,11 @@ module Ci
options&.dig(:environment, :url) || persisted_environment&.external_url
end
- # The format of the retry option changed in GitLab 11.5. Before it was an
- # integer only, after it is a hash. New builds always created have the
- # correct format, but builds created before GitLab 11.5 and saved in
- # database still have the old integer only format. This helper method makes
- # sure that the format is always correct when accessing the retry options,
- # even on old builds.
+ # The format of the retry option changed in GitLab 11.5: Before it was
+ # integer only, after it is a hash. New builds are created with the new
+ # format, but builds created before GitLab 11.5 and saved in database still
+ # have the old integer only format. This method returns the retry option
+ # normalized as a hash in 11.5+ format.
def normalized_retry
value = options&.dig(:retry)
value.is_a?(Integer) ? { max: value } : value.to_h