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

Create 0% test to use non-lite versions of fronts #27389

Merged
merged 4 commits into from
Aug 23, 2024
Merged

Create 0% test to use non-lite versions of fronts #27389

merged 4 commits into from
Aug 23, 2024

Conversation

domlander
Copy link
Contributor

@domlander domlander commented Aug 7, 2024

What is the value of this and can you measure success?

The first step towards removing the lite versions of pressed fronts, to free up memory

What does this change?

Introduces an experiment that will use the regular version of the pressed front as opposed to the lite version.

@domlander domlander marked this pull request as ready for review August 22, 2024 09:27
@domlander domlander requested a review from a team as a code owner August 22, 2024 09:27
@@ -135,11 +136,13 @@ trait FaciaController
FrontHeadline.headlineNotFound
}

val requestType = if (ActiveExperiments.isParticipating(RemoveLiteFronts)) liteRequestType else fullRequestType
Copy link
Contributor

@DanielCliftonGuardian DanielCliftonGuardian Aug 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we extract this to avoid repetition ?

@domlander domlander self-assigned this Aug 22, 2024
@domlander domlander added this to the Health milestone Aug 22, 2024
@@ -180,7 +183,9 @@ trait FaciaController
Cached(CacheTime.Facia)(JsonComponent.fromWritable(JsObject(Nil))),
)
} else {
frontJsonFapi.get(path, liteRequestType).map { resp =>
val requestType = if (ActiveExperiments.isParticipating(RemoveLiteFronts)) liteRequestType else fullRequestType
Copy link
Contributor

@ioannakok ioannakok Aug 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps I'm completely misreading this but shouldn't this be the other way around? If it participates in the test we request the full front otherwise we keep on requesting the lite version.

Suggested change
val requestType = if (ActiveExperiments.isParticipating(RemoveLiteFronts)) liteRequestType else fullRequestType
val requestType = if (ActiveExperiments.isParticipating(RemoveLiteFronts)) fullRequestType else liteRequestType

Same question for the other places where we make this check and +1 to @DanielCliftonGuardian's proposal to extract this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, I have it the wrong way around!

@@ -220,7 +225,10 @@ trait FaciaController

import PressedPage.pressedPageFormat
private[controllers] def renderFrontPressResult(path: String)(implicit request: RequestHeader): Future[Result] = {
val futureFaciaPage: Future[Option[(PressedPage, Boolean)]] = frontJsonFapi.get(path, liteRequestType).flatMap {
val requestType = if (ActiveExperiments.isParticipating(RemoveLiteFronts)) liteRequestType else fullRequestType
val NonAdFreeType = if (ActiveExperiments.isParticipating(RemoveLiteFronts)) LiteType else FullType
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
val NonAdFreeType = if (ActiveExperiments.isParticipating(RemoveLiteFronts)) LiteType else FullType
val NonAdFreeType = if (ActiveExperiments.isParticipating(RemoveLiteFronts)) FullType else LiteType

?

@@ -527,6 +530,8 @@ trait FaciaController
if (request.isAdFree) FullAdFreeType else FullType
def liteRequestType(implicit request: RequestHeader): PressedPageType =
if (request.isAdFree) LiteAdFreeType else LiteType
def requestType(implicit request: RequestHeader): PressedPageType =
if (ActiveExperiments.isParticipating(RemoveLiteFronts)) fullRequestType else fullRequestType
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (ActiveExperiments.isParticipating(RemoveLiteFronts)) fullRequestType else fullRequestType
if (ActiveExperiments.isParticipating(RemoveLiteFronts)) fullRequestType else liteRequestType

Copy link
Contributor

@ioannakok ioannakok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@domlander
Copy link
Contributor Author

Tested locally and on CODE

@prout-bot
Copy link
Collaborator

Seen on FRONTS-PROD, ADMIN-PROD (merged by @domlander 11 minutes and 30 seconds ago)

@domlander domlander changed the title Test using non-lite versions of fronts Create 0% test to use non-lite versions of fronts Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Facia: Decommission /lite.json endpoint & renderFrontJsonMinimal(), reduce memory consumption
4 participants