axion-release-plugin icon indicating copy to clipboard operation
axion-release-plugin copied to clipboard

Tagging with the highest version does NOT work as expected even after useHighestVersion = true is configured

Open tim-str opened this issue 2 years ago • 4 comments

Hi All,

Could you please have a look and advise what may have been set up in wrong way in the following Axion plugin configuration as the expectation I'd had was the plugin to traverse the entire Git repo tree when working out the current position for a given "prefix" value? The promise from the docs presumes that " Tag with the highest version Second mode is searching for highest version visible in the git tree's history. This means that all commits from HEAD till first commit will be analysed." (https://axion-release-plugin.readthedocs.io/en/latest/configuration/version/#tag-with-the-highest-version)

Repo state is similar to the example from docs:

[T1] ~| | ~~ | [] ~~ [T2] | ~~ ~ | [C] ~~~[]

Config applied: scmVersion { useHighestVersion = true checks { uncommittedChanges.set(false) } tag { prefix.set(project.name.concat('-')) } repository { directory.set(project.rootProject.layout.getProjectDirectory().toString()) pushTagsOnly.set(true) } }

Expected result of the "currentVersion" task: Project version: {T2 + increment}-SNAPSHOT

Actual result of the "currentVersion" task: Project version: {T1 + increment}-SNAPSHOT

The implication of this issue is that the current position value becomes dependent on which branch the "currentVersion" task is run from as well as failures in releasing new artifacts since this may lead to the new version generated by plugin clashing with what already tagged on other branches' commits.

Thanks.

tim-str avatar Sep 27 '23 00:09 tim-str

Hallo All, do you agree that this behavior is not what we expected? Please have a look at the modified test here:

https://github.com/duschata/axion-release-plugin/commit/cc2e1f45704e1e1a4c565241278377b0c3bd36ca

This has worked for us in older versions of the plugin. If you agree, I'll try to fix it.

Greetings, Tom

duschata avatar Jan 09 '24 14:01 duschata

Thanks for getting back on this issue @duschata - it would be great to have this fixed and controlled via the unit test verification going forward. If you could refer us to a plug-in version where the behavior of the "useHighestVersion" config parameter results in the plug-in traversing the entire Git tree rather than only ascendant commits that would be very useful for us as a short-term fix.

tim-str avatar Jan 11 '24 03:01 tim-str

@adamdubiel, @bgalek, are you still active here? What do you think about it?

duschata avatar Jan 11 '24 05:01 duschata

Hi, thanks for providing a test case. This indeed seems like regression. I'll be happy to review and merge PR if you want to make a fix :)

bgalek avatar Jan 11 '24 07:01 bgalek