From 05df13c67fb85783993f5e0042447a174183549a Mon Sep 17 00:00:00 2001 From: Oscar Duignan <100650+oscarduignan@users.noreply.github.com> Date: Fri, 22 Mar 2024 10:29:29 +0000 Subject: [PATCH] NOJIRA add default entry for optimizely config to stop service getting config warnings when they set their optimizely.projectId only in app-config --- CHANGELOG.md | 12 ++++++++++++ .../src/main/resources/reference.conf | 4 ++++ .../config/TrackingConsentConfigSpec.scala | 12 ++++++++++++ 3 files changed, 28 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ccafe7274..d9f3b903c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,18 @@ and this project adheres to [Semantic Versioning](http://semver.org/). For compatibility information see `govukFrontendVersion` and `hmrcFrontendVersion` in [LibDependencies](project/LibDependencies.scala) +## [9.2.0] - 2024-03-22 + +### Changed + +- Added default config entries for optimizely to show that our library supports it, and avoid services using it + getting "NotOverriding" config warnings + +### Compatible with + +- [hmrc/hmrc-frontend v6.4.0](https://github.com/hmrc/hmrc-frontend/releases/tag/v6.4.0) +- [alphagov/govuk-frontend v5.2.0](https://github.com/alphagov/govuk-frontend/releases/tag/v5.2.0) + ## [9.1.0] - 2024-03-19 ### Changed diff --git a/play-frontend-hmrc-play-30/src/main/resources/reference.conf b/play-frontend-hmrc-play-30/src/main/resources/reference.conf index 032e8f6e1..e1f3f2cf5 100644 --- a/play-frontend-hmrc-play-30/src/main/resources/reference.conf +++ b/play-frontend-hmrc-play-30/src/main/resources/reference.conf @@ -81,3 +81,7 @@ pta-account-menu { } language.fallback.url = "https://www.gov.uk/government/organisations/hm-revenue-customs" + +# used to enable A/B testing experiments from the experimentation team +optimizely.url = "https://cdn.optimizely.com/js/" +optimizely.projectId = null diff --git a/play-frontend-hmrc-play-30/src/test/scala/uk/gov/hmrc/hmrcfrontend/config/TrackingConsentConfigSpec.scala b/play-frontend-hmrc-play-30/src/test/scala/uk/gov/hmrc/hmrcfrontend/config/TrackingConsentConfigSpec.scala index 7a14bc75e..1b5b791a2 100644 --- a/play-frontend-hmrc-play-30/src/test/scala/uk/gov/hmrc/hmrcfrontend/config/TrackingConsentConfigSpec.scala +++ b/play-frontend-hmrc-play-30/src/test/scala/uk/gov/hmrc/hmrcfrontend/config/TrackingConsentConfigSpec.scala @@ -50,9 +50,21 @@ class TrackingConsentConfigSpec extends AnyWordSpec with Matchers { config.optimizelyUrl should equal(None) } + "return None if optimizely.projectId is null" in { + implicit val application: Application = buildApp( + Map( + "optimizely.url" -> "http://optimizely.com/", + "optimizely.projectId" -> null + ) + ) + val config = application.injector.instanceOf[TrackingConsentConfig] + config.optimizelyUrl should equal(None) + } + "return None if optimizely.url is not defined" in { implicit val application: Application = buildApp( Map( + "optimizely.url" -> null, "optimizely.projectId" -> "1234567" ) )