From 158983cced9e6220ad73b1b1c3eb90fa6e123be0 Mon Sep 17 00:00:00 2001 From: Alina Boghiu Date: Wed, 7 Feb 2024 11:43:10 +0000 Subject: [PATCH] Exclude accessibility page from 1 percent test (#26887) --- .../app/services/TagFrontPicker.scala | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/applications/app/services/TagFrontPicker.scala b/applications/app/services/TagFrontPicker.scala index eb3b6c82ff1..e1938cfab96 100644 --- a/applications/app/services/TagFrontPicker.scala +++ b/applications/app/services/TagFrontPicker.scala @@ -1,16 +1,15 @@ 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, @@ -18,14 +17,25 @@ object TagFrontPicker extends GuLogging { 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,