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

Throw exception if tag can't be pushed #262

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

matteomazza91
Copy link

happening on version 19.0.6

Current behaviour

If the push of the release tag fails, the build continues uninterrupted.

Expected behaviour

If the push of the release tag fails, the build fails.

Impact

if the build fails to push the tag v1.1.0, the successive build will infer v1.1.0 again and will try to publish new artifacts with the same version of what was already published. This may cause replacement of previously published artifacts.

logs using id("nebula.release") version "19.0.6"

 > Task :release
 Caching disabled for task ':release' because:
   Build cache is disabled
 Task ':release' is not up-to-date because:
   Task has not declared any outputs despite executing actions.
 Tagging repository as v1.1.0
 Starting process 'command 'git''. Working directory: /some-path/code Command: git --git-dir=/some-path/code/.git --work-tree=/some-path/code tag -a v1.1.0 -m Release of 1.1.0


 Successfully started process 'command 'git''
 Pushing changes in v1.1.0 to origin
 Starting process 'command 'git''. Working directory: /some-path/code Command: git --git-dir=/some-path/code/.git --work-tree=/some-path/code push origin v1.1.0
 Successfully started process 'command 'git''
 Failed to push tag v1.1.0 to remote origin
 org.gradle.api.GradleException: fatal: could not read Username for 'some-repo': No such device or address
 
 	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
 	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
 	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
 	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
 	at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:72)
 	at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
 	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:59)
 	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:263)
 	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:277)
	at org.gradle.internal.classpath.Instrumented$FileInputStreamConstructorCallSite.callConstructor(Instrumented.java:971)
 	at nebula.plugin.release.git.command.GitWriteCommandsUtil.executeGitCommand(GitWriteCommandsUtil.groovy:89)
 	at nebula.plugin.release.git.command.GitWriteCommandsUtil.pushTag(GitWriteCommandsUtil.groovy:39)
 	at nebula.plugin.release.git.base.ReleaseTask.release(ReleaseTask.groovy:35)
        [...]

[...]
 BUILD SUCCESSFUL in 3m 14s
 46 actionable tasks: 46 executed

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

Successfully merging this pull request may close these issues.

1 participant