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

AcceptedRegressionRule with more than 1 entry #30

Open
schlachtzeuger opened this issue Apr 5, 2019 · 3 comments
Open

AcceptedRegressionRule with more than 1 entry #30

schlachtzeuger opened this issue Apr 5, 2019 · 3 comments

Comments

@schlachtzeuger
Copy link

Hi there,

I've adapted the AcceptedRegressionRule, but when there's more than 1 entry, Gradle fails with this stacktrace:

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':check-api:japicmp'.
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:38)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:63)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:49)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:46)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:46)
at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:43)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:355)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:343)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:336)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:322)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:134)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:129)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:202)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:193)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:129)
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: org.gradle.api.UncheckedIOException: Unable to store input properties for task ':check-api:japicmp'. Property 'richReport.rules' with value '[me.champeau.gradle.japicmp.report.ViolationRuleConfiguration@45431910]' cannot be serialized.
at org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionStateTaskExecuter.snapshotTaskInputProperties(ResolveBeforeExecutionStateTaskExecuter.java:130)
at org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionStateTaskExecuter.createExecutionState(ResolveBeforeExecutionStateTaskExecuter.java:91)
at org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionStateTaskExecuter.execute(ResolveBeforeExecutionStateTaskExecuter.java:73)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:110)
at org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionOutputsTaskExecuter.execute(ResolveBeforeExecutionOutputsTaskExecuter.java:67)
at org.gradle.api.internal.tasks.execution.ResolveAfterPreviousExecutionStateTaskExecuter.execute(ResolveAfterPreviousExecutionStateTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:94)
at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:95)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
... 24 more
Caused by: org.gradle.api.UncheckedIOException: java.lang.ClassNotFoundException: AcceptedRegressionRule
at org.gradle.internal.snapshot.impl.SerializedValueSnapshot.populateClass(SerializedValueSnapshot.java:108)
at org.gradle.internal.snapshot.impl.SerializedValueSnapshot.hasSameSerializedValue(SerializedValueSnapshot.java:72)
at org.gradle.internal.snapshot.impl.SerializedValueSnapshot.snapshot(SerializedValueSnapshot.java:53)
at org.gradle.internal.snapshot.impl.DefaultValueSnapshotter.snapshot(DefaultValueSnapshotter.java:59)
at org.gradle.internal.snapshot.impl.ListValueSnapshot.processList(ListValueSnapshot.java:49)
at org.gradle.internal.snapshot.impl.ListValueSnapshot.snapshot(ListValueSnapshot.java:34)
at org.gradle.internal.snapshot.impl.DefaultValueSnapshotter.snapshot(DefaultValueSnapshotter.java:59)
at org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionStateTaskExecuter.snapshotTaskInputProperties(ResolveBeforeExecutionStateTaskExecuter.java:127)
... 36 more
Caused by: java.lang.ClassNotFoundException: AcceptedRegressionRule
at org.gradle.internal.io.ClassLoaderObjectInputStream.resolveClass(ClassLoaderObjectInputStream.java:40)
at org.gradle.internal.snapshot.impl.SerializedValueSnapshot.populateClass(SerializedValueSnapshot.java:106)
... 43 more

@melix
Copy link
Owner

melix commented Apr 5, 2019

Hi, can you create a reproducer?

@schlachtzeuger
Copy link
Author

schlachtzeuger commented Apr 5, 2019

I took the AcceptedRegressionRule from the example.
My task looks like:

`

task japicmp(type: me.champeau.gradle.japicmp.JapicmpTask) {
oldClasspath = configurations.baseline
newClasspath = configurations.current
onlyModified = true
failOnSourceIncompatibility = false
failOnModification = false
ignoreMissingClasses = true
packageIncludes = ['mypackage']
txtOutputFile = file("$buildDir/reports/japi.txt")
xmlOutputFile = file("$buildDir/reports/japi.xml")

richReport {
    title = "Binary compatibility report"
    reportName = "japicmp.html"

    def acceptedViolations = [
            'Implemented interface org.gradle.api.attributes.HasConfigurableAttributes': '@Incubating interface has been removed'
    ]
    addRule(AcceptedRegressionRule, acceptedViolations)

    includedClasses = [
            '.*mypackage.*'
    ]
}

}

`

this works perfectly fine. Now I just add a second accepted violation:

`

task japicmp(type: me.champeau.gradle.japicmp.JapicmpTask) {
oldClasspath = configurations.baseline
newClasspath = configurations.current
onlyModified = true
failOnSourceIncompatibility = false
failOnModification = false
ignoreMissingClasses = true
packageIncludes = ['mypackage']
txtOutputFile = file("$buildDir/reports/japi.txt")
xmlOutputFile = file("$buildDir/reports/japi.xml")

richReport {
    title = "Binary compatibility report"
    reportName = "japicmp.html"

    def acceptedViolations = [
            'Implemented interface org.gradle.api.attributes.HasConfigurableAttributes': '@Incubating interface has been removed',
            'Implemented interface some.other.package.SomeOtherClass': 'Now required'
    ]
    addRule(AcceptedRegressionRule, acceptedViolations)

    includedClasses = [
            '.*mypackage.*'
    ]
}

}

`

Does this help?

@schlachtzeuger
Copy link
Author

Even if I only have one accepted violation but change the text of the key, it doesn't work anymore. I'm puzzled...

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