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 serverside AB test for DCR video pages #27089

Merged
merged 1 commit into from
Apr 30, 2024
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
13 changes: 10 additions & 3 deletions applications/app/services/dotcomrendering/MediaPicker.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ package services.dotcomrendering

import common.GuLogging
import model.Cors.RichRequestHeader
import model.MediaPage
import model.{MediaPage, Video, Audio}
import play.api.mvc.RequestHeader
import utils.DotcomponentsLogger
import experiments.DCRVideoPages
import navigation.NavLinks.media
import experiments.ActiveExperiments

object MediaPicker extends GuLogging {

Expand All @@ -17,7 +20,11 @@ object MediaPicker extends GuLogging {
*
* */
private def dcrCouldRender(mediaPage: MediaPage): Boolean = {
false
mediaPage.media match {
case Video(content, source, mediaAtom) => true
case Audio(content) => false
case _ => false
}
}

def getTier(
Expand All @@ -27,7 +34,7 @@ object MediaPicker extends GuLogging {
): RenderType = {

// defaulting to false until we are ready to release and create a 0% test
val participatingInTest = false // ActiveExperiments.isParticipating(DCRMedia)
val participatingInTest = ActiveExperiments.isParticipating(DCRVideoPages)
val dcrCanRender = dcrCouldRender(mediaPage)

val tier = {
Expand Down
13 changes: 13 additions & 0 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(
CommercialMegaTest,
DCRTagPages,
DCRVideoPages,
UpdatedHeaderDesign,
MastheadWithHighlights,
)
Expand All @@ -37,6 +38,18 @@ object DCRTagPages
participationGroup = Perc20A,
)

object DCRVideoPages
extends Experiment(
name = "dcr-video-pages",
description = "Render video pages with DCR",
owners = Seq(
Owner.withGithub("[email protected]"),
Owner.withGithub("[email protected]"),
),
sellByDate = LocalDate.of(2024, 5, 30),
participationGroup = Perc0A,
)

object UpdatedHeaderDesign
extends Experiment(
name = "updated-header-design",
Expand Down
Loading