Skip to content

Commit

Permalink
Merge pull request #642 from hmrc/DDCYLS-5038
Browse files Browse the repository at this point in the history
DDCYLS-5038
  • Loading branch information
parkerbonnie authored Apr 26, 2024
2 parents 7813470 + 55b1d09 commit 6f9261c
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 93 deletions.
12 changes: 1 addition & 11 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ lazy val root = (project in file("."))
.enablePlugins(PlayScala, SbtDistributablesPlugin)
.settings(DefaultBuildSettings.scalaSettings: _*)
.settings(DefaultBuildSettings.defaultSettings(): _*)
.settings(SbtDistributablesPlugin.publishingSettings: _*)
.settings(inConfig(Test)(testSettings): _*)
.configs(IntegrationTest)
.settings(inConfig(IntegrationTest)(Defaults.itSettings): _*)
Expand Down Expand Up @@ -73,16 +72,7 @@ lazy val root = (project in file("."))
"javascripts/timeoutDialog.js",
"javascripts/app.js"
))
),
// prevent removal of unused code which generates warning errors due to use of third-party libs
uglifyCompressOptions := Seq("unused=false", "dead_code=false"),
pipelineStages := Seq(digest),
// below line required to force asset pipeline to operate in dev rather than only prod
Assets / pipelineStages := Seq(concat,uglify),
// only compress files generated by concat
uglify / includeFilter := GlobFilter("application.js")
)
.disablePlugins(JUnitXmlReportPlugin) //Required to prevent https://github.com/scalatest/scalatest/issues/1427
))

