diff --git a/common/app/experiments/Experiments.scala b/common/app/experiments/Experiments.scala index b153453db26..4c1018c9366 100644 --- a/common/app/experiments/Experiments.scala +++ b/common/app/experiments/Experiments.scala @@ -13,6 +13,7 @@ object ActiveExperiments extends ExperimentsDefinition { Set( RemoveLiteFronts, MastheadWithHighlights, + EuropeBetaFront, DarkModeWeb, ) implicit val canCheckExperiment: CanCheckExperiment = new CanCheckExperiment(this) @@ -28,6 +29,19 @@ object MastheadWithHighlights participationGroup = Perc50, ) +object EuropeBetaFront + extends Experiment( + name = "europe-beta-front", + description = "Allows viewing the beta version of the Europe network front", + owners = Seq( + Owner.withGithub("cemms1"), + Owner.withEmail("project.fairground@theguardian.com"), + Owner.withEmail("dotcom.platform@theguardian.com"), + ), + sellByDate = LocalDate.of(2025, 4, 2), + participationGroup = Perc0A, + ) + object DarkModeWeb extends Experiment( name = "dark-mode-web", diff --git a/facia/app/controllers/FaciaController.scala b/facia/app/controllers/FaciaController.scala index e8a2662a800..9fdacb015e6 100644 --- a/facia/app/controllers/FaciaController.scala +++ b/facia/app/controllers/FaciaController.scala @@ -6,7 +6,7 @@ import common._ import conf.Configuration import conf.switches.Switches.InlineEmailStyles import controllers.front._ -import experiments.{ActiveExperiments, RemoveLiteFronts} +import experiments.{ActiveExperiments, EuropeBetaFront, RemoveLiteFronts} import http.HttpPreconnections import implicits.GUHeaders import layout.slices._ @@ -223,6 +223,13 @@ trait FaciaController private[controllers] def renderFrontPressResult(path: String)(implicit request: RequestHeader): Future[Result] = { val NonAdFreeType = if (ActiveExperiments.isParticipating(RemoveLiteFronts)) FullType else LiteType + // Europe beta experiment + // Phase 1 prevents users from being able to view the europe-beta front unless opted into the test + val inEuropeBetaTest = ActiveExperiments.isParticipating(EuropeBetaFront) + if (path == "europe-beta" && !inEuropeBetaTest) { + return successful(Cached(CacheTime.NotFound)(WithoutRevalidationResult(NotFound))) + } + val futureFaciaPage: Future[Option[(PressedPage, Boolean)]] = frontJsonFapi.get(path, requestType).flatMap { case Some(faciaPage: PressedPage) => val pageContainsTargetedCollections = TargetedCollections.pageContainsTargetedCollections(faciaPage)