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

breaking: Update to Scala 3.3.3 #507

Merged
merged 4 commits into from
Jun 14, 2024
Merged

breaking: Update to Scala 3.3.3 #507

merged 4 commits into from
Jun 14, 2024

Conversation

lolgab
Copy link
Contributor

@lolgab lolgab commented Jun 14, 2024

Scala 3 case-app doesn't depend on shapeless anymore, which should reduce the binary size
This also updates dependencies to their Scala 3 compatible counterpart

  • case-app is updated to 2.1.0-M28
  • airframe-log is updated to 24.6.0
  • mockito is replaced with scalamock which supports scala 3
  • scalatest is updated to 3.2.18
  • play-json is updated to 2.10.5
  • codacy-plugins-api is updated to 8.1.4
  • scala-xml is updated to 2.3.0

Scala 3 case-app doesn't depend on shapeless anymore, which
should reduce the binary size
This also updates dependencies to their Scala 3 compatible counterpart
- case-app is updated to `2.1.0-M28`
- airframe-log is updated to `24.6.0`
- airframe-log is updated to `24.6.0`
- `mockito` is replaced with `scalamock` which supports scala 3
- `scalatest` is updated to `3.2.18`
- `play-json` is updated to `2.10.5`
- `codacy-plugins-api` is updated to `8.1.4`
- `scala-xml` is updated to `2.3.0`
Copy link

codacy-production bot commented Jun 14, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+4.75% (target: -1.00%) 100.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (5cad31b) 355 314 88.45%
Head commit (1ffe969) 824 (+469) 768 (+454) 93.20% (+4.75%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#507) 15 15 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences


🚀 Don’t miss a bit, follow what’s new on Codacy.

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

@lolgab lolgab requested a review from a team June 14, 2024 13:38
@@ -53,9 +53,10 @@ class GitClient(workDirectory: File) {

val result: Seq[String] =
if (treeWalk.next) {
Stream
Iterator
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before this was lazy, but now with the .toSeq it is not. Maybe we want to use LazyList here to maintain the semantics?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! Fixing it.


name := "codacy-coverage-reporter"

// Runtime dependencies
libraryDependencies ++= Seq(
"com.github.alexarchambault" %% "case-app" % "2.1.0-M26",
"org.wvlet.airframe" %% "airframe-log" % "22.3.0"
"com.github.alexarchambault" %% "case-app" % "2.1.0-M28",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙃

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷‍♂️

"com.typesafe.play" %% "play-json" % "2.8.2",
"org.scalaj" %% "scalaj-http" % "2.4.2",
"com.typesafe.play" %% "play-json" % "2.10.5",
("org.scalaj" %% "scalaj-http" % "2.4.2").cross(CrossVersion.for3Use2_13),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the ideia here? That lib is not available for Scala3, and with this we are relying on the one from 2.13? (It also seems deprecated, so I guess we will want to swap at some point)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly!
I tried to swap with sttp once and I created an outage, but I will give another try with a newer and better maintained library. Fortunately Sbt can check for incompatibilities with the mix of _2.13 and _3 dependencies, so we are totally safe here.


gitFileFetcher.forCommit(any[String]).shouldReturn(Right(Seq.empty))
(gitFileFetcher.forCommit _).when(*).returns(Right(Seq.empty))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Such a strange syntax imo, but it is what it is

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, Scalamock stretches Scala's syntax to be able to mock at compile time and not using reflection, so I'm happy enough.

def commonSettings =
Seq(scalacOptions := {
val toFilter = Set("-deprecation:false")
scalacOptions.value.filterNot(toFilter) ++ Seq("-deprecation")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is happening here and why do we need it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were two issues that were failing compilation because of -Xfatal-warnings and couldn't be seen because of the -deprecation:false setting in codacy-sbt. Maybe we need to revisit scalacOptions in codacy-sbt but until that day this removes that option and adds -deprecation.

Copy link
Member

@machadoit machadoit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@lolgab lolgab merged commit 9642dc1 into master Jun 14, 2024
17 checks passed
@lolgab lolgab deleted the scala-3 branch June 14, 2024 14:18
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.

2 participants