Skip to content

Commit 9b44efb

Browse files
authored
Merge pull request #19946 from mozilla/pay-3436-glean-server-churn
feat(next): add churn intervention glean events
2 parents eda3ead + 9fe2b01 commit 9b44efb

52 files changed

Lines changed: 2173 additions & 591 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.circleci/config.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ executors:
8080
# step, and the saving the initial a workspace state.
8181
build-executor:
8282
docker:
83-
- image: mozilla/fxa-circleci:ci-builder-v5
83+
- image: mozilla/fxa-circleci:ci-builder-v6
8484
environment:
8585
NODE_ENV: development
8686
FIRESTORE_EMULATOR_HOST: localhost:9090
@@ -96,7 +96,7 @@ executors:
9696
default: medium
9797
resource_class: << parameters.resource_class >>
9898
docker:
99-
- image: mozilla/fxa-circleci:ci-test-runner-v5
99+
- image: mozilla/fxa-circleci:ci-test-runner-v6
100100
environment:
101101
NODE_ENV: development
102102
FIRESTORE_EMULATOR_HOST: localhost:9090
@@ -112,7 +112,7 @@ executors:
112112
default: large
113113
resource_class: << parameters.resource_class >>
114114
docker:
115-
- image: mozilla/fxa-circleci:ci-test-runner-v5
115+
- image: mozilla/fxa-circleci:ci-test-runner-v6
116116
- image: cimg/mysql:8.0
117117
command: --default-authentication-plugin=mysql_native_password
118118
- image: jdlk7/firestore-emulator
@@ -135,7 +135,7 @@ executors:
135135
default: xlarge
136136
resource_class: << parameters.resource_class >>
137137
docker:
138-
- image: mozilla/fxa-circleci:ci-functional-test-runner-v5
138+
- image: mozilla/fxa-circleci:ci-functional-test-runner-v6
139139
- image: redis
140140
- image: pafortin/goaws
141141
- image: cimg/mysql:8.0
@@ -186,7 +186,7 @@ executors:
186186
default: xlarge
187187
resource_class: << parameters.resource_class >>
188188
docker:
189-
- image: mozilla/fxa-circleci:ci-functional-test-runner-v5
189+
- image: mozilla/fxa-circleci:ci-functional-test-runner-v6
190190
environment:
191191
NODE_ENV: development
192192
CUSTOMS_SERVER_URL: none
@@ -514,7 +514,7 @@ commands:
514514
docker build . \
515515
-f ./project/_dev/docker/ci/Dockerfile \
516516
--target << parameters.target >> \
517-
-t mozilla/fxa-circleci:ci-<< parameters.target >>-v5
517+
-t mozilla/fxa-circleci:ci-<< parameters.target >>-v6
518518
519519
create-fxa-ci-images:
520520
# Build CI images. Images are built on top of each other. Each is optimized for a specific task.
@@ -543,10 +543,10 @@ commands:
543543
name: Push CI Images and Extract Yarn Cache
544544
command: |
545545
docker login -u $DOCKER_USER_fxa_circleci -p $DOCKER_PASS_fxa_circleci
546-
.circleci/docker-copy-cache.sh mozilla/fxa-circleci:ci-builder-v5
547-
docker push mozilla/fxa-circleci:ci-test-runner-v5
548-
docker push mozilla/fxa-circleci:ci-functional-test-runner-v5
549-
docker push mozilla/fxa-circleci:ci-builder-v5
546+
.circleci/docker-copy-cache.sh mozilla/fxa-circleci:ci-builder-v6
547+
docker push mozilla/fxa-circleci:ci-test-runner-v6
548+
docker push mozilla/fxa-circleci:ci-functional-test-runner-v6
549+
docker push mozilla/fxa-circleci:ci-builder-v6
550550
wait
551551
552552
upload_to_gcs:

_dev/docker/ci/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ RUN npx playwright install --with-deps firefox chromium webkit;
3838
# Runs functional tests in our CI. Needs minimal install. Assumes
3939
# workspace will be restored into the project folder.
4040
FROM cimg/node:22.15.1-browsers AS functional-test-runner
41+
RUN sudo apt-get update && sudo apt-get install -y \
42+
python3-venv
4143
WORKDIR /home/circleci
4244
COPY --chown=circleci:circleci --from=playwright-install /home/circleci/.cache/ms-playwright .cache/ms-playwright/
4345
COPY --chown=circleci:circleci project project