lazy val testSettings: Seq[Def.Setting[_]] = Seq(
fork := true,
Expand Down
36 changes: 0 additions & 36 deletions conf/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,39 +20,23 @@ play.http.router=prod.Routes

play.filters.headers.contentSecurityPolicy = "default-src 'self' 'unsafe-inline' www.googletagmanager.com fonts.googleapis.com tagmanager.google.com ssl.gstatic.com www.gstatic.com fonts.gstatic.com www.google-analytics.com data:"

play.http.requestHandler = "uk.gov.hmrc.play.bootstrap.http.RequestHandler"
play.http.errorHandler = "handlers.ErrorHandler"

play.http.filters = play.api.http.EnabledFilters

play.filters.enabled += uk.gov.hmrc.play.bootstrap.frontend.filters.SessionIdFilter

play.application.loader = "uk.gov.hmrc.play.bootstrap.ApplicationLoader"

# Play Modules
# ~~~~
# Additional play modules can be added here
play.modules.enabled += "com.kenshoo.play.metrics.PlayModule"
play.modules.enabled += "uk.gov.hmrc.play.bootstrap.frontend.FrontendModule"
play.modules.enabled += "uk.gov.hmrc.play.audit.AuditModule"
play.modules.enabled += "uk.gov.hmrc.play.bootstrap.HttpClientModule"
play.modules.enabled += "uk.gov.hmrc.play.bootstrap.AuthModule"
play.modules.enabled += "uk.gov.hmrc.play.bootstrap.graphite.GraphiteMetricsModule"
play.modules.enabled += "uk.gov.hmrc.mongo.play.PlayMongoModule"
play.modules.enabled += "config.Module"

play.i18n.langs = ["en", "cy"]

microservice {
metrics {
graphite {
host = localhost
port = 2003
prefix = play.${appName}.
enabled = false
}
}

services {
auth {
host = localhost
Expand All @@ -70,26 +54,6 @@ features {
writeConfirmationTestCasesToFile = true
}

metrics {
name = ${appName}
rateUnit = SECONDS
durationUnit = SECONDS
showSamples = true
jvm = false
enabled = true
}

auditing {
enabled = true
traceRequests = true
consumer {
baseUri {
host = localhost
port = 8100
}
}
}

tracking-consent-frontend {
gtm.container = "a"
}
Expand Down
2 changes: 1 addition & 1 deletion conf/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<logger name="uk.gov" level="INFO"/>

<logger name="reactivemongo" level="WARN"/>
<logger name="akka" level="INFO"/>
<logger name="pekko" level="INFO"/>
<logger name="play" level="INFO"/>
<logger name="org.jose4j" level="INFO"/>
<logger name="class org.jose4j" level="INFO"/>
Expand Down
2 changes: 0 additions & 2 deletions conf/prod.routes
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Add all the application routes to the app.routes file
-> /job-retention-scheme-calculator app.Routes
-> / health.Routes

GET /admin/metrics @com.kenshoo.play.metrics.MetricsController.metrics
4 changes: 2 additions & 2 deletions it/utils/WiremockHelper.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package utils

import akka.actor.ActorSystem
import akka.stream.Materializer
import org.apache.pekko.actor.ActorSystem
import org.apache.pekko.stream.Materializer
import com.github.tomakehurst.wiremock.WireMockServer
import com.github.tomakehurst.wiremock.client.WireMock
import com.github.tomakehurst.wiremock.client.WireMock._
Expand Down
55 changes: 27 additions & 28 deletions project/AppDependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,25 @@ import sbt.*

object AppDependencies {

val playSuffix = "-play-28"
val bootstrapVersion = "8.1.0"
val hmrcMongoVersion = "1.6.0"
val playSuffix = "-play-30"
val bootstrapVersion = "8.4.0"
val hmrcMongoVersion = "1.8.0"

val compile = Seq(
"uk.gov.hmrc.mongo" %% s"hmrc-mongo$playSuffix" % hmrcMongoVersion,
"uk.gov.hmrc" %% "play-conditional-form-mapping" % s"1.13.0$playSuffix",
"uk.gov.hmrc" %% s"bootstrap-frontend$playSuffix" % bootstrapVersion,
"uk.gov.hmrc" %% "play-frontend-hmrc" % s"7.29.0$playSuffix",
"org.typelevel" %% "cats-core" % "2.10.0",
"com.softwaremill.quicklens" %% "quicklens" % "1.9.6",
"com.github.pureconfig" %% "pureconfig" % "0.17.4",
"com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.16.0",
"org.playframework" %% "play-json" % "3.0.1",
"ch.qos.logback" % "logback-classic" % "1.4.14",
"com.typesafe.play" %% "play-logback" % "2.8.21",
"com.kenshoo" %% "metrics-play" % "2.7.3_0.8.2"
val compile: Seq[ModuleID] = Seq(
"uk.gov.hmrc.mongo" %% s"hmrc-mongo$playSuffix" % hmrcMongoVersion,
"uk.gov.hmrc" %% s"play-conditional-form-mapping$playSuffix" % "2.0.0",
"uk.gov.hmrc" %% s"bootstrap-frontend$playSuffix" % bootstrapVersion,
"uk.gov.hmrc" %% s"play-frontend-hmrc$playSuffix" % "8.4.0",
"org.typelevel" %% "cats-core" % "2.10.0",
"com.softwaremill.quicklens" %% "quicklens" % "1.9.6",
"com.github.pureconfig" %% "pureconfig" % "0.17.4",
"com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.16.0",
"org.playframework" %% "play-json" % "3.0.2",
"ch.qos.logback" % "logback-classic" % "1.4.14",
"com.typesafe.play" %% "play-logback" % "2.8.21",
)

val test = Seq(
val test: Seq[ModuleID] = Seq(
"uk.gov.hmrc.mongo" %% s"hmrc-mongo-test$playSuffix" % hmrcMongoVersion,
"uk.gov.hmrc" %% s"bootstrap-test$playSuffix" % bootstrapVersion,
"com.ironcorelabs" %% "cats-scalatest" % "3.1.1",
Expand All @@ -30,24 +29,24 @@ object AppDependencies {
"org.playframework" %% "play-test" % "3.0.0",
"org.scalatestplus" %% "mockito-3-12" % "3.2.10.0",
"org.mockito" % "mockito-core" % "5.8.0",
"org.wiremock" % "wiremock" % "3.3.1",
"org.wiremock" % "wiremock" % "3.3.1",
"org.scalatestplus" %% "scalacheck-1-16" % "3.2.14.0",
"org.scalacheck" %% "scalacheck" % "1.17.0",
"com.vladsch.flexmark" % "flexmark-all" % "0.64.8",
).map(_ % "test, it")

def apply(): Seq[ModuleID] = compile ++ test

val akkaVersion = "2.6.21"
val akkaHttpVersion = "10.2.10"
val pekkoHTTPVersion = "1.0.1"
val pekkoVersion = "1.0.2"

val overrides = Seq(
"com.typesafe.akka" %% "akka-stream" % akkaVersion,
"com.typesafe.akka" %% "akka-protobuf" % akkaVersion,
"com.typesafe.akka" %% "akka-slf4j" % akkaVersion,
"com.typesafe.akka" %% "akka-actor" % akkaVersion,
"com.typesafe.akka" %% "akka-actor-typed" % akkaVersion,
"com.typesafe.akka" %% "akka-serialization-jackson" % akkaVersion,
"com.typesafe.akka" %% "akka-http-core" % akkaHttpVersion
val overrides: Seq[ModuleID] = Seq(
"org.apache.pekko" %% "pekko-stream" % pekkoVersion,
"org.apache.pekko" %% "pekko-protobuf" % pekkoVersion,
"org.apache.pekko" %% "pekko-slf4j" % pekkoVersion,
"org.apache.pekko" %% "pekko-actor" % pekkoVersion,
"org.apache.pekko" %% "pekko-actor-typed" % pekkoVersion,
"org.apache.pekko" %% "pekko-serialization-jackson" % pekkoVersion,
"org.apache.pekko" %% "pekko-http-core" % pekkoHTTPVersion
)
}
12 changes: 4 additions & 8 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,18 @@ resolvers += Resolver.url("HMRC-open-artefacts-ivy", url("https://open.artefacts

resolvers += "Typesafe Releases" at "https://repo.typesafe.com/typesafe/releases/"

addSbtPlugin("uk.gov.hmrc" % "sbt-auto-build" % "3.15.0")
addSbtPlugin("uk.gov.hmrc" % "sbt-auto-build" % "3.21.0")

addSbtPlugin("uk.gov.hmrc" % "sbt-distributables" % "2.4.0")
addSbtPlugin("uk.gov.hmrc" % "sbt-distributables" % "2.5.0")

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.8.20")
addSbtPlugin("org.playframework" % "sbt-plugin" % "3.0.2")

addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0")
addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0" exclude("org.scala-lang.modules", "scala-.12"))

addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.9")

addSbtPlugin("io.github.irundaia" % "sbt-sassify" % "1.5.2")

addSbtPlugin("net.ground5hark.sbt" % "sbt-concat" % "0.2.0")

addSbtPlugin("com.typesafe.sbt" % "sbt-uglify" % "2.0.0")

addSbtPlugin("com.typesafe.sbt" % "sbt-digest" % "1.1.4")

addSbtPlugin("com.lucidchart" % "sbt-scalafmt" % "1.16")
Expand Down
2 changes: 1 addition & 1 deletion project/scaffold.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
addSbtPlugin("org.foundweekends.giter8" % "sbt-giter8-scaffold" % "0.16.0")
addSbtPlugin("org.foundweekends.giter8" % "sbt-giter8-scaffold" % "0.16.2")
2 changes: 1 addition & 1 deletion test/controllers/BaseControllerSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package controllers

import akka.util.Timeout
import org.apache.pekko.util.Timeout
import base.SpecBaseControllerSpecs
import cats.scalatest.ValidatedValues
import cats.syntax.validated._
Expand Down
4 changes: 1 addition & 3 deletions test/resources/test.application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ include "application.conf"

play.filters.disabled += play.filters.csrf.CSRFFilter

play.http.secret.key = "some_secret"

mongo-async-driver {
akka {
pekko {
log-dead-letters-during-shutdown = off
log-dead-letters = 0
}
Expand Down

0 comments on commit 6f9261c

Please sign in to comment.