From 466c123057da3806aa98b9775d24623aad7e5c65 Mon Sep 17 00:00:00 2001 From: Andrew Nowak Date: Wed, 30 Oct 2024 17:32:05 +0000 Subject: [PATCH 1/4] Upgrade to Scala 2.13 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 1a8729f3a2..dda76c21b2 100644 --- a/build.sbt +++ b/build.sbt @@ -21,7 +21,7 @@ ThisBuild / libraryDependencySchemes += "org.scala-lang.modules" %% "scala-java8-compat" % VersionScheme.Always val commonSettings = Seq( - scalaVersion := "2.12.20", + scalaVersion := "2.13.15", description := "grid", organization := "com.gu", version := "0.1", From c892eaf8fe160e809d203beff7200a779053f3e1 Mon Sep 17 00:00:00 2001 From: Andrew Nowak Date: Wed, 30 Oct 2024 17:56:43 +0000 Subject: [PATCH 2/4] update ordering of fixture keys in FileMetadataAggregatorTest looks like scala 2.13 updates map ordering slightly --- .../gu/mediaservice/model/FileMetadataAggregatorTest.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common-lib/src/test/scala/com/gu/mediaservice/model/FileMetadataAggregatorTest.scala b/common-lib/src/test/scala/com/gu/mediaservice/model/FileMetadataAggregatorTest.scala index 305381d035..bbb9915ba9 100644 --- a/common-lib/src/test/scala/com/gu/mediaservice/model/FileMetadataAggregatorTest.scala +++ b/common-lib/src/test/scala/com/gu/mediaservice/model/FileMetadataAggregatorTest.scala @@ -153,9 +153,9 @@ class FileMetadataAggregatorTest extends AnyFlatSpec with Matchers { "xmpMM:History" -> JsArray(Seq( JsArray(Seq( "{'stEvt:softwareAgent':'Adobe Photoshop CC (Macintosh)'}", + "{'stEvt:when':'2018-02-06T16:36:48Z'}", "{'stEvt:action':'created'}", "{'stEvt:instanceID':'xmp.iid:65d63b5e-a24e-4e51-89bd-6693ce193404'}", - "{'stEvt:when':'2018-02-06T16:36:48Z'}", ).map(JsString)), JsArray(Seq( "{'stEvt:action':'saved'}", @@ -167,9 +167,9 @@ class FileMetadataAggregatorTest extends AnyFlatSpec with Matchers { JsArray(Seq( "{'stEvt:action':'saved'}", "{'stEvt:when':'2019-07-04T14:12:26+01:00'}", + "{'stEvt:instanceID':'xmp.iid:adbc5207-3f5b-4480-9e67-ed2a1871deb9'}", "{'stEvt:softwareAgent':'Adobe Photoshop CC 2019 (Macintosh)'}", "{'stEvt:changed':'/'}", - "{'stEvt:instanceID':'xmp.iid:adbc5207-3f5b-4480-9e67-ed2a1871deb9'}", ).map(JsString)), JsArray(Seq( "{'stEvt:parameters':'from application/vnd.adobe.photoshop to image/png'}", From 4395b36038a61570cf6d224d2bc62e2d86ba1bc4 Mon Sep 17 00:00:00 2001 From: Andrew Nowak Date: Wed, 30 Oct 2024 18:06:52 +0000 Subject: [PATCH 3/4] a couple of explicit IndexedSeq->Seq conversions --- thrall/app/lib/elasticsearch/ElasticSearch.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/thrall/app/lib/elasticsearch/ElasticSearch.scala b/thrall/app/lib/elasticsearch/ElasticSearch.scala index 7b395a4fc8..1d024c94d2 100644 --- a/thrall/app/lib/elasticsearch/ElasticSearch.scala +++ b/thrall/app/lib/elasticsearch/ElasticSearch.scala @@ -639,7 +639,7 @@ class ElasticSearch( val exportsParameter = JsDefined(Json.toJson(exports)).toOption.map { cs: JsValue => // TODO deduplicate with set collections cs.as[JsArray].value.map { c => asNestedMap(c) - } + }.toSeq }.orNull val eventualUpdateResponse = migrationAwareUpdater( @@ -673,7 +673,7 @@ class ElasticSearch( val collectionsParameter = JsDefined(Json.toJson(collections)).toOption.map { cs: JsValue => cs.as[JsArray].value.map { c => asNestedMap(c) - } + }.toSeq }.orNull val eventualUpdateResponse = migrationAwareUpdater( From ca2da9fc7d051d4d5d0a1b4b58f7aa2a20691ab6 Mon Sep 17 00:00:00 2001 From: Andrew Nowak Date: Mon, 18 Nov 2024 17:31:08 +0000 Subject: [PATCH 4/4] remove 2.12/2.13 compat module --- build.sbt | 3 --- 1 file changed, 3 deletions(-) diff --git a/build.sbt b/build.sbt index dda76c21b2..9a74b9c345 100644 --- a/build.sbt +++ b/build.sbt @@ -75,9 +75,6 @@ val maybeBBCLib: Option[sbt.ProjectReference] = if(bbcBuildProcess) Some(bbcProj lazy val commonLib = project("common-lib").settings( libraryDependencies ++= Seq( - // FIXME - added temporarily to assist code compatible with scala 2.12 and 2.13 - // remove ASAP after completing 2.13 upgrade!!! - "org.scala-lang.modules" %% "scala-collection-compat" % "2.12.0", "com.gu" %% "editorial-permissions-client" % "3.0.0", "com.gu" %% "pan-domain-auth-play_2-8" % "7.0.0", "com.amazonaws" % "aws-java-sdk-iam" % awsSdkVersion,