Skip to content

Commit

Permalink
Rollout DCR video pages (behind switch) (#27149)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakeii authored May 16, 2024
1 parent 0ee270a commit fbd8dbd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
6 changes: 2 additions & 4 deletions applications/app/services/dotcomrendering/MediaPicker.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import model.Cors.RichRequestHeader
import model.{MediaPage, Video, Audio}
import play.api.mvc.RequestHeader
import utils.DotcomponentsLogger
import experiments.DCRVideoPages
import navigation.NavLinks.media
import experiments.ActiveExperiments
import conf.switches.Switches.DCRVideoPages

object MediaPicker extends GuLogging {

Expand Down Expand Up @@ -40,15 +40,13 @@ object MediaPicker extends GuLogging {
request: RequestHeader,
): RenderType = {

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

val tier = {
if (request.forceDCROff) LocalRender
else if (request.forceDCR) RemoteRender
else if (dcrCanRender && participatingInTest) RemoteRender
else if (dcrCanRender && DCRVideoPages.isSwitchedOn) RemoteRender
else LocalRender
}

Expand Down
11 changes: 11 additions & 0 deletions common/app/conf/switches/FeatureSwitches.scala
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,7 @@ trait FeatureSwitches {
sellByDate = Some(LocalDate.of(2024, 6, 5)),
exposeClientSide = true,
)

val DiscussionInApps = Switch(
SwitchGroup.Feature,
"discussion-in-apps",
Expand All @@ -513,4 +514,14 @@ trait FeatureSwitches {
sellByDate = Some(LocalDate.of(2024, 6, 5)),
exposeClientSide = true,
)

val DCRVideoPages = Switch(
SwitchGroup.Feature,
"dcr-video-pages",
"If this switch is on, we will render video pages with DCR",
owners = Seq(Owner.withEmail("[email protected]"), Owner.withEmail("[email protected]")),
safeState = Off,
sellByDate = never,
exposeClientSide = false,
)
}
13 changes: 0 additions & 13 deletions common/app/experiments/Experiments.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ object ActiveExperiments extends ExperimentsDefinition {
Set(
DarkModeWeb,
DCRTagPages,
DCRVideoPages,
UpdatedHeaderDesign,
MastheadWithHighlights,
AffiliateLinksDCR,
Expand Down Expand Up @@ -58,18 +57,6 @@ object AffiliateLinksDCR
participationGroup = Perc0E,
)

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 = Perc10A,
)

object DCRTagPages
extends Experiment(
name = "dcr-tag-pages",
Expand Down

0 comments on commit fbd8dbd

Please sign in to comment.