Skip to content

Commit

Permalink
Merge pull request #27706 from guardian/e2e/dcr-crosswords-ab
Browse files Browse the repository at this point in the history
Add a 0% test for crosswords in DCR
  • Loading branch information
oliverabrahams authored Jan 14, 2025
2 parents ad634ee + a6b6bdb commit 85fd861
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
14 changes: 3 additions & 11 deletions applications/app/services/dotcomrendering/CrosswordsPicker.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
28 changes: 19 additions & 9 deletions common/app/experiments/Experiments.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ object ActiveExperiments extends ExperimentsDefinition {
Set(
EuropeBetaFront,
CommercialBundleUpdater,
DCRCrosswords,
DarkModeWeb,
)
implicit val canCheckExperiment: CanCheckExperiment = new CanCheckExperiment(this)
Expand All @@ -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("[email protected]")),
sellByDate = LocalDate.of(2025, 1, 30),
participationGroup = Perc0D,
)

object CommercialBundleUpdater
extends Experiment(
name = "commercial-bundle-updater",
Expand All @@ -48,3 +40,21 @@ object CommercialBundleUpdater
sellByDate = LocalDate.of(2025, 1, 30),
participationGroup = Perc20A,
)

object DCRCrosswords
extends Experiment(
name = "dcr-crosswords",
description = "Render crosswords in DCR",
owners = Seq(Owner.withEmail("[email protected]")),
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("[email protected]")),
sellByDate = LocalDate.of(2025, 1, 30),
participationGroup = Perc0D,
)

0 comments on commit 85fd861

Please sign in to comment.