Conversation
…cala 2.13 This is a repeat of the work in #522, previously reverted with #531 due to a runtime SLF4J error on startup: ``` java.lang.ClassCastException: org.slf4j.helpers.NOPLoggerFactory cannot be cast to ch.qos.logback.classic.LoggerContext: ``` This error occurred because we were including an update to `content-api-client-default` that took it past version v28.0.0 (https://github.com/guardian/content-api-scala-client/releases/tag/v28.0.0), which upgraded `slf4j-api` to v2, which no longer honours the old static binder mechanism for finding logging providers (https://www.slf4j.org/codes.html#ignoredBindings). Logback v1.3+ copes with this, and is used by Play v2.9. However, upgrading Play is another chunk of work, so I'm going to avoid that with this change, and stick to CAPI client v27.0.0. ### Description of original work As preparation for Scala 2.13, this updates all dependencies so that they are at versions that are available for Scala 2.13 as well as Scala 2.12. As ScalaTest is updated to ScalaTest v3.2, we had to do some code updates to cope with class/package changes. We did these manually, though later we remembered that maybe we could have used Scalafix, as in this example here: * guardian/content-api#2893 The steps would have been: - add sbt-scalafix plugin to user-level sbt plugins file - addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.12.1") - checked out main branch, still scala 2.12 (and so already compiled successfully) - launch sbt - run `scalafixEnable` - run `scalafixAll dependency:RewriteDeprecatedNames@org.scalatest:autofix:3.1.0.1` - increment scalatest dependency
JamieB-gu
approved these changes
Sep 17, 2024
Member
Author
|
This has successfully deployed to PROD, and I've verified that I can still re-authenticate. |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a repeat of the work in #522, previously reverted with #531 due to a runtime SLF4J error on startup (literally, running
sbt runis enough to immediately expose this error, we should have done that!):slf4j2 (fatalClassCastExceptionon startup) maintaining-scala-projects#14The error occurred because we were including an update to
content-api-client-defaultthat took it past version v28.0.0, which upgradedslf4j-apito v2, which no longer honours the old static binder mechanism for finding logging providers. Logback v1.3+ copes with this, and is used by Play v2.9. However, Play 2.9 requires Scala 2.13 - and we are not yet on Scala 2.13! - so I'm going to just stick to CAPI client v27.0.0 for this PR.Original PR description
As preparation for Scala 2.13, this updates all dependencies so that they are at versions that are available for Scala 2.13 as well as Scala 2.12.
As ScalaTest is updated to ScalaTest v3.2, we had to do some code updates to cope with class/package changes. We did these manually, though later we remembered that maybe we could have used Scalafix, as in this example here:
The steps would have been:
scalafixEnablescalafixAll dependency:RewriteDeprecatedNames@org.scalatest:autofix:3.1.0.1Testing
This has been successfully deployed to https://tagmanager.code.dev-gutools.co.uk/ (which we didn't do with #522!) and the tool looks good: