Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reckon 0.13.2 incorrectly infers the release (final) version if the HEAD revision is already tagged #46

Closed
0x6675636b796f75676974687562 opened this issue Jul 12, 2023 · 1 comment · Fixed by #48
Assignees
Labels
good first issue Good for newcomers

Comments

@0x6675636b796f75676974687562
Copy link
Member

PR #45 introduced version inference using the outdated version 0.13.2 of the ajoberstar/reckon Gradle plug-in. Version 0.13.2 is the last one compatible with Java 8.

Yet, the plug-in is unsuitable for performing a release by merely pushing a tag, using the release.yml workflow.

Scenario A

Consider the HEAD revision is not tagged, and one of the previous revisions has the v1.0.0 tag. In this case,

./gradlew --no-daemon --console=plain -q -Preckon.stage=final :properties 2>/dev/null | grep '^version:' | awk '{ print $2 }'

will correctly increment the version and return 1.0.1.

Scenario B

Consider the HEAD revision is already tagged v1.0.1. Now,

./gradlew --no-daemon --console=plain -q -Preckon.stage=final :properties 2>/dev/null | grep '^version:' | awk '{ print $2 }'

will increment this very version and return 1.0.2 instead of 1.0.1. This means that the tag should be only created by Reckon itself, on the server side, as a part of the release-and-publish workflow, in a single Gradle invocation (./gradlew -Preckon.scope=... -Preckon.stage=final publish reckonTagPush). Gradle targets should be built in this very order:

  1. publish
  2. reckonTagPush

This line from the documentation is outright wrong:

Normally if your HEAD is already tagged, that version is used as a rebuild. However, if your repo is dirty, it knows it's not a rebuild.

Further reading:

@0x6675636b796f75676974687562
Copy link
Member Author

This is a known issue:

The solution is to pass the empty stage value when releasing: -Preckon.stage=.

See this comment for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant