You need to sign in or sign up before continuing.
Convert versions in versions.yaml into floats
This issue is about changing the next_version
method to use floats instead of integers. Not sure it's worth it, we'll need to make a bit of research if that breaks anything.
The following discussion from !1831 (merged) should be addressed:
-
@ashmckenzie started a discussion: (+3 comments) suggestion: I realise the data type of versions used in https://gitlab.com/gitlab-org/gitlab-docs/-/blob/master/content/_data/versions.yaml are strings (perhaps that could be discussed?) but if we used floats here, this would reduce some of the casting of data types, e.g.
last_major_patch = 0.12 # Last patch version of last major latest_stable = data_versions[:online].first next_major, next_minor = latest_stable.split('.').map(&:to_f) next_minor = next_minor * 0.01 # If the minor version of the latest online version # is equal to last_minor_patch, bump the major version # and set patch to 0. This is for the case where a new # major version is the next version to be released. # if next_minor == last_major_patch next_major + 1 else next_major + (next_minor + 0.01) end.to_s