amend method description a little bit

This commit is contained in:
Markus Doits 2018-11-05 19:36:51 +01:00
parent 65e2731f83
commit 1c807d01d4
No known key found for this signature in database
GPG Key ID: A0796D16BD3D3DAE
1 changed files with 5 additions and 6 deletions

View File

@ -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