apps/payments/next/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ CURRENCY_CONFIG__CURRENCIES_TO_COUNTRIES={"USD":["AS","CA","GB","GU","MP","MY","
9494

9595
# Churn Intervention Config
9696
CHURN_INTERVENTION_CONFIG__COLLECTION_NAME=churnInterventions
97-
CHURN_INTERVENTION_CONFIG__ENABLED=false
97+
CHURN_INTERVENTION_CONFIG__ENABLED=
9898

9999
# StatsD Config
100100
STATS_D_CONFIG__SAMPLE_RATE=

apps/payments/next/app/[locale]/subscriptions/[subscriptionId]/offer/error/page.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,16 @@ export default async function InterstitialOfferErrorPage({
4040
const uid = session.user.id;
4141

4242
let interstitialOfferContent;
43-
try {
43+
try {
4444
interstitialOfferContent = await getInterstitialOfferContentAction(
45-
uid,
46-
subscriptionId,
47-
acceptLanguage,
48-
locale
45+
uid,
46+
subscriptionId,
47+
acceptLanguage,
48+
locale
4949
);
50-
} catch (error) {
50+
} catch (error) {
5151
notFound();
52-
}
52+
}
5353

5454
if (!interstitialOfferContent) {
5555
notFound();
@@ -59,7 +59,7 @@ export default async function InterstitialOfferErrorPage({
5959
redirect(`/${locale}/subscriptions/${subscriptionId}/offer`);
6060
}
6161

62-
const { webIcon, productName} = interstitialOfferContent;
62+
const { webIcon, productName } = interstitialOfferContent;
6363
const reason = interstitialOfferContent.reason ?? 'general_error';
6464

6565
if (webIcon && !productName) {

apps/payments/next/app/[locale]/subscriptions/[subscriptionId]/offer/page.tsx

Lines changed: 45 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -94,56 +94,58 @@ export default async function InterstitialOfferPage({
9494

9595
const { ftlId, fallbackText } = getKeepCurrentSubscriptionFtlIds(currentInterval);
9696
const keepCurrentSubscriptionButtonText = l10n.getString(ftlId, fallbackText);
97+
const searchParamsObj = new URLSearchParams(searchParams);
98+
searchParamsObj.append('entrypoint', 'subscription-management');
9799

98100
return (
99101
<section
100102
className="flex justify-center min-h-[calc(100vh_-_4rem)] tablet:items-center tablet:min-h-[calc(100vh_-_5rem)]"
101103
>
102-
<div className="w-full max-w-[480px] flex flex-col justify-center items-center p-10 tablet:bg-white tablet:rounded-xl tablet:border tablet:border-grey-200 tablet:shadow-[0_0_16px_0_rgba(0,0,0,0.08)]">
103-
<div className="w-full flex flex-col items-center gap-6 text-center">
104-
<Image
105-
src={webIcon}
106-
alt={productName}
107-
height={64}
108-
width={64}
109-
/>
110-
<h1 className="font-bold self-stretch text-center font-header text-xl leading-8 ">
111-
{modalHeading1}
112-
</h1>
113-
</div>
114-
<p className="w-full self-stretch leading-7 text-lg text-grey-900">
115-
{modalMessage &&
116-
modalMessage.map((line, i) => (
117-
<p className="my-2" key={i}>
118-
{line}
119-
</p>
120-
))}
121-
</p>
104+
<div className="w-full max-w-[480px] flex flex-col justify-center items-center p-10 tablet:bg-white tablet:rounded-xl tablet:border tablet:border-grey-200 tablet:shadow-[0_0_16px_0_rgba(0,0,0,0.08)]">
105+
<div className="w-full flex flex-col items-center gap-6 text-center">
106+
<Image
107+
src={webIcon}
108+
alt={productName}
109+
height={64}
110+
width={64}
111+
/>
112+
<h1 className="font-bold self-stretch text-center font-header text-xl leading-8 ">
113+
{modalHeading1}
114+
</h1>
115+
</div>
116+
<p className="w-full self-stretch leading-7 text-lg text-grey-900">
117+
{modalMessage &&
118+
modalMessage.map((line, i) => (
119+
<p className="my-2" key={i}>
120+
{line}
121+
</p>
122+
))}
123+
</p>
122124

123-
<div className="w-full flex flex-col gap-3 mt-12">
124-
<Link
125-
className="border box-border font-header h-14 items-center justify-center rounded-md text-white text-center font-bold py-4 px-6 bg-blue-500 hover:bg-blue-700 flex w-full"
126-
href={upgradeButtonUrl}
127-
>
128-
{upgradeButtonLabel}
129-
</Link>
130-
<Link
131-
className="border box-border font-header h-14 items-center justify-center rounded-md text-center font-bold py-4 px-6 bg-grey-10 border-grey-200 hover:bg-grey-50 flex w-full"
132-
href={`/${locale}/subscriptions/landing`}
133-
>
134-
<span>{keepCurrentSubscriptionButtonText}</span>
135-
</Link>
136-
<Link
137-
className="border box-border font-header h-14 items-center justify-center rounded-md text-center font-bold py-4 px-6 bg-grey-10 border-grey-200 hover:bg-grey-50 flex w-full"
138-
href={`/${locale}/subscriptions/${subscriptionId}/cancel`}
139-
>
140-
<span>{l10n.getString(
141-
'interstitial-offer-button-cancel-subscription',
142-
'Continue to cancel'
143-
)}</span>
144-
</Link>
145-
</div>
125+
<div className="w-full flex flex-col gap-3 mt-12">
126+
<Link
127+
className="border box-border font-header h-14 items-center justify-center rounded-md text-white text-center font-bold py-4 px-6 bg-blue-500 hover:bg-blue-700 flex w-full"
128+
href={`${upgradeButtonUrl}?${searchParamsObj.toString()}`}
129+
>
130+
{upgradeButtonLabel}
131+
</Link>
132+
<Link
133+
className="border box-border font-header h-14 items-center justify-center rounded-md text-center font-bold py-4 px-6 bg-grey-10 border-grey-200 hover:bg-grey-50 flex w-full"
134+
href={`/${locale}/subscriptions/landing`}
135+
>
136+
<span>{keepCurrentSubscriptionButtonText}</span>
137+
</Link>
138+
<Link
139+
className="border box-border font-header h-14 items-center justify-center rounded-md text-center font-bold py-4 px-6 bg-grey-10 border-grey-200 hover:bg-grey-50 flex w-full"
140+
href={`/${locale}/subscriptions/${subscriptionId}/cancel`}
141+
>
142+
<span>{l10n.getString(
143+
'interstitial-offer-button-cancel-subscription',
144+
'Continue to cancel'
145+
)}</span>
146+
</Link>
146147
</div>
148+
</div>
147149
</section>
148150
);
149151
}

0 commit comments

Comments
 (0)