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

#77: scala2.13 support #78

Merged
merged 13 commits into from
Nov 10, 2023
Merged

#77: scala2.13 support #78

merged 13 commits into from
Nov 10, 2023

Conversation

lsulak
Copy link
Collaborator

@lsulak lsulak commented Sep 22, 2023

Closes #77

@lsulak lsulak changed the base branch from master to feature/37-dao-between-agent-server-adjustments September 22, 2023 15:13
@lsulak lsulak changed the title #77: scala212 support #77: scala2.13 support Sep 22, 2023
Base automatically changed from feature/37-dao-between-agent-server-adjustments to master October 6, 2023 15:55
cerveada
cerveada previously approved these changes Oct 13, 2023
build.sbt Outdated
@@ -68,6 +68,15 @@ lazy val server = (projectMatrix in file("server"))
libraryDependencies ++= Dependencies.serverDependencies,
Compile / packageBin / publishArtifact := false,
(Compile / compile) := ((Compile / compile) dependsOn printSparkScalaVersion).value,
Compile / unmanagedSourceDirectories += {
Copy link
Contributor

Choose a reason for hiding this comment

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

Server is not a lib to include but a running app. I would simply build it with Scala 2.13 atm

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually no. Keep it only 2.12. fa-db doesn't support 2.13 yet. :-(

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You are right - I've changed a thing or two. Now only the agent (and model) is being compiled against all 3 versions, the server is compiled only for 2.12.

The sbt log looks something like this:

[info] compiling 7 Scala sources to /Users/ab0222l/Documents/git/atum-service/model/target/jvm-2.12/classes ...
[info] compiling 7 Scala sources to /Users/ab0222l/Documents/git/atum-service/model/target/jvm-2.13/classes ...
[info] compiling 7 Scala sources to /Users/ab0222l/Documents/git/atum-service/model/target/jvm-2.11/classes ...
[info] compiling 25 Scala sources to /Users/ab0222l/Documents/git/atum-service/server/target/jvm-2.12/classes ...
[info] compiling 5 Scala sources to /Users/ab0222l/Documents/git/atum-service/agent/target/spark3-jvm-2.12/classes ...
[info] compiling 5 Scala sources to /Users/ab0222l/Documents/git/atum-service/agent/target/jvm-2.12/classes ...
[info] compiling 5 Scala sources to /Users/ab0222l/Documents/git/atum-service/agent/target/jvm-2.13/classes ...
[info] compiling 5 Scala sources to /Users/ab0222l/Documents/git/atum-service/agent/target/spark2-jvm-2.12/classes ...
[info] compiling 5 Scala sources to /Users/ab0222l/Documents/git/atum-service/agent/target/spark3-jvm-2.13/classes ...
[info] compiling 5 Scala sources to /Users/ab0222l/Documents/git/atum-service/agent/target/jvm-2.11/classes ...
[info] compiling 5 Scala sources to /Users/ab0222l/Documents/git/atum-service/agent/target/spark2-jvm-2.11/classes ...

@Zejnilovic
Copy link
Contributor

@github-actions
Copy link

github-actions bot commented Oct 19, 2023

JaCoCo agent module code coverage report - spark:2 - scala 2.12.18

There is no coverage information present for the Files changed

Total Project Coverage 83.32% 🍏

@github-actions
Copy link

github-actions bot commented Oct 19, 2023

JaCoCo server module code coverage report - scala 2.12.18

File Coverage [7.69%]
InMemoryApiModelDao.scala 7.69%
Total Project Coverage 17.34%

@miroslavpojer
Copy link
Collaborator

https://github.com/AbsaOSS/atum-service/blob/cdf18c2c5073b4b339178aa0ccfa8cb20844a93d/.github/workflows/jacoco_check.yml#L36C27-L36C27

Please update this to from 2.12.12 to 2.12

I have updated it to 2.12.18. That fixed missing JaCoCo comments.

benedeki
benedeki previously approved these changes Oct 24, 2023
Copy link
Contributor

@benedeki benedeki left a comment

Choose a reason for hiding this comment

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

  • code reviewed
  • pulled
  • built
  • run

val scala212 = "2.12.18"
val scala213 = "2.13.11"

val serverScalaVersion: String = scala212
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice!

Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this not a Seq as well as aqentSupportedVersions?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Because supporting more versions in the server is not needed imho, i.e. there will be probably just 1 instance of server, managed by 'us', deployed into Docker & ECR repo & EKS, and it will be able to communicate with the agent that might be in any version - it's just a REST API communication between them after all

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

but on the other hand, agent will be used inside of our applications' scala code, which are usually in range of Scala 2.11 - 2.13 so that must be a Seq

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, is there a reason for sever not being 2.13?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, usually everything in my code has a reason although sometimes not a good one :D anyway, in this case, server has a dependency on fa-db and that is not yet on 2.13 unfortunately

Copy link
Contributor

Choose a reason for hiding this comment

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

Because supporting more versions in the server is not needed imho, i.e. there will be probably just 1 instance of server, managed by 'us', deployed into Docker & ECR repo & EKS, and it will be able to communicate with the agent that might be in any version - it's just a REST API communication between them after all

@lsulak I get it, but then you have 2 different implementations. I would have it both as Seq to have it the same across. First look you see one as Seq and one not.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Why to have something as a different, and improper, data type, just for the sake of consistency? To the best of my knowledge, server will always be in 1 version, thus any kind of iterable doesn't make sense

Copy link
Contributor

Choose a reason for hiding this comment

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

I like the way how it is.
But the DB tests will also suffice to exist under one Scala version. On the other hand the Model module is multi-versioned. So maybe a rename of the variable to more neutral ones?

build.sbt Outdated Show resolved Hide resolved
build.sbt Outdated
@@ -58,6 +57,7 @@ lazy val root = (projectMatrix in file("."))
name := "atum-service-root",
javacOptions ++= Seq("-source", "1.8", "-target", "1.8", "-Xlint"),
publish / skip := true,
crossScalaVersions := Nil,
mergeStrategy
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we using sbt assembly for something?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I guess that there will be Jar containing server and its configuration, and the model, nicely packaged together with it

Copy link
Contributor

Choose a reason for hiding this comment

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

I wanna make a bold comment that you do not need mergeStrategy at all. Or at least I have not seen it.

build.sbt Outdated Show resolved Hide resolved
build.sbt Outdated Show resolved Hide resolved
@miroslavpojer
Copy link
Collaborator

https://github.com/AbsaOSS/atum-service/blob/cdf18c2c5073b4b339178aa0ccfa8cb20844a93d/.github/workflows/jacoco_check.yml#L36C27-L36C27

Please update this to from 2.12.12 to 2.12

I have tested this "requirement" on another GHA workflow and it does not work. The not shorted scala version string is required in titles (can be changed, here) and in sbt ++{scala.version} call, where it is required.

Copy link
Collaborator

@miroslavpojer miroslavpojer left a comment

Choose a reason for hiding this comment

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

  • pulled
  • code review
  • run test
  • run JaCoCo

Optional: This is nice PR to do some atomic increment increase of code coverage.

@lsulak
Copy link
Collaborator Author

lsulak commented Nov 9, 2023

Oopsie. We recently added (outside of this PR) logging via SLF4S, but that's not yet compatible with Scala 2.13 :( mattroberts297/slf4s#20

benedeki
benedeki previously approved these changes Nov 10, 2023
val scala212 = "2.12.18"
val scala213 = "2.13.11"

val serverScalaVersion: String = scala212
Copy link
Contributor

Choose a reason for hiding this comment

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

I like the way how it is.
But the DB tests will also suffice to exist under one Scala version. On the other hand the Model module is multi-versioned. So maybe a rename of the variable to more neutral ones?

@benedeki
Copy link
Contributor

  • code reviewed
  • pulled
  • built
  • run

Zejnilovic
Zejnilovic previously approved these changes Nov 10, 2023
@lsulak lsulak dismissed stale reviews from Zejnilovic and benedeki via 04cc86a November 10, 2023 13:47
@lsulak lsulak merged commit d8ead20 into master Nov 10, 2023
7 of 8 checks passed
@lsulak lsulak deleted the feature/77-scala212-support branch November 10, 2023 13:54
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.

Adding Scala 2.13 into supported versions
5 participants