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

Fetch landing page config from dynamodb #6772

Draft
wants to merge 10 commits into
base: tf-lp-config
Choose a base branch
from
Draft

Conversation

tomrf1
Copy link
Member

@tomrf1 tomrf1 commented Feb 12, 2025

Previously we hardcoded the landing page tests config into the backend.
Now that we have a dynamodb table with this config, we can remove this.

This PR introduces the LandingPageTestService for polling and caching the dynamodb data.
It also adds a new alarm (based on a cloudwatch metric) to tell us when the server fails to fetch or parse a landing page test from Dynamodb. Note that even if only one test config is invalid, and the rest are successfully returned to the client, the alarm will still trigger.

Copy link
Contributor

github-actions bot commented Feb 12, 2025

Size Change: 0 B

Total Size: 1.91 MB

ℹ️ View Unchanged
Filename Size
./public/compiled-assets/javascripts/[countryGroupId]/events/router.js 90.6 kB
./public/compiled-assets/javascripts/[countryGroupId]/router.js 95 kB
./public/compiled-assets/javascripts/ausMomentMap.js 108 kB
./public/compiled-assets/javascripts/contributionsRedirectStyles.js 20 B
./public/compiled-assets/javascripts/digitalSubscriptionLandingPage.js 222 kB
./public/compiled-assets/javascripts/downForMaintenancePage.js 67.5 kB
./public/compiled-assets/javascripts/error404Page.js 67.5 kB
./public/compiled-assets/javascripts/error500Page.js 67.4 kB
./public/compiled-assets/javascripts/favicons.js 617 B
./public/compiled-assets/javascripts/paperSubscriptionCheckoutPage.js 164 kB
./public/compiled-assets/javascripts/paperSubscriptionLandingPage.js 87.9 kB
./public/compiled-assets/javascripts/payPalErrorPage.js 66 kB
./public/compiled-assets/javascripts/payPalErrorPageStyles.js 20 B
./public/compiled-assets/javascripts/promotionTerms.js 74 kB
./public/compiled-assets/javascripts/subscriptionsLandingPage.js 73.3 kB
./public/compiled-assets/javascripts/subscriptionsRedemptionPage.js 118 kB
./public/compiled-assets/javascripts/unsupportedBrowserStyles.js 20 B
./public/compiled-assets/javascripts/weeklySubscriptionCheckoutPage.js 160 kB
./public/compiled-assets/javascripts/weeklySubscriptionLandingPage.js 88.1 kB
./public/compiled-assets/webpack/114.js 12.2 kB
./public/compiled-assets/webpack/127.js 3.53 kB
./public/compiled-assets/webpack/136.js 2.17 kB
./public/compiled-assets/webpack/163.js 8.9 kB
./public/compiled-assets/webpack/187.js 20.5 kB
./public/compiled-assets/webpack/192.js 5.69 kB
./public/compiled-assets/webpack/276.js 4.39 kB
./public/compiled-assets/webpack/344.js 2 kB
./public/compiled-assets/webpack/445.js 6.94 kB
./public/compiled-assets/webpack/492.js 7.58 kB
./public/compiled-assets/webpack/643.js 22.4 kB
./public/compiled-assets/webpack/706.js 107 kB
./public/compiled-assets/webpack/847.js 26 kB
./public/compiled-assets/webpack/969.js 37.8 kB
./public/compiled-assets/webpack/checkout.js 17.2 kB
./public/compiled-assets/webpack/GuardianAdLiteLanding.js 8.26 kB
./public/compiled-assets/webpack/LandingPage.js 15.4 kB
./public/compiled-assets/webpack/oneTimeCheckout.js 6.07 kB
./public/compiled-assets/webpack/ThankYou.js 44.5 kB

compressed-size-action

}

object LandingPageTestService {
// Converts Dynamodb Attributes to Circe Json
Copy link
Member Author

Choose a reason for hiding this comment

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

@@ -53,43 +53,3 @@ object LandingPageTest {
implicit val encoder: Encoder[LandingPageTest] = deriveEncoder
implicit val decoder: Decoder[LandingPageTest] = deriveDecoder
}

// TODO - fetch config from dynamodb instead of hardcoding here
object LandingPageTestsProvider extends SettingsProvider[List[LandingPageTest]] {
Copy link
Member Author

Choose a reason for hiding this comment

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

there's still a hardcoded fallback in the client, in case something goes wrong

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant