fledge icon indicating copy to clipboard operation
fledge copied to clipboard

pre_release() should be smart about version numbers

Open krlmlr opened this issue 1 year ago • 5 comments

0.x.99.9yyy -> 0.(x+1).0 x.99.99.9yyy -> (x+1).0.0

We also might want new modes for bump_version(): "pre-minor" -> x.y.99.9000, "pre-major" -> x.99.99.9000

This is likely a duplicate.

krlmlr avatar Jul 21 '22 13:07 krlmlr

It's related to #341 (but not a duplicate of it).

maelle avatar Jul 21 '22 13:07 maelle

Yeah, let's do the manual route first. It seems useful for automation too.

krlmlr avatar Jul 25 '22 16:07 krlmlr

If we keep that automated use case in mind during development -- my vision is that bumping the "dev" version would use "pre-minor" or "pre-major" if there is a feature or breaking change in the list.

krlmlr avatar Jul 25 '22 16:07 krlmlr

Noting that I did not identify any duplicate of this issue.

maelle avatar Jul 28 '22 13:07 maelle

As the smart behavior will depend on the version decomposition that will be introduced in #412 (here we will need the components to be numeric)

0.x.99.9yyy -> 0.(x+1).  x.99.99.9yyy -> (x+1).0.0

Meaning (in pseudo code), in a function called from pre-release that would return the which if not provided by the user,

# could the dev component simply exist, does it need to start with 9
if !(components[dev] starts with 9 && components[patch]==99) {
  # normal behavior
  return("patch")
  # or error? probably not error
}
if (components[major] == 99 {
  "major"
} else {
 "minor"
}

maelle avatar Jul 29 '22 12:07 maelle

Perhaps:

if minor == 99: major else if patch == 99: minor else: patch

krlmlr avatar Aug 24 '22 03:08 krlmlr

ah yes that is simpler. :smile_cat:

maelle avatar Aug 25 '22 08:08 maelle

I'll get to this after #412 is merged.

maelle avatar Aug 25 '22 08:08 maelle

Does "next" we added in #524 cover this?

maelle avatar Sep 09 '22 07:09 maelle

Yes, thanks.

krlmlr avatar Sep 09 '22 08:09 krlmlr

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.

github-actions[bot] avatar Sep 10 '23 00:09 github-actions[bot]