ajoberstar / reckon

Infer a project's version from your Git repository.
Apache License 2.0
185 stars 28 forks source link

Reckoned version wrong #104

Closed jordanjennings closed 5 years ago

jordanjennings commented 5 years ago

Reckon is picking the wrong version number when there's an existing patch version with a 10 or greater in it.

My latest version is 1.4.17, so I would expect reckon to pick 1.4.18 for the next patch version but it's picking 1.4.2.

This issue may also apply to major and minor versions, I haven't tested that. Also if it's relevant, I migrated from the old release plugin to reckon and am now seeing this issue.

My reckon configuration:

reckon {
    scopeFromProp()
    stageFromProp('dev', 'final')
}

Gradle output (truncated):

$ ./gradlew properties -Preckon.scope=patch

> Configure project :
Reckoned version: 1.4.2-dev.0.52+3345781

Since it's picking the wrong version, when I try to set the scope the build fails:

$ ./gradlew properties -q -Preckon.scope=patch -Preckon.stage=dev

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred evaluating root project 'my-project'.
> Reckoned target normal version 1.4.2 has already been released.

My tags (truncated a bit):

v1.3.1
v1.4.0
v1.4.1
v1.4.10
v1.4.11
v1.4.12
v1.4.13
v1.4.14
v1.4.15
v1.4.16
v1.4.17
v1.4.2
v1.4.3
v1.4.4
v1.4.5
v1.4.6
v1.4.7
v1.4.8
v1.4.9

Versions of things: Gradle 5.0-rc-3 Reckon 0.9.0 Java 8

jordanjennings commented 5 years ago

Turns out my master branch with the tags wasn't merged into the dev branch and I assumed the issue was with the tag ordering. At least opening the issue helped me realize it was user error :) Thanks!