archived-codacy / sbt-codacy-coverage

Sbt plugin for uploading Scala code coverage to Codacy https://www.codacy.com
18 stars 22 forks source link

Dependency on out-of-date circe revision causes breakage when integrated with plugins using newer circe versions. #59

Closed easel closed 5 years ago

easel commented 5 years ago

Scala Version (2.10.x / etc)

sbt 1.2.6, scala 2.12

Operating System (Ubuntu 15.10 / MacOS 10.10 / Windows 10)

OSX 10.14 Mojave

Also amazonlinux 2.0 under docker.

JDK (Oracle 1.8.0_72, OpenJDK 1.8.x, Azul Zing)

java version "1.8.0_192" Java(TM) SE Runtime Environment (build 1.8.0_192-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.192-b12, mixed mode)

Library Dependencies

If this is an issue that involves integration with another system, include the exact version and OS of the other system, including any intermediate drivers or APIs i.e. if you connect to a PostgreSQL database, include both the version / OS of PostgreSQL and the JDBC driver version used to connect to the database.

Expected Behavior

Coverage is submitted.

Actual Behavior

The following stack trace:

codacyCoverage
[error] java.lang.NoSuchMethodError: io.circe.JsonObject.fields()Lscala/collection/immutable/Vector;
[error]     at rapture.json.jsonBackends.circe.CirceAst$.getKeys(ast.scala:41)
[error]     at rapture.json.formatters_1.general(formatters.scala:67)
[error]     at rapture.json.formatters$compact$$anon$1.format(formatters.scala:32)
[error]     at rapture.json.formatters$compact$$anon$1.format(formatters.scala:30)
[error]     at rapture.data.DataCompanion.format(data.scala:110)
[error]     at rapture.data.DataCompanion.format$(data.scala:109)
[error]     at rapture.json.Json$.format(json.scala:99)
[error]     at com.codacy.api.helpers.FileHelper$.writeJsonToFile(FileHelper.scala:49)
[error]     at com.codacy.CodacyCoveragePlugin$.$anonfun$codacyCoverageCommand$9(CodacyCoveragePlugin.scala:73)
[error]     at com.codacy.api.helpers.FileHelper$.$anonfun$withTokenAndCommit$3(FileHelper.scala:21)
[error]     at scala.Option.map(Option.scala:146)
[error]     at com.codacy.api.helpers.FileHelper$.$anonfun$withTokenAndCommit$1(FileHelper.scala:19)
[error]     at com.codacy.api.helpers.FileHelper$.$anonfun$withCommit$2(FileHelper.scala:34)
[error]     at scala.Option.map(Option.scala:146)
[error]     at com.codacy.api.helpers.FileHelper$.withCommit(FileHelper.scala:33)
[error]     at com.codacy.api.helpers.FileHelper$.withTokenAndCommit(FileHelper.scala:18)
[error]     at com.codacy.CodacyCoveragePlugin$.com$codacy$CodacyCoveragePlugin$$codacyCoverageCommand(CodacyCoveragePlugin.scala:67)
[error]     at com.codacy.CodacyCoveragePlugin$AutoImport$.$anonfun$baseSettings$1(CodacyCoveragePlugin.scala:34)
[error]     at com.codacy.CodacyCoveragePlugin$AutoImport$.$anonfun$baseSettings$1$adapted(CodacyCoveragePlugin.scala:31)
[error]     at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error]     at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:40)
[error]     at sbt.std.Transform$$anon$4.work(System.scala:67)
[error]     at sbt.Execute.$anonfun$submit$2(Execute.scala:269)
[error]     at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error]     at sbt.Execute.work(Execute.scala:278)
[error]     at sbt.Execute.$anonfun$submit$1(Execute.scala:269)
[error]     at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error]     at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
[error]     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error]     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error]     at java.lang.Thread.run(Thread.java:748)
[error] (codacyCoverage) java.lang.NoSuchMethodError: io.circe.JsonObject.fields()Lscala/collection/immutable/Vector;

Reproducible Test Case

See https://github.com/easel/codacy-repro -- more details in the README.md. Net-net sbt-codacy-coverage is using an out of date circe version and breaks when it gets updated by another plugin.

larochef commented 5 years ago

I have exactly the same issue. Looks like the issue is with rapture-json-circe.

Is it something you will consider doing or do you need a PR for it?

rtfpessoa commented 5 years ago

@easel that might be a big change in the plugin but I will create an internal task and let you know when I have more information.

easel commented 5 years ago

Thanks @rtfpessoa. I tried to figure out what was going on with rapture, but it seems like it's been put on ice by the author. Maybe somebody else has taken it over or you could just fork it into the plugin? The circe dependency itself should be a very easy change, the source api is largely compatible.

rtfpessoa commented 5 years ago

@easel we just need to decide on the change to make sure we do not incur on this problem again.

atooni commented 5 years ago

Having the same issue ....

atooni commented 5 years ago

Hello, I am just curious if an estimated timeline for a fix exists ?

rtfpessoa commented 5 years ago

@atooni sorry for the delay. The work is already ongoing in the dependencies. And we should have something soon. Probably this week.

larochef commented 5 years ago

Looks like #60 is the PR doing it, when do you think we can have a release of it?

dpfeiffer commented 5 years ago

@rtfpessoa As this issue seems to be resolved, can we expect a release of it? Just started to have this issue.