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

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

Open
tim-str opened this issue Sep 27, 2023 · 4 comments

Comments

@tim-str
Copy link

tim-str commented Sep 27, 2023

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 tim-str changed the title Tag with the highest version does NOT work as expected event after useHighestVersion = true is configured Tagging with the highest version does NOT work as expected event after useHighestVersion = true is configured Sep 27, 2023
@tim-str tim-str changed the title Tagging with the highest version does NOT work as expected event after useHighestVersion = true is configured Tagging with the highest version does NOT work as expected even after useHighestVersion = true is configured Sep 29, 2023
duschata added a commit to duschata/axion-release-plugin that referenced this issue Jan 9, 2024
@duschata
Copy link
Contributor

duschata commented Jan 9, 2024

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

duschata@cc2e1f4

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

Greetings, Tom

@tim-str
Copy link
Author

tim-str commented Jan 11, 2024

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.

@duschata
Copy link
Contributor

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

@bgalek
Copy link
Member

bgalek commented Jan 11, 2024

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 :)

duschata added a commit to duschata/axion-release-plugin that referenced this issue Jan 12, 2024
duschata added a commit to duschata/axion-release-plugin that referenced this issue Jan 12, 2024
duschata added a commit to duschata/axion-release-plugin that referenced this issue Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants