Closed ctolkmit closed 2 years ago
I think this is a weakness of the current parallel branch handling. If you tried to develop a release/2.2.x
branch, it would correctly skip 2.1.0 which is being developed elsewhere and give you 2.2.0, because they use the same scope to increment from the base 2.0.0 version. Since you want to do major, minor instead of minor, minor, it doesn't work.
Seems like a bug, though I'd have to think through how this could be resolved.
For some reason Reckon doesn't seem to infer the correct version when using release branches. For example, I have a tag of 0.1.0, then created a branch: release/0.1.x
but when reckoning the version on that branch it bumps the version to 0.2.0-dev.1
instead of the expected 0.1.1-dev.1
. The old gradle-git
and the nebula-release
plugin seems to do the right thing. I am curious if I am missing something somehow, I haven't seen anything in the documentation to say if it is supported or not.
@sdavids13 The old gradle-git plugin had a concept of branch patterns that would let you coerce/hint to the plugin that you have a particular normal version in mind for this branch. Currently, reckon doesn't look at branch name at all. There are some conceptual benefits to keeping it generic, but it makes it hard to handle this kind of use case.
If you wouldn't mind opening a separate issue, I think something tied to either branch names or you being able to provide hints of the version like -Dreckon.pattern=0.1.x
(and some equivalent programmatic API might let people mix and match this without reckon needing to know the branch (though that's still an option too).
@ctolkmit Finally taking a look at this, here's what I think is going on:
2.0.7
release (or some 2.0.x
release) is in the history of release/3.0.x
and release/3.1.x
3.0.0-dev.0
tag hinted to reckon that you were working on a major version in release/3.0.x
, so your -Preckon.stage=rc
ended up with 3.0.0-rc.1
3.1.0-dev.0
tag is more than one major/minor/patch increment away from 2.0.7
tag, so reckon considers this an invalid increment and falls back to minor. I'm changing this to a more explicit error in the next version to make this easier to see.One of the big issues here is that I'm purely looking at commit history and not branch names (as mentioned above). This is partly because some CI systems don't preserve branch names properly at all times, and also it avoids having to know what your naming convention is.
An assumption reckon makes is that you have to have contiguous version numbers (e.g. you can't jump from 2.0.7 to 3.1.0 since it requires a major jump then a minor jump).
It might help to see your log with the --graph
flag to provide a better picture of your history. If 3.0.0-rc.1
is in the history of release/3.1.x
I could see some potential options for inferring this correctly. Otherwise, I think reckon wouldn't have any way to identify this without understanding branch names.
I think the approach used to solve #180 (see #181 for description, released in 0.17.0-beta.1) will resolve many of the parallel version use cases. Not positive about this specific one, but would appreciate any feedback.
Hi,
either I am confused about using this plugin in a useful way with multiple release Branches.
Scenario:
My reckon config is:
I have got a project containing two Branches
release/3.0.x
andrelease 3.1.x
. There are still branchesrelease/2.0.x
andrelease/2.1.x
without using reckon, and existing tags like2.0.7
(released, final versions) on therelease/2.0.x
branch.In both 3.x branches I (manually) tagged (different) commits as
3.0.0-dev.0
and3.1.0-dev.0
respectively.When developing on both branches, reckon now determines useful versions like
3.0.0-dev.0.535+586704e
.I now created a release for branch 3.0.x:
./gradlew -Preckon.stage=rc reckonTagCreate
That correctly created:3.0.0-rc.1
I now switch to my
release/3.1.x
branch and start a build, the following happens:Git log's latest tag is 3.1.0.dev:
So - what am I doing wrong? Or is this the expected behavior? We really need to develop two Releases (or even more) in parallel. Would love to use reckon ....