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

Incompatibility with latest version of grgit plugin #215

Closed
bigwaff opened this issue Jan 23, 2018 · 8 comments
Closed

Incompatibility with latest version of grgit plugin #215

bigwaff opened this issue Jan 23, 2018 · 8 comments
Milestone

Comments

@bigwaff
Copy link

bigwaff commented Jan 23, 2018

We use latest version of grgit plugin in our builds. We like to use axion but when both the latest version grgit plugin and latest version axion plugin are both declared plugins for a project, axion has following issue performing "release" task (possibly other tasks as well).

$ ./gradlew release --stacktrace

> Task :verifyRelease FAILED
Looking for uncommitted changes..

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':verifyRelease'.
> No such property: branch for class: org.ajoberstar.grgit.operation.BranchStatusOp

* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':verifyRelease'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
        at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
        at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:60)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)
        at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87)
        at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:626)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:581)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: groovy.lang.MissingPropertyException: No such property: branch for class: org.ajoberstar.grgit.operation.BranchStatusOp
        at org.ajoberstar.grgit.internal.OpSyntax$_mapOperation_closure1.doCall(OpSyntax.groovy:30)
        at com.sun.proxy.$Proxy33.accept(Unknown Source)
        at org.ajoberstar.grgit.internal.OpSyntax.mapOperation(OpSyntax.groovy:29)
        at org.ajoberstar.grgit.internal.OpSyntax$mapOperation.callStatic(Unknown Source)
        at org.ajoberstar.grgit.service.BranchService.status(BranchService.groovy)
        at org.ajoberstar.grgit.service.BranchService$status$0.call(Unknown Source)
        at pl.allegro.tech.build.axion.release.infrastructure.git.GitRepository.checkAheadOfRemote(GitRepository.groovy:307)
        at pl.allegro.tech.build.axion.release.domain.scm.ScmRepository$checkAheadOfRemote$3.call(Unknown Source)
        at pl.allegro.tech.build.axion.release.VerifyReleaseTask.verify(VerifyReleaseTask.groovy:48)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:46)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:780)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:747)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:121)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:110)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
        ... 29 more


* Get more help at https://help.gradle.org

BUILD FAILED in 0s
1 actionable task: 1 executed

Axion is breaking because it ends up using the latest grgit which has api changes.

I'm new to GitHub so I'm working through the process of contributing. I've forked axion-release-plugin project and updated both the jgit version and grgit versions to the latest. Everything builds and all tests pass (had to remove reference to GrgitExecption; it no longer exists). Will add PR shortly. Is there a specific contribution workflow you prefer?

@adamdubiel
Copy link
Collaborator

No, nothing in particular :) I'm glad that you created this issue beforehand.

@bigwaff
Copy link
Author

bigwaff commented Jan 24, 2018

Associated PR #216

@bigwaff
Copy link
Author

bigwaff commented Jan 26, 2018

I was thinking some more about the situation where clients may want to use different versions of libraries axion is dependent upon. One possible approach would be to use shadow plugin to create axion uber jar containing relocated versions of dependencies jgit, grgit, etc. This would insulate both clients and axion from classpath pollution. Will add PR shortly.

Shadow build PR #217

@bigwaff
Copy link
Author

bigwaff commented Feb 23, 2018

@adamdubiel The latest release 1.8.3 still does not resolve the issue when end user includes both the latest version of GrGit plugin and axion-release plugin in their project. To further illustrate, I've created a small project which demonstrates the issue.

https://github.com/bigwaff/axion-blows-up

The fundamental issue is axion-release depends upon a specific release version of GrGit plugin which end user can override by innocently declaring a later release version of GrGit in their project's plugins section. This essentially pollutes the gradle project classpath.

@adamdubiel
Copy link
Collaborator

Because it is such a big change, i decided to add some manual tests and literally 5 minutes age pushed a tag to some sandbox repo using snapshot version of axion-release, the one without GrGit. I feel safe to release 1.9.0 now.

@adamdubiel adamdubiel added this to the 1.9.0 milestone Feb 23, 2018
@adamdubiel
Copy link
Collaborator

@adamdubiel
Copy link
Collaborator

Also checked with your sample project, works as expected:

$ ./gradlew build release --stacktrace -Prelease.localOnly -Prelease.disableChecks

> Task :verifyRelease
Skipping uncommitted changes check
Skipping ahead of remote check
Skipping snapshot dependencies check

> Task :release
Creating tag: release-0.1.0
Changes made to local repository only


BUILD SUCCESSFUL in 0s
6 actionable tasks: 2 executed, 4 up-to-date

@bigwaff bigwaff closed this as completed Feb 26, 2018
@bigwaff
Copy link
Author

bigwaff commented Feb 26, 2018

Awesome. I've verified as well.

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

2 participants