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

Three commits with new Release version

Open OlgaMaciaszek opened this issue 9 years ago • 6 comments
trafficstars

We've been using this plugin for quite a long time in the Accurest project, but after switching to version 1.3.4, we have the following issue:

after running ./gradlew createRelease three commits with a new relesase version get created in place of one. This is what is returned by git log:

commit c36f7b0cf25efdb2bb6b19475612f51a6e8bb449
Date:   Tue Mar 22 08:46:49 2016 +0100
Release version: 1.0.1    
[ci skip]

commit 4d2d3c6f9723bc0dba92afa9e1a9870cfb898e76
Date:   Tue Mar 22 08:46:49 2016 +0100
Release version: 1.0.1    
[ci skip]

commit ab8a5b03fcf3cf999530e75b36e7c36394a283bb
Date:   Tue Mar 22 08:46:49 2016 +0100
Release version: 1.0.1
[ci skip]

This issue is repeatable.

OlgaMaciaszek avatar Mar 22 '16 08:03 OlgaMaciaszek

Hi, i just tried to reproduce this in both single module and multi-module project (hermes with updated axion-release version) and i failed to see the issue you described.

My guess is you have some kind of multi-module project and createRelease task gets called for each module, but posting relevant parts of configuration would help :)

adamdubiel avatar Mar 26 '16 20:03 adamdubiel

I downloaded Accurest sources and i see the issue now.

First i run ./gradlew release -Prelease.local after changing gradle wrapper version to 2.11, which i have locally. It produced only one commit. It seemed weird, so i grit my teeth and downloaded gradle 2.4 on mobile internet to see that in fact 3 commit messages showed up... looks like some issue with earlier versions of Gradle - i can investigate the exact version once i have broadband internet connection, for now i would propose to change wrapper version.

adamdubiel avatar Mar 26 '16 20:03 adamdubiel

Ok. Will raise it. Thanks @adamdubiel

OlgaMaciaszek avatar Apr 05 '16 07:04 OlgaMaciaszek

After Gradle in AccuREST has been raised to 2.12, we still have this bug.

OlgaMaciaszek avatar Apr 21 '16 09:04 OlgaMaciaszek

It seems to be not related to multiproject build. I had the same in https://github.com/szpak/spock-global-unroll (in the remote repo there is just one commit as I rebased it locally before push).

szpak avatar Apr 25 '16 15:04 szpak

I debugged this problem and it occurs only if createReleaseCommit is set. In that case in HooksPropertiesFactory.create() a new commit hook is added every time new GradleAwareContext is created - for every used task (not like before once in Releaser). It would be needed to move hook addition to some other place or on the other hand maybe it would be easier to just deprecate that feature. Currently, an equivalent commit hook can be easily created by hand.

As a reference for other people hitting this issue:

pre 'commit', { version, position -> "Release version: ${version}\n\n[ci skip]" }

szpak avatar Oct 30 '16 22:10 szpak