Commit 1c807d01 authored by Markus Doits's avatar Markus Doits

amend method description a little bit

parent 65e2731f
...@@ -893,12 +893,11 @@ module Ci ...@@ -893,12 +893,11 @@ module Ci
options&.dig(:environment, :url) || persisted_environment&.external_url options&.dig(:environment, :url) || persisted_environment&.external_url
end end
# The format of the retry option changed in GitLab 11.5. Before it was an # The format of the retry option changed in GitLab 11.5: Before it was
# integer only, after it is a hash. New builds always created have the # integer only, after it is a hash. New builds are created with the new
# correct format, but builds created before GitLab 11.5 and saved in # format, but builds created before GitLab 11.5 and saved in database still
# database still have the old integer only format. This helper method makes # have the old integer only format. This method returns the retry option
# sure that the format is always correct when accessing the retry options, # normalized as a hash in 11.5+ format.
# even on old builds.
def normalized_retry def normalized_retry
value = options&.dig(:retry) value = options&.dig(:retry)
value.is_a?(Integer) ? { max: value } : value.to_h value.is_a?(Integer) ? { max: value } : value.to_h
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment