From 17f279fd44bcd402952a76cd7d0a2fa27cdd2e4e Mon Sep 17 00:00:00 2001 From: John Green Date: Thu, 31 Oct 2024 18:17:48 +0000 Subject: [PATCH 1/2] API-7910: Upgrade to latest common-domain library + evergreening --- .../controller/CommonController.scala | 3 ++- project/AppDependencies.scala | 16 ++++++++-------- project/plugins.sbt | 6 +++--- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/app/uk/gov/hmrc/apisubscriptionfields/controller/CommonController.scala b/app/uk/gov/hmrc/apisubscriptionfields/controller/CommonController.scala index 02da986..8cfe8e0 100644 --- a/app/uk/gov/hmrc/apisubscriptionfields/controller/CommonController.scala +++ b/app/uk/gov/hmrc/apisubscriptionfields/controller/CommonController.scala @@ -17,6 +17,7 @@ package uk.gov.hmrc.apisubscriptionfields.controller import scala.concurrent.Future +import scala.reflect.ClassTag import scala.util.{Failure, Success, Try} import play.api.libs.json._ @@ -29,7 +30,7 @@ import uk.gov.hmrc.apisubscriptionfields.utils.ApplicationLogger trait CommonController extends BackendBaseController with ApplicationLogger { - override protected def withJsonBody[T](f: (T) => Future[Result])(implicit request: Request[JsValue], m: Manifest[T], reads: Reads[T]): Future[Result] = { + override protected def withJsonBody[T](f: T => Future[Result])(implicit request: Request[JsValue], ct: ClassTag[T], reads: Reads[T]): Future[Result] = { Try(request.body.validate[T]) match { case Success(JsSuccess(payload, _)) => f(payload) case Success(JsError(errs)) => jsonError(JsError.toJson(errs).toString()) diff --git a/project/AppDependencies.scala b/project/AppDependencies.scala index 0d8c26e..e777a62 100644 --- a/project/AppDependencies.scala +++ b/project/AppDependencies.scala @@ -3,9 +3,9 @@ import sbt._ object AppDependencies { def apply(): Seq[ModuleID] = dependencies ++ testDependencies - private lazy val mongoVersion = "1.7.0" - private lazy val bootstrapVersion = "8.4.0" - val commonDomainVersion = "0.13.0" + private lazy val mongoVersion = "2.1.0" + private lazy val bootstrapVersion = "9.5.0" + val commonDomainVersion = "0.17.0" private lazy val dependencies = Seq( "uk.gov.hmrc" %% "bootstrap-backend-play-30" % bootstrapVersion, @@ -18,11 +18,11 @@ object AppDependencies { ) private lazy val testDependencies = Seq( - "uk.gov.hmrc" %% "bootstrap-test-play-30" % bootstrapVersion, - "uk.gov.hmrc.mongo" %% "hmrc-mongo-test-play-30" % mongoVersion, - "uk.gov.hmrc" %% "api-platform-test-common-domain" % commonDomainVersion, - "org.pegdown" % "pegdown" % "1.6.0", - "org.mockito" %% "mockito-scala-scalatest" % "1.17.30" + "uk.gov.hmrc" %% "bootstrap-test-play-30" % bootstrapVersion, + "uk.gov.hmrc.mongo" %% "hmrc-mongo-test-play-30" % mongoVersion, + "uk.gov.hmrc" %% "api-platform-common-domain-fixtures" % commonDomainVersion, + "org.pegdown" % "pegdown" % "1.6.0", + "org.mockito" %% "mockito-scala-scalatest" % "1.17.30" ).map(d => d % "test") } diff --git a/project/plugins.sbt b/project/plugins.sbt index c1976fa..e0f0f4a 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -6,9 +6,9 @@ addSbtPlugin("uk.gov.hmrc" % "sbt-auto-build" % "3.22.0") addSbtPlugin("uk.gov.hmrc" % "sbt-distributables" % "2.5.0") addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.9") addSbtPlugin("org.scalastyle" % "scalastyle-sbt-plugin" % "1.0.0") -addSbtPlugin("org.playframework" % "sbt-plugin" % "3.0.1") -addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.5.15") +addSbtPlugin("org.playframework" % "sbt-plugin" % "3.0.5") +addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "2.0.3") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2") -addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.11.1") +addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.13.0") ThisBuild / libraryDependencySchemes += "org.scala-lang.modules" %% "scala-xml" % VersionScheme.Always From b8dc5b5d93a7d475720f685a29530fea29ab05a6 Mon Sep 17 00:00:00 2001 From: John Green Date: Thu, 31 Oct 2024 18:36:36 +0000 Subject: [PATCH 2/2] API-7910: PR bot recommendation --- conf/application-json-logger.xml | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 conf/application-json-logger.xml diff --git a/conf/application-json-logger.xml b/conf/application-json-logger.xml deleted file mode 100644 index eea14a6..0000000 --- a/conf/application-json-logger.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - -