Skip to content

Commit

Permalink
Merge pull request #26590 from guardian/remove-europe-experiment
Browse files Browse the repository at this point in the history
Remove Europe experiment
  • Loading branch information
rowannekabalan authored Sep 21, 2023
2 parents 6715b86 + b78f253 commit f646239
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 22 deletions.
13 changes: 5 additions & 8 deletions common/app/common/Edition.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import java.util.Locale
import org.joda.time.DateTimeZone
import play.api.libs.json._
import play.api.mvc.RequestHeader
import experiments.{ActiveExperiments, EuropeNetworkFront}
import experiments.ActiveExperiments

import java.time.ZoneId

Expand Down Expand Up @@ -49,9 +49,7 @@ object Edition {

lazy val defaultEdition: Edition = editions.Uk
def editionsByRequest(implicit request: RequestHeader): List[Edition] = {
val participatingInTest =
ActiveExperiments.isParticipating(EuropeNetworkFront) || EuropeNetworkFrontSwitch.isSwitchedOn
if (!participatingInTest) all else allWithBetaEditions
if (!EuropeNetworkFrontSwitch.isSwitchedOn) all else allWithBetaEditions
}
def editionsSupportingSection(sectionId: String): Seq[Edition] =
allWithBetaEditions.filter(_.isEditionalised(sectionId))
Expand Down Expand Up @@ -82,16 +80,15 @@ object Edition {
// in production no cookies make it this far
val editionFromCookie = request.cookies.get("GU_EDITION").map(_.value)

val participatingInTest =
ActiveExperiments.isParticipating(EuropeNetworkFront)(request) || EuropeNetworkFrontSwitch.isSwitchedOn

editionFromParameter
.orElse(editionFromHeader)
.orElse(editionFromCookie)
// Fastly does not have switch information so we will always try and set the edition to Europe
// if a user is in CoE and then fallback to INT edition in Frontend if that user is not part of the experiment.
.map(edition =>
if (edition.equalsIgnoreCase(editions.Europe.id) && !participatingInTest) editions.International.id else edition,
if (edition.equalsIgnoreCase(editions.Europe.id) && !EuropeNetworkFrontSwitch.isSwitchedOn)
editions.International.id
else edition,
)
.getOrElse(defaultEdition.id)
}
Expand Down
10 changes: 0 additions & 10 deletions common/app/experiments/Experiments.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ object ActiveExperiments extends ExperimentsDefinition {
FrontsBannerAdsDcr,
Lightbox,
ServerSideLiveblogInlineAds,
EuropeNetworkFront,
OphanEsm,
SectionFrontsBannerAds,
HeaderTopBarSearchCapi,
Expand Down Expand Up @@ -43,15 +42,6 @@ object Lightbox
participationGroup = Perc0B,
)

object EuropeNetworkFront
extends Experiment(
name = "europe-network-front",
description = "Test new europe network front",
owners = Seq(Owner.withGithub("rowannekabalan")),
sellByDate = LocalDate.of(2023, 9, 29),
participationGroup = Perc0D,
)

object FrontsBannerAdsDcr
extends Experiment(
name = "fronts-banner-ads-dcr",
Expand Down
6 changes: 2 additions & 4 deletions facia/app/controllers/FaciaController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import contentapi.ContentApiClient
import play.api.libs.ws.WSClient
import renderers.DotcomRenderingService
import model.dotcomrendering.{DotcomFrontsRenderingDataModel, PageType}
import experiments.{ActiveExperiments, DeeplyRead, EuropeNetworkFront}
import experiments.{ActiveExperiments, DeeplyRead}
import play.api.http.ContentTypes.JSON
import http.HttpPreconnections
import services.dotcomrendering.{FaciaPicker, RemoteRender}
Expand Down Expand Up @@ -206,9 +206,7 @@ trait FaciaController

import PressedPage.pressedPageFormat
private[controllers] def renderFrontPressResult(path: String)(implicit request: RequestHeader): Future[Result] = {
val participatingInTest =
ActiveExperiments.isParticipating(EuropeNetworkFront) || EuropeNetworkFrontSwitch.isSwitchedOn
if (path == "europe" && !participatingInTest) {
if (path == "europe" && !EuropeNetworkFrontSwitch.isSwitchedOn) {
return successful(Cached(CacheTime.NotFound)(WithoutRevalidationResult(NotFound)))
}
val futureFaciaPage: Future[Option[(PressedPage, Boolean)]] = frontJsonFapi.get(path, liteRequestType).flatMap {
Expand Down

0 comments on commit f646239

Please sign in to comment.