Skip to content

Commit a3497bc

Browse files
Merge branch 'main' into mob/scrollable-products
2 parents d8ff3e6 + 44867ba commit a3497bc

File tree

14 files changed

+159
-364
lines changed

14 files changed

+159
-364
lines changed

.github/workflows/cicd.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ name: DCR CICD
22

33
on:
44
push:
5-
paths-ignore:
6-
- 'ab-testing/**'
7-
- '!ab-testing/config/abTests.ts'
85

96
jobs:
107
container:

ab-testing/cdk/lib/__snapshots__/abTestingConfig.test.ts.snap

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ exports[`The ID5 Baton Lambda stack > matches the CODE snapshot 1`] = `
44
"gu:cdk:constructs": [],
55
"gu:cdk:version": "62.0.1"
66
},
7+
"Parameters": {
8+
"BuildId": {
9+
"Type": "String",
10+
"Description": "The riff-raff build id, automatically generated and provided by riff-raff"
11+
}
12+
},
713
"Resources": {
814
"InvokeDictionaryDeployLambda": {
915
"Type": "Custom::FastlyEdgeDictionaryDeploy",
@@ -24,7 +30,10 @@ exports[`The ID5 Baton Lambda stack > matches the CODE snapshot 1`] = `
2430
]
2531
]
2632
},
27-
"ServiceTimeout": "300"
33+
"ServiceTimeout": "300",
34+
"BuildId": {
35+
"Ref": "BuildId"
36+
}
2837
},
2938
"UpdateReplacePolicy": "Delete",
3039
"DeletionPolicy": "Delete"
@@ -39,6 +48,12 @@ exports[`The ID5 Baton Lambda stack > matches the PROD snapshot 1`] = `
3948
"gu:cdk:constructs": [],
4049
"gu:cdk:version": "62.0.1"
4150
},
51+
"Parameters": {
52+
"BuildId": {
53+
"Type": "String",
54+
"Description": "The riff-raff build id, automatically generated and provided by riff-raff"
55+
}
56+
},
4257
"Resources": {
4358
"InvokeDictionaryDeployLambda": {
4459
"Type": "Custom::FastlyEdgeDictionaryDeploy",
@@ -59,7 +74,10 @@ exports[`The ID5 Baton Lambda stack > matches the PROD snapshot 1`] = `
5974
]
6075
]
6176
},
62-
"ServiceTimeout": "300"
77+
"ServiceTimeout": "300",
78+
"BuildId": {
79+
"Ref": "BuildId"
80+
}
6381
},
6482
"UpdateReplacePolicy": "Delete",
6583
"DeletionPolicy": "Delete"

ab-testing/cdk/lib/abTestingConfig.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { GuStackProps } from "@guardian/cdk/lib/constructs/core/stack.js";
22
import { GuStack } from "@guardian/cdk/lib/constructs/core/stack.js";
33
import type { App } from "aws-cdk-lib";
4-
import { CustomResource, Duration } from "aws-cdk-lib";
4+
import { CfnParameter, CustomResource, Duration } from "aws-cdk-lib";
55
import { Function } from "aws-cdk-lib/aws-lambda";
66
import { lambdaFunctionName } from "./deploymentLambda.ts";
77

@@ -15,11 +15,21 @@ export class AbTestingConfig extends GuStack {
1515
`${lambdaFunctionName}-${this.stage}`,
1616
);
1717

18+
const buildId = new CfnParameter(this, "BuildId", {
19+
type: "String",
20+
description:
21+
"The riff-raff build id, automatically generated and provided by riff-raff",
22+
});
23+
1824
// Trigger the Lambda to run upon deployment
1925
new CustomResource(this, "InvokeDictionaryDeployLambda", {
2026
serviceToken: lambda.functionArn,
2127
serviceTimeout: Duration.minutes(5),
2228
resourceType: "Custom::FastlyEdgeDictionaryDeploy",
29+
properties: {
30+
/** Ensures the custom resource is invoked on every deploy */
31+
BuildId: buildId.valueAsString,
32+
},
2333
});
2434
}
2535
}

ab-testing/config/scripts/validation/validExpiration.test.ts

Lines changed: 0 additions & 46 deletions
This file was deleted.

ab-testing/config/scripts/validation/validExpiration.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ export function allExpirationsValid(tests: ABTest[]): boolean {
66
const now = new Date();
77

88
if (expires < now) {
9-
throw new Error(
9+
console.warn(
1010
`${
1111
test.name
12-
} has an expiration date in the past: ${expires.toISOString()}, has it expired? If it doesn't belong to you or your team, you can set the status to OFF for now.`,
12+
} has an expiration date in the past: ${expires.toISOString()}, has it expired?`,
1313
);
1414
}
1515
});

dotcom-rendering/cdk/bin/cdk.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ new RenderingCDKStack(cdkApp, 'FaciaRendering-PROD', {
6868
stage: 'PROD',
6969
domainName: 'facia-rendering.guardianapis.com',
7070
scaling: {
71-
minimumInstances: 48,
72-
maximumInstances: 240,
71+
minimumInstances: 21,
72+
maximumInstances: 210,
7373
policies: {
7474
step: {
7575
cpu: cpuScalingSteps,

dotcom-rendering/src/client/sentryLoader/sentryLoader.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe('Enable Sentry when it passes loading conditions', () => {
3434
}),
3535
).toEqual(true);
3636
});
37-
it('does enable Sentry for 0.1% of users', () => {
37+
it('does enable Sentry for 1% of users', () => {
3838
expect(
3939
isSentryEnabled({
4040
isDev: false,
@@ -56,7 +56,7 @@ describe('Enable Sentry when it passes loading conditions', () => {
5656
isDev: false,
5757
enableSentryReporting: true,
5858
isInBrowserVariantTest: false,
59-
random: 99.9001 / 100,
59+
random: 99.0001 / 100,
6060
}),
6161
).toEqual(true);
6262
expect(

dotcom-rendering/src/client/sentryLoader/sentryLoader.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ const isSentryEnabled = ({
2424
if (isInBrowserVariantTest) return true;
2525
// Sentry lets you configure sampleRate to reduce the volume of events sent
2626
// but this filter only happens _after_ the library is loaded. The Guardian
27-
// measures page views in the billions so we only want to log 0.1% of errors that
27+
// measures page views in the billions so we only want to log 1% of errors that
2828
// happen but if we used sampleRate to do this we'd be needlessly downloading
29-
// Sentry 99.9% of the time. So instead we just do some math here and use that
29+
// Sentry 99% of the time. So instead we just do some math here and use that
3030
// to prevent the Sentry script from ever loading.
31-
if (random <= 999 / 1000) return false;
31+
if (random <= 99 / 100) return false;
3232
return true;
3333
};
3434

dotcom-rendering/src/components/Accordion.stories.tsx

Lines changed: 0 additions & 72 deletions
This file was deleted.

dotcom-rendering/src/components/Accordion.tsx

Lines changed: 0 additions & 100 deletions
This file was deleted.

0 commit comments

Comments
 (0)