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

Fixes #16491: Port Rudder to Scala 2.13 #2699

Conversation

fanf
Copy link
Member

@fanf fanf commented Jan 7, 2020

https://issues.rudder.io/issues/16491

There is a lot of little things, only one tricky, so start by that one:
In scala.xml, Node ++ Node leads to Seq[Node] in place of NodeSeq. There is nothing special for method awaiting NodeSeq because there's an implicit conversion, but when a method accepts Seq[A], it keeps the former. This is a problem for lift #> which accept both Seq[A] et NodeSeq with different semantic. On Seq[A], it applies the mapping on all A, else it applies one whole NodeSeq. So we need to force everything to NodeSeq to be sure.

Other things:

  • some lib needed to be updated to have a scala 2.13, but all to version with similar semantic (doobie just need an explicit import for Timestamp now)
  • changes in scalac flags lead to various change in imports
  • the biggest change: there is no more automatic conversion between mutable and immutable collection, so that leads to a lot of .toSeq
  • mapValues and filterKey are now method on view, which has a different type to make explicit when there is a view. So we must force its evaluation with toMap afterward.
  • compiler is more strict on several things, so we needed to add type annotation, missing escape, 1L in place of 1l, etc
  • we need to call toString before + (thing not coerced to string automatically by default, which is a big win against silly errors)

@fanf fanf added WIP Use that label for a Work In Progress PR that must not be merged yet qa: Can't merge and removed qa: Can't merge labels Jan 7, 2020
@fanf
Copy link
Member Author

fanf commented Jan 7, 2020

PR updated with a new commit

1 similar comment
@fanf
Copy link
Member Author

fanf commented Jan 8, 2020

PR updated with a new commit

@fanf fanf force-pushed the bug_16491/port_rudder_to_scala_2_13 branch from ed04999 to 7188635 Compare January 15, 2020 17:40
@fanf
Copy link
Member Author

fanf commented Jan 15, 2020

PR updated with a new commit

@fanf fanf removed the WIP Use that label for a Work In Progress PR that must not be merged yet label Jan 16, 2020
@Normation-Quality-Assistant
Copy link
Contributor

OK, squash merging this PR

@Normation-Quality-Assistant Normation-Quality-Assistant merged commit c886c98 into Normation:branches/rudder/6.0 Jan 16, 2020
@fanf fanf deleted the bug_16491/port_rudder_to_scala_2_13 branch March 15, 2024 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants