Skip to content

Commit

Permalink
Exclude accessibility page from 1 percent test (#26887)
Browse files Browse the repository at this point in the history
  • Loading branch information
alinaboghiu authored Feb 7, 2024
1 parent bb0302f commit 158983c
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions applications/app/services/TagFrontPicker.scala
Original file line number Diff line number Diff line change
@@ -1,31 +1,41 @@
package services.dotcomrendering

import common.GuLogging
import experiments.{ActiveExperiments}
import implicits.Requests._
import play.api.mvc.RequestHeader
import services.IndexPage

object TagFrontPicker extends GuLogging {

def getTier(tagFront: IndexPage)(implicit request: RequestHeader): RenderType = {
def getTier(tagPage: IndexPage)(implicit request: RequestHeader): RenderType = {
lazy val participatingInTest = false // There's no room for a 0% test at the moment - so we're just going with false
lazy val dcrCouldRender = false
val checks = dcrChecks(tagPage)

val tier = decideTier(
request.isRss,
request.isJson,
request.forceDCROff,
request.forceDCR,
participatingInTest,
dcrCouldRender,
dcrCouldRender(checks),
)

logTier(tagFront, participatingInTest, dcrCouldRender, Map(), tier)
logTier(tagPage, participatingInTest, dcrCouldRender(checks), checks, tier)

tier
}

private def dcrCouldRender(checks: Map[String, Boolean]): Boolean = {
checks.values.forall(identity)
}

private def dcrChecks(tagPage: IndexPage): Map[String, Boolean] = {
Map(
// until we complete https://github.com/guardian/dotcom-rendering/issues/5755
("isNotAccessibilityPage", tagPage.page.metadata.id != "help/accessibility-help"),
)
}

private def decideTier(
isRss: Boolean,
isJson: Boolean,
Expand Down

0 comments on commit 158983c

Please sign in to comment.