updatecli
updatecli copied to clipboard
Feature Request: Allow to increment semver using rc
Is your feature request related to a problem?
When using transformers to increment a semver field, there is no transformer that allow bumping the release candidate suffix. For example, it's not possible to bump the version v1.0.0-rc1 to v1.0.0-rc2 using semver transformer.
Solution you'd like
Adds a new semver transformer allowing the release candidate version bumping.
Alternatives you've considered
No response
Anything else?
No response
I think that could be trivial to add something like adding semver inc of type "rc" where the logic could be in https://github.com/updatecli/updatecli/blob/c2bfe049697b76bc7c652d181b71f8f3e0abc0bd/pkg/core/transformer/main.go#LL155C14-L155C16
with something like
case "rc":
if prerelease == regex(^rc(\d)$)
// implement the logic
I am wondering how to handle the following scenario
1.0.0-rc1 -> 1.0.0-rc2 -> -> 1.0.0-rc3 -> 1.0.0
Just sharing a random idea... The semver tool consider 1.0.0-rc3 -> 1.0.0 a prerelease update.
$ semver diff v1.6.0-rc6 v1.6.0
prerelease
Therefore, we can have a flag just to say: "hey, this time is the final prerelease. Just remove the suffix". But I do not have a better idea so far.
Maybe an easier solution is give the user the power to decide the release candidate suffix. The semver lib already have a function to allow that
Why not, we would just need to add a case "prerelease" on https://github.com/updatecli/updatecli/blob/ba335eef7d154bb7806f2afdf0562807c0d33a3b/pkg/core/transformer/main.go#L155
I am still trying to visualise how to decide to increment to the next prerelease or removing the prelease information
I am still trying to visualise how to decide to increment to the next prerelease or removing the prelease information
I think we can just give the user the power to set arbitrary string (validated by the semver lib) in the prerelease version. Something like:
- semverinc:
version: "major,minor"
prerelease: "rc1"
Therefore, we do not need to increment the prerelease version. But we give the users the power to decide which version they want to set.