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

WIP: Upgrade to Scala 2.13 #4303

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import com.typesafe.sbt.packager.debian.JDebPackaging
ThisBuild / packageOptions += FixedTimestamp(Package.keepTimestamps)

val commonSettings = Seq(
scalaVersion := "2.12.20",
scalaVersion := "2.13.15",
description := "grid",
organization := "com.gu",
version := "0.1",
Expand Down Expand Up @@ -142,7 +142,7 @@ lazy val mediaApi = playProject("media-api", 9001)
.settings(
libraryDependencies ++= Seq(
"org.apache.commons" % "commons-email" % "1.5",
"org.parboiled" %% "parboiled" % "2.1.5",
"org.parboiled" %% "parboiled" % "2.5.1",
"org.http4s" %% "http4s-core" % "0.23.17",
)
)
Expand All @@ -166,7 +166,7 @@ lazy val usage = playProject("usage", 9009).settings(
libraryDependencies ++= Seq(
"com.gu" %% "content-api-client-default" % "19.0.4",
"com.gu" %% "content-api-client-aws" % "0.7",
"io.reactivex" %% "rxscala" % "0.26.5",
"io.reactivex" %% "rxscala" % "0.27.0",
"com.amazonaws" % "amazon-kinesis-client" % "1.8.10",
"com.google.protobuf" % "protobuf-java" % "3.19.6"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import com.gu.mediaservice.lib.config.CommonConfig
import com.gu.mediaservice.model.ImageStatusRecord
import org.scanamo._
import org.scanamo.syntax._
import org.scanamo.generic.auto._
import software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient

import scala.concurrent.{ExecutionContext, Future}
import scala.jdk.CollectionConverters.collectionAsScalaIterableConverter
Expand Down
2 changes: 1 addition & 1 deletion image-loader/app/controllers/ImageLoaderController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import com.gu.mediaservice.lib.logging.{FALLBACK, LogMarker, MarkerMap}
import com.gu.mediaservice.lib.play.RequestLoggingFilter
import com.gu.mediaservice.lib.{DateTimeUtils, ImageIngestOperations}
import com.gu.mediaservice.model.{UnsupportedMimeTypeException, UploadInfo}
import org.scanamo.{ConditionNotMet, ScanamoError}
import org.scanamo.error.{ConditionNotMet, ScanamoError}
import lib.FailureResponse.Response
import lib.imaging.{MimeTypeDetection, NoSuchImageExistsInS3, UserImageLoaderException}
import lib.storage.{ImageLoaderStore, S3FileDoesNotExistException}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package controllers

import com.gu.mediaservice.lib.argo.ArgoHelpers
import com.gu.mediaservice.lib.auth._
import org.scanamo.error.{ConditionNotMet, DynamoReadError, ScanamoError}
import lib._
import model.{StatusType, UploadStatus}
import org.scanamo.{ConditionNotMet, ScanamoError}
Expand Down
6 changes: 4 additions & 2 deletions image-loader/app/lib/UploadStatusTable.scala
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package lib

import com.gu.mediaservice.lib.aws.DynamoDB
import org.scanamo._
import org.scanamo.error.DynamoReadError
import org.scanamo.query.{AndCondition, AttributeExists, Condition, ConditionExpression, KeyEquals}
import org.scanamo.syntax._
import org.scanamo.generic.auto._
import model.StatusType.{Prepared, Queued}
import model.{UploadStatus, UploadStatusRecord}
import software.amazon.awssdk.services.dynamodb.{DynamoDbAsyncClient, DynamoDbAsyncClientBuilder}
Expand All @@ -17,7 +19,7 @@ class UploadStatusTable(config: ImageLoaderConfig) {
private val uploadStatusTable = Table[UploadStatusRecord](config.uploadStatusTable)

def getStatus(imageId: String) = {
scanamo.exec(uploadStatusTable.get("id" === imageId))
ScanamoAsync(client)(uploadStatusTable.get('id -> imageId))
}

def setStatus(uploadStatus: UploadStatusRecord) = {
Expand Down
1 change: 0 additions & 1 deletion leases/app/lib/LeaseStore.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package lib
import com.gu.mediaservice.model.leases.{MediaLease, MediaLeaseType}
import org.scanamo._
import org.scanamo.syntax._
import org.scanamo.generic.auto._
import org.joda.time.DateTime
import software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient

Expand Down
Loading