Skip to content

Commit

Permalink
Merge pull request #34 from hmrc/BDOG-1472
Browse files Browse the repository at this point in the history
BDOG-1472: upgrade dependencies to recommended versions
  • Loading branch information
Victor Arbues authored Apr 20, 2023
2 parents 6811027 + ff23794 commit c458bd3
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 82 deletions.
4 changes: 2 additions & 2 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$govuk-assets-path: "/internal-auth-admin-frontend/assets/lib/govuk-frontend/govuk/assets/";
$hmrc-assets-path: "/internal-auth-admin-frontend/assets/lib/hmrc-frontend/hmrc/";
$govuk-assets-path: "/platform-status/assets/lib/govuk-frontend/govuk/assets/";
$hmrc-assets-path: "/platform-status/assets/lib/hmrc-frontend/hmrc/";

@import "lib/govuk-frontend/govuk/all";
@import "lib/hmrc-frontend/hmrc/all";
3 changes: 0 additions & 3 deletions app/uk/gov/hmrc/platformstatusfrontend/config/AppConfig.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ import scala.concurrent.duration.Duration
@Singleton
class AppConfig @Inject()(config: Configuration, servicesConfig: ServicesConfig) {

private val assetsUrl = config.get[String]("assets.url")

val assetsPrefix : String = assetsUrl + config.get[String]("assets.version")
val analyticsToken: String = config.get[String](s"google-analytics.token")
val analyticsHost : String = config.get[String](s"google-analytics.host")
val startupDelay : Option[Int] = config.getOptional[Int]("startup-delay")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import uk.gov.hmrc.play.bootstrap.frontend.controller.FrontendController
import javax.inject.{Inject, Singleton}
import scala.concurrent.ExecutionContext
import scala.jdk.CollectionConverters._
import play.api.Logger


@Singleton
Expand All @@ -36,10 +37,12 @@ class GarbageController @Inject()(
ec: ExecutionContext
) extends FrontendController(mcc) {

private val logger = Logger(this.getClass)

def garbage: Action[AnyContent] =
Action.async { implicit request =>
val properties = System.getProperties.asScala
for ((k,v) <- properties) println(s"key: $k, value: $v")
for ((k,v) <- properties) logger.debug(s"key: $k, value: $v")

val gcSummaryFuture = for {
backend <- garbageService.getBackendGcInfo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
footerItems: Seq[FooterItem] = Seq.empty,
bodyEndBlock: Option[Html] = None,
scriptsBlock: Option[Html] = None
)(contentBlock: Html)(implicit messages: Messages)
)(contentBlock: Html)(implicit messages: Messages, request : Request[_])

@headerDefault = {
@headerBlock.getOrElse {
Expand Down
10 changes: 6 additions & 4 deletions app/uk/gov/hmrc/platformstatusfrontend/views/Head.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
* limitations under the License.
*@

@import views.html.helper.CSPNonce

@this()

@(headBlock: Option[Html] = None)
@(headBlock: Option[Html] = None)(implicit request: RequestHeader)
@headBlock
<!--[if lte IE 8]><script src='@controllers.routes.Assets.versioned("javascripts/html5shiv.min.js")'></script><![endif]-->
<!--[if lte IE 8]><link href='@controllers.routes.Assets.versioned("stylesheets/application-ie-8.css")' rel="stylesheet" type="text/css" /><![endif]-->
<!--[if gt IE 8]><!--><link href='@controllers.routes.Assets.versioned("stylesheets/application.css")' media="all" rel="stylesheet" type="text/css" /><!--<![endif]-->
<!--[if lte IE 8]><script @CSPNonce.attr src='@controllers.routes.Assets.versioned("javascripts/html5shiv.min.js")'></script><![endif]-->
<!--[if lte IE 8]><link @CSPNonce.attr href='@controllers.routes.Assets.versioned("stylesheets/application-ie-8.css")' rel="stylesheet" type="text/css" /><![endif]-->
<!--[if gt IE 8]><!--><link @CSPNonce.attr href='@controllers.routes.Assets.versioned("stylesheets/application.css")' media="all" rel="stylesheet" type="text/css" /><!--<![endif]-->
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
* limitations under the License.
*@

@import views.html.helper.CSPNonce

@this()

@()
<script src='@controllers.routes.Assets.versioned("lib/govuk-frontend/govuk/all.js")'></script>
<script src='@controllers.routes.Assets.versioned("javascripts/init.js")'></script>
@()(implicit request: RequestHeader)
<script @CSPNonce.attr src='@controllers.routes.Assets.versioned("lib/govuk-frontend/govuk/all.js")'></script>
<script @CSPNonce.attr src='@controllers.routes.Assets.versioned("javascripts/init.js")'></script>
1 change: 0 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ lazy val microservice = Project("platform-status-frontend", file("."))
scalacOptions += "-Wconf:cat=unused-imports&src=html/.*:s",
scalacOptions += "-Wconf:src=routes/.*:s"
)
.settings(publishingSettings: _*)
.configs(IntegrationTest)
.settings(integrationTestSettings(): _*)
.settings(resolvers += Resolver.jcenterRepo)
2 changes: 2 additions & 0 deletions conf/app.routes
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# microservice specific routes

-> /hmrc-frontend hmrcfrontend.Routes

GET /assets/*file controllers.Assets.versioned(path = "/public", file: Asset)
GET / uk.gov.hmrc.platformstatusfrontend.controllers.StatusController.defaultLanding
GET /status uk.gov.hmrc.platformstatusfrontend.controllers.StatusController.platformStatus
Expand Down
62 changes: 2 additions & 60 deletions conf/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,60 +17,18 @@ include "frontend.conf"
appName = "platform-status-frontend"
play.http.router = prod.Routes

# An ApplicationLoader that uses Guice to bootstrap the application.
play.application.loader = "uk.gov.hmrc.play.bootstrap.ApplicationLoader"

# Primary entry point for all HTTP requests on Play applications
play.http.requestHandler = "uk.gov.hmrc.play.bootstrap.http.RequestHandler"

# Provides an implementation of AuditConnector. Use `uk.gov.hmrc.play.audit.AuditModule` or create your own.
# An audit connector must be provided.
play.modules.enabled += "uk.gov.hmrc.play.audit.AuditModule"

# Provides an implementation of MetricsFilter. Use `uk.gov.hmrc.play.bootstrap.graphite.GraphiteMetricsModule` or create your own.
# A metric filter must be provided
play.modules.enabled += "uk.gov.hmrc.play.bootstrap.graphite.GraphiteMetricsModule"

# Provides an implementation and configures all filters required by a Platform frontend microservice.
play.modules.enabled += "uk.gov.hmrc.play.bootstrap.frontend.FrontendModule"

play.filters.enabled=[uk.gov.hmrc.platformstatusfrontend.filters.HeaderSizeFilter]${play.filters.enabled}
play.filters.enabled = [uk.gov.hmrc.platformstatusfrontend.filters.HeaderSizeFilter]${play.filters.enabled}
play.filters.enabled += play.filters.csp.CSPFilter

# Default http client
play.modules.enabled += "uk.gov.hmrc.play.bootstrap.HttpClientModule"

# Custom error handler
play.http.errorHandler = "uk.gov.hmrc.platformstatusfrontend.config.ErrorHandler"

play.filters.headers.contentSecurityPolicy = "default-src 'self' 'unsafe-inline' localhost:9000 localhost:9032 www.google-analytics.com data:"


play.modules.enabled += "uk.gov.hmrc.platformstatusfrontend.guice.SlowStartModule"

# Play Modules
# ~~~~
# Additional play modules can be added here

# Secret key
# ~~~~~
# The secret key is used to secure cryptographics functions.
# If you deploy your application to several instances be sure to use the same key!
# Not set here so that MDTP frontends share the same secret key in the local environment
# (see common.conf in frontend-bootstrap).
# In server environments the secret comes from app-config-common
# play.crypto.secret="B4jXNv9dQavReW6nWEV5h7KvCgKCJqcXSjW6jecjBxP4ghrprs7q1caKo6mt4ueX"


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

services {
contact-frontend {
protocol = http
Expand All @@ -85,18 +43,8 @@ microservice {
}
}

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

auditing {
enabled = false
traceRequests = true
consumer {
baseUri {
host = localhost
Expand All @@ -110,12 +58,6 @@ google-analytics {
host = auto
}

assets {
version = "2.149.0"
version = ${?ASSETS_FRONTEND_VERSION}
url = "http://localhost:9032/assets/"
}


mongodb {
uri = "mongodb://localhost:27017/platform-status-frontend"
Expand Down
2 changes: 0 additions & 2 deletions conf/prod.routes
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Add all the application routes to the app.routes file
-> /platform-status app.Routes
-> / health.Routes
-> /hmrc-frontend hmrcfrontend.Routes


GET /admin/metrics com.kenshoo.play.metrics.MetricsController.metrics
4 changes: 2 additions & 2 deletions project/AppDependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import sbt._

object AppDependencies {

val bootstrapVersion = "7.12.0"
val bootstrapVersion = "7.15.0"

val compile = Seq(

"uk.gov.hmrc" %% "play-frontend-hmrc" % "6.2.0-play-28",
"uk.gov.hmrc" %% "play-frontend-hmrc" % "7.3.0-play-28",
"uk.gov.hmrc" %% "bootstrap-frontend-play-28" % bootstrapVersion,
"org.mongodb.scala" %% "mongo-scala-driver" % "4.8.2",
"org.typelevel" %% "cats-core" % "2.6.1"
Expand Down
6 changes: 3 additions & 3 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
resolvers += MavenRepository("HMRC-open-artefacts-maven2", "https://open.artefacts.tax.service.gov.uk/maven2")
resolvers += Resolver.url("HMRC-open-artefacts-ivy2", url("https://open.artefacts.tax.service.gov.uk/ivy2"))(Resolver.ivyStylePatterns)

addSbtPlugin("uk.gov.hmrc" % "sbt-auto-build" % "3.8.0")
addSbtPlugin("uk.gov.hmrc" % "sbt-distributables" % "2.1.0")
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.8.18")
addSbtPlugin("uk.gov.hmrc" % "sbt-auto-build" % "3.9.0")
addSbtPlugin("uk.gov.hmrc" % "sbt-distributables" % "2.2.0")
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.8.19")
addSbtPlugin("org.irundaia.sbt" % "sbt-sassify" % "1.5.1" )

0 comments on commit c458bd3

Please sign in to comment.