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 #22723: Backport scala 2.13 change for scala 3.0 migration #4789

Conversation

fanf
Copy link
Member

@fanf fanf commented May 4, 2023

https://issues.rudder.io/issues/22723

Backport all changes compatible with scala 2.13. Commit 31d64d9 compensate for the drift since the PR was opened + for some changes that would require scala 3 or became unnecessary for now (moving PropertyParser in its own module for example).

The changes are mainly:

  • a lot of added type ascription, added () and .apply
  • removing all final in front of case object and object
  • changing use of silencer by now builtin nowarn (and so com.github.ghik.silencer.silent by scala.annotation.nowarn)
  • changing the scala 3 deprecated syntax for renaming self into a method call, e.g:
object RULES extends OU("Rules", BASE_DN) {
    rules =>
    private[this] def rules = this
...
  • some xml magic concatenation syntax now illicit
  • changing lift json implicit val formats = Serialization.formats(NoTypeHints) into implicit val formats = DefaultFormats
  • avoiding having two different method having the same name (for ex: get / getIO in ConfigService)
  • adding case in for loop when we extract a case class, typically case JString(ruleId) <- childs

Nothing seems to change code semantic anywhere (but welcomong a second pair of eyes).
If it's really the case, we should make the change in the oldest branch we support to avoid merge horror stories after that.

There is warning because of place where the replacement of silencer is not yet useful. I will remove them in second time

@fanf fanf requested a review from VinceMacBuche May 4, 2023 20:09
@fanf fanf force-pushed the arch_22723/backport_scala_2_13_change_for_scala_3_0_migration branch from 8af31bb to 382a938 Compare May 4, 2023 20:10
@fanf
Copy link
Member Author

fanf commented May 4, 2023

PR updated with a new commit

1 similar comment
@fanf
Copy link
Member Author

fanf commented May 4, 2023

PR updated with a new commit

@Normation-Quality-Assistant
Copy link
Contributor

This PR is not mergeable to upper versions.
Since it is "Ready for merge" you must merge it by yourself using the following command:
rudder-dev merge https://github.com/Normation/rudder/pull/4789
-- Your faithful QA
Kant merge: "All our knowledge begins with the senses, proceeds then to the understanding, and ends with reason. There is nothing higher than reason."
(https://ci.normation.com/jenkins/job/merge-accepted-pr/68352/console)

@fanf fanf force-pushed the arch_22723/backport_scala_2_13_change_for_scala_3_0_migration branch from 54bd5e6 to 8be2d26 Compare May 12, 2023 10:19
@fanf fanf force-pushed the arch_22723/backport_scala_2_13_change_for_scala_3_0_migration branch from 8be2d26 to da3d601 Compare May 12, 2023 13:17
@Normation-Quality-Assistant
Copy link
Contributor

This PR is not mergeable to upper versions.
Since it is "Ready for merge" you must merge it by yourself using the following command:
rudder-dev merge https://github.com/Normation/rudder/pull/4789
-- Your faithful QA
Kant merge: "It is beyond a doubt that all our knowledge begins with experience."
(https://ci.normation.com/jenkins/job/merge-accepted-pr/68444/console)

@fanf
Copy link
Member Author

fanf commented May 15, 2023

OK, squash merging this PR

@fanf fanf force-pushed the arch_22723/backport_scala_2_13_change_for_scala_3_0_migration branch from da3d601 to 28b1be8 Compare May 15, 2023 16:28
@fanf fanf mentioned this pull request May 15, 2023
@fanf fanf merged commit 28b1be8 into Normation:branches/rudder/7.2 May 15, 2023
7 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants