From e53b13a9aa8c576bb1be94fd2a3f86823e29cf94 Mon Sep 17 00:00:00 2001 From: Alex Sanders Date: Tue, 7 Jan 2025 10:26:54 +0000 Subject: [PATCH 1/2] add a 0% test for crosswords in DCR --- common/app/experiments/Experiments.scala | 28 ++++++++++++++++-------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/common/app/experiments/Experiments.scala b/common/app/experiments/Experiments.scala index fdb2279ffe8..5b0f36ce968 100644 --- a/common/app/experiments/Experiments.scala +++ b/common/app/experiments/Experiments.scala @@ -13,6 +13,7 @@ object ActiveExperiments extends ExperimentsDefinition { Set( EuropeBetaFront, CommercialBundleUpdater, + DCRCrosswords, DarkModeWeb, ) implicit val canCheckExperiment: CanCheckExperiment = new CanCheckExperiment(this) @@ -31,15 +32,6 @@ object EuropeBetaFront participationGroup = Perc0A, ) -object DarkModeWeb - extends Experiment( - name = "dark-mode-web", - description = "Enable dark mode on web", - owners = Seq(Owner.withGithub("jakeii"), Owner.withEmail("dotcom.platform@theguardian.com")), - sellByDate = LocalDate.of(2025, 1, 30), - participationGroup = Perc0D, - ) - object CommercialBundleUpdater extends Experiment( name = "commercial-bundle-updater", @@ -48,3 +40,21 @@ object CommercialBundleUpdater sellByDate = LocalDate.of(2025, 1, 30), participationGroup = Perc5A, ) + +object DCRCrosswords + extends Experiment( + name = "dcr-crosswords", + description = "Render crosswords in DCR", + owners = Seq(Owner.withEmail("dotcom.platform@theguardian.com")), + sellByDate = LocalDate.of(2025, 2, 26), + participationGroup = Perc0C, + ) + +object DarkModeWeb + extends Experiment( + name = "dark-mode-web", + description = "Enable dark mode on web", + owners = Seq(Owner.withGithub("jakeii"), Owner.withEmail("dotcom.platform@theguardian.com")), + sellByDate = LocalDate.of(2025, 1, 30), + participationGroup = Perc0D, + ) From a6b6bdb3411f54eb923cfe6b98fee11a76b8a3ed Mon Sep 17 00:00:00 2001 From: oliverabrahams Date: Thu, 9 Jan 2025 14:22:45 +0000 Subject: [PATCH 2/2] Use test to decide if rendering of crossword articles is done in DCR. --- .../dotcomrendering/CrosswordsPicker.scala | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/applications/app/services/dotcomrendering/CrosswordsPicker.scala b/applications/app/services/dotcomrendering/CrosswordsPicker.scala index 58d4db53329..6ca8059179f 100644 --- a/applications/app/services/dotcomrendering/CrosswordsPicker.scala +++ b/applications/app/services/dotcomrendering/CrosswordsPicker.scala @@ -2,33 +2,25 @@ package services.dotcomrendering import common.GuLogging import crosswords.CrosswordPageWithContent +import experiments.{ActiveExperiments, DCRCrosswords} import model.Cors.RichRequestHeader import play.api.mvc.RequestHeader import utils.DotcomponentsLogger object CrosswordsPicker extends GuLogging { - /** Add to this function any logic for including/excluding a crossword page from being rendered with DCR - * - * Currently defaulting to false until we implement crosswords in DCR - */ - private def dcrCouldRender(crosswordPageWithContent: CrosswordPageWithContent): Boolean = { - false - } - def getTier( crosswordPageWithContent: CrosswordPageWithContent, )(implicit request: RequestHeader, ): RenderType = { - val participatingInTest = false // until we create a test for this content type - val dcrCanRender = dcrCouldRender(crosswordPageWithContent) + val participatingInTest = ActiveExperiments.isParticipating(DCRCrosswords) val tier = { if (request.forceDCROff) LocalRender else if (request.forceDCR) RemoteRender - else if (dcrCanRender && participatingInTest) RemoteRender + else if (participatingInTest) RemoteRender else LocalRender }