Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a 0% test for crosswords in DCR #27706

Merged
merged 2 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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("dotcom.platform@theguardian.com")),
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 = 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,
)
Loading