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

CurrentVersion is returning old version #846

Open
danshinton opened this issue Oct 18, 2024 · 5 comments
Open

CurrentVersion is returning old version #846

danshinton opened this issue Oct 18, 2024 · 5 comments

Comments

@danshinton
Copy link

The plugin was working just fine until this release. Now it returning the wrong version. Here is the output of git tag:

1.0.0
1.1.0
1.1.0-SNAPSHOT
1.2.0
1.2.0-SNAPSHOT
1.3.0
1.3.0-SNAPSHOT
1.4.0
1.4.0-SNAPSHOT
1.5.0
1.5.0-SNAPSHOT
1.6.0
1.6.0-SNAPSHOT
1.7.0-SNAPSHOT

When executing gradle currentVersion I would expect it to return 1.7.0-SNAPSHOT. Instead it returns:

Project version: 1.6.0

This means when trying to do a release it says:

Working on released version 1.6.0, nothing to release

Relevant Gradle config:

plugins {
    id("pl.allegro.tech.build.axion-release").version("1.18.13")
}

scmVersion {
    useHighestVersion()
    tag {
        initialVersion({ _, _ -> "1.0.0" })
        prefix = ""
    }
    nextVersion {
        suffix.set("SNAPSHOT")
        separator.set("-")
    }
    versionIncrementer("incrementMinor")
    repository {
        pushTagsOnly.set(true)
        remote.set(System.getenv("CI_SERVER_URL") + "/" + System.getenv("CI_PROJECT_NAMESPACE") + "/" + System.getenv("CI_PROJECT_NAME") + ".git")
    }
}

How can I go about troubleshooting this?

@danshinton
Copy link
Author

To add some more information:

If I remove 1.6.0, it correctly says 1.6.0-SNAPSHOT and creates a 1.6.0 release. If I remove everything but the following:

1.6.0
1.6.0-SNAPSHOT
1.7.0-SNAPSHOT

It's broke again. If I add 1.7.0 and 1.8.0-SNAPSHOT, it claims the current version is 1.7.0. So I'm not sure why the behavior of the plugin changes once you get to 1.7.0-SNAPSHOT.

@bgalek
Copy link
Member

bgalek commented Oct 18, 2024

Hi, we will look into it.
@radoslaw-panuszewski I think its do the tags filtering, we need to update the filter

@bgalek
Copy link
Member

bgalek commented Oct 21, 2024

@danshinton In the example you provided, do you have any commits after 1.6.0?
Maybe your tags are on the same commit?
It would be perfect if you would prepare a repository that shows the issue.

@danshinton
Copy link
Author

So when I created this ticket, if I create a repo and just called release -Prelease.disableChecks -Prelease.pushTagsOnly and markNextVersion over and over, it worked until 1.6.0 is released. I would use git fetch --prune --prune-tags to reset my local repo to test again.

This morning, it is working for some reason. So there must be some transient condition which is not triggering now.

@tknell
Copy link

tknell commented Nov 6, 2024

@danshinton Do you configure the axion-release plugin in the root dir of your project? The plugin uses the current location as a root to check for git changes in the last commits after the tag. If no changes are found, it uses the last release version instead of a snapshot.

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