Skip to content

Revert "Pre-Scala 2.13: Upgrade dependencies to versions also available for Scala 2.13"#531

Merged
rtyley merged 1 commit intomainfrom
revert-522-pre-scala-2.13-upgrade-dependencies
Sep 10, 2024
Merged

Revert "Pre-Scala 2.13: Upgrade dependencies to versions also available for Scala 2.13"#531
rtyley merged 1 commit intomainfrom
revert-522-pre-scala-2.13-upgrade-dependencies

Conversation

@rtyley
Copy link
Copy Markdown
Member

@rtyley rtyley commented Sep 10, 2024

Reverts #522, as unfortunately it failed to deploy. The fixed version of the PR is #532.

@rtyley rtyley merged commit c1a7604 into main Sep 10, 2024
@rtyley rtyley deleted the revert-522-pre-scala-2.13-upgrade-dependencies branch September 10, 2024 17:00
@prout-bot
Copy link
Copy Markdown

Seen on PROD (merged by @rtyley 5 minutes and 15 seconds ago) Please check your changes!

rtyley added a commit that referenced this pull request Sep 11, 2024
…cala 2.13

This is a repeat of the work in #522,
which was reverted with #531 due to
a runtime exception on startup:

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
rtyley added a commit that referenced this pull request Sep 11, 2024
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants