Skip to content

Commit a64c4ff

Browse files
authored
Merge branch 'main' into ei/add-data-fronts-test-uuid
2 parents 3338d0c + 6509a9f commit a64c4ff

16 files changed

Lines changed: 3229 additions & 3921 deletions

.github/workflows/container-production.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
- name: Build image
4040
run: docker buildx build --platform linux/arm64 -f Production.dockerfile -t ${{ github.repository }}:latest .
4141
- name: Publish Image
42-
uses: guardian/actions-publish-image@v0.0.7
42+
uses: guardian/actions-publish-image@v0.0.8
4343
id: publish-image
4444
with:
4545
roleArn: ${{ secrets.GU_ARTIFACTS_ROLE_ARN }}

ab-testing/config/abTests.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,10 @@ const ABTests: ABTest[] = [
187187
name: "commercial-prebid-failsafe-timeout",
188188
description: "Gradually roll out the Prebid failsafe timeout feature",
189189
owners: ["commercial.dev@guardian.co.uk"],
190-
expirationDate: "2026-09-30",
190+
expirationDate: "2026-10-28",
191191
type: "client",
192192
status: "ON",
193-
audienceSize: 10 / 100,
193+
audienceSize: 0 / 100,
194194
audienceSpace: "B",
195195
groups: ["control", "variant"],
196196
shouldForceMetricsCollection: true,
@@ -239,7 +239,7 @@ const ABTests: ABTest[] = [
239239
expirationDate: "2026-10-28",
240240
type: "client",
241241
status: "ON",
242-
audienceSize: 0 / 100,
242+
audienceSize: 2.1 / 100, // 0.35% in each variant
243243
audienceSpace: "A",
244244
groups: [
245245
"variant-500",

dotcom-rendering/cdk/lib/__snapshots__/renderingStack.test.ts.snap

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,10 @@ exports[`The RenderingCDKStack matches the snapshot 1`] = `
288288
"Namespace": "AWS/EC2",
289289
"Period": 30,
290290
"Tags": [
291+
{
292+
"Key": "App",
293+
"Value": "article-rendering",
294+
},
291295
{
292296
"Key": "gu:cdk:version",
293297
"Value": "TEST",
@@ -345,6 +349,10 @@ exports[`The RenderingCDKStack matches the snapshot 1`] = `
345349
"CPUScalingAlertsTopic9D0083F7": {
346350
"Properties": {
347351
"Tags": [
352+
{
353+
"Key": "App",
354+
"Value": "article-rendering",
355+
},
348356
{
349357
"Key": "gu:cdk:version",
350358
"Value": "TEST",
@@ -677,6 +685,10 @@ exports[`The RenderingCDKStack matches the snapshot 1`] = `
677685
},
678686
],
679687
"Tags": [
688+
{
689+
"Key": "App",
690+
"Value": "article-rendering",
691+
},
680692
{
681693
"Key": "gu:cdk:version",
682694
"Value": "TEST",
@@ -835,6 +847,10 @@ exports[`The RenderingCDKStack matches the snapshot 1`] = `
835847
"Period": 30,
836848
"Statistic": "Average",
837849
"Tags": [
850+
{
851+
"Key": "App",
852+
"Value": "article-rendering",
853+
},
838854
{
839855
"Key": "gu:cdk:version",
840856
"Value": "TEST",
@@ -911,6 +927,10 @@ exports[`The RenderingCDKStack matches the snapshot 1`] = `
911927
"Period": 30,
912928
"Statistic": "Average",
913929
"Tags": [
930+
{
931+
"Key": "App",
932+
"Value": "article-rendering",
933+
},
914934
{
915935
"Key": "gu:cdk:version",
916936
"Value": "TEST",
@@ -967,6 +987,10 @@ exports[`The RenderingCDKStack matches the snapshot 1`] = `
967987
"LatencyScalingAlertsTopic1A322157": {
968988
"Properties": {
969989
"Tags": [
990+
{
991+
"Key": "App",
992+
"Value": "article-rendering",
993+
},
970994
{
971995
"Key": "gu:cdk:version",
972996
"Value": "TEST",
@@ -1238,6 +1262,7 @@ exports[`The RenderingCDKStack matches the snapshot 1`] = `
12381262
"Description": "The rendering base URL for frontend to call the article-rendering app in the PROD environment",
12391263
"Name": "/frontend/prod/article-rendering.baseURL",
12401264
"Tags": {
1265+
"App": "article-rendering",
12411266
"Stack": "frontend",
12421267
"Stage": "PROD",
12431268
"gu:cdk:version": "TEST",
@@ -1426,6 +1451,10 @@ exports[`The RenderingCDKStack matches the snapshot 1`] = `
14261451
"Period": 60,
14271452
"Statistic": "Maximum",
14281453
"Tags": [
1454+
{
1455+
"Key": "App",
1456+
"Value": "article-rendering",
1457+
},
14291458
{
14301459
"Key": "gu:cdk:version",
14311460
"Value": "TEST",
@@ -3308,6 +3337,7 @@ exports[`The RenderingCDKStack matches the snapshot for Tag Page Rendering CODE
33083337
"Description": "The rendering base URL for frontend to call the tag-page-rendering app in the CODE environment",
33093338
"Name": "/frontend/code/tag-page-rendering.baseURL",
33103339
"Tags": {
3340+
"App": "tag-page-rendering",
33113341
"Stack": "frontend",
33123342
"Stage": "CODE",
33133343
"gu:cdk:version": "TEST",
@@ -3982,6 +4012,10 @@ exports[`The RenderingCDKStack matches the snapshot for Tag Page Rendering PROD
39824012
"Namespace": "AWS/EC2",
39834013
"Period": 30,
39844014
"Tags": [
4015+
{
4016+
"Key": "App",
4017+
"Value": "tag-page-rendering",
4018+
},
39854019
{
39864020
"Key": "gu:cdk:version",
39874021
"Value": "TEST",
@@ -4039,6 +4073,10 @@ exports[`The RenderingCDKStack matches the snapshot for Tag Page Rendering PROD
40394073
"CPUScalingAlertsTopic9D0083F7": {
40404074
"Properties": {
40414075
"Tags": [
4076+
{
4077+
"Key": "App",
4078+
"Value": "tag-page-rendering",
4079+
},
40424080
{
40434081
"Key": "gu:cdk:version",
40444082
"Value": "TEST",
@@ -5039,6 +5077,10 @@ exports[`The RenderingCDKStack matches the snapshot for Tag Page Rendering PROD
50395077
},
50405078
],
50415079
"Tags": [
5080+
{
5081+
"Key": "App",
5082+
"Value": "tag-page-rendering",
5083+
},
50425084
{
50435085
"Key": "gu:cdk:version",
50445086
"Value": "TEST",
@@ -5218,6 +5260,10 @@ exports[`The RenderingCDKStack matches the snapshot for Tag Page Rendering PROD
52185260
"Period": 30,
52195261
"Statistic": "Average",
52205262
"Tags": [
5263+
{
5264+
"Key": "App",
5265+
"Value": "tag-page-rendering",
5266+
},
52215267
{
52225268
"Key": "gu:cdk:version",
52235269
"Value": "TEST",
@@ -5294,6 +5340,10 @@ exports[`The RenderingCDKStack matches the snapshot for Tag Page Rendering PROD
52945340
"Period": 30,
52955341
"Statistic": "Average",
52965342
"Tags": [
5343+
{
5344+
"Key": "App",
5345+
"Value": "tag-page-rendering",
5346+
},
52975347
{
52985348
"Key": "gu:cdk:version",
52995349
"Value": "TEST",
@@ -5350,6 +5400,10 @@ exports[`The RenderingCDKStack matches the snapshot for Tag Page Rendering PROD
53505400
"LatencyScalingAlertsTopic1A322157": {
53515401
"Properties": {
53525402
"Tags": [
5403+
{
5404+
"Key": "App",
5405+
"Value": "tag-page-rendering",
5406+
},
53535407
{
53545408
"Key": "gu:cdk:version",
53555409
"Value": "TEST",
@@ -5758,6 +5812,7 @@ exports[`The RenderingCDKStack matches the snapshot for Tag Page Rendering PROD
57585812
"Description": "The rendering base URL for frontend to call the tag-page-rendering app in the PROD environment",
57595813
"Name": "/frontend/prod/tag-page-rendering.baseURL",
57605814
"Tags": {
5815+
"App": "tag-page-rendering",
57615816
"Stack": "frontend",
57625817
"Stage": "PROD",
57635818
"gu:cdk:version": "TEST",
@@ -5995,6 +6050,10 @@ exports[`The RenderingCDKStack matches the snapshot for Tag Page Rendering PROD
59956050
"Period": 60,
59966051
"Statistic": "Maximum",
59976052
"Tags": [
6053+
{
6054+
"Key": "App",
6055+
"Value": "tag-page-rendering",
6056+
},
59986057
{
59996058
"Key": "gu:cdk:version",
60006059
"Value": "TEST",

dotcom-rendering/cdk/lib/renderingStack.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,17 +205,19 @@ const addLatencyStepScalingPolicy = (
205205
/** DCR infrastructure provisioning via CDK */
206206
export class RenderingCDKStack extends CDKStack {
207207
constructor(scope: CDKApp, id: string, props: RenderingCDKStackProps) {
208+
const { guApp, stage, instanceType, scaling, domainName, ecsProps } =
209+
props;
210+
208211
super(scope, id, {
209-
...props,
210212
// Any version of this app should run in the eu-west-1 region
211213
env: { region: 'eu-west-1' },
212214
// Set the stack within the constructor as this won't vary between apps
213215
stack: 'frontend',
216+
stage,
217+
app: guApp,
214218
});
215219

216220
const { stack: guStack, region, account } = this;
217-
const { guApp, stage, instanceType, scaling, domainName, ecsProps } =
218-
props;
219221

220222
const artifactsBucket =
221223
GuDistributionBucketParameter.getInstance(this).valueAsString;

dotcom-rendering/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"@guardian/browserslist-config": "6.1.0",
3434
"@guardian/cdk": "catalog:",
3535
"@guardian/commercial-core": "35.1.0",
36-
"@guardian/consent-manager": "2.1.0",
36+
"@guardian/consent-manager": "2.1.1",
3737
"@guardian/core-web-vitals": "7.0.0",
3838
"@guardian/eslint-config": "catalog:",
3939
"@guardian/identity-auth": "6.0.1",

dotcom-rendering/src/components/Button/ProductLinkButton.stories.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,9 @@ export const WithLongLabel = {
3434
label: '£10.99 for a 5 x 5 x 50cm sheet at Amazon',
3535
},
3636
} satisfies Story;
37+
38+
export const WithStruckThroughLabel = {
39+
args: {
40+
label: '~£10~ £5 at Amazon',
41+
},
42+
} satisfies Story;

dotcom-rendering/src/components/Button/ProductLinkButton.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ import type {
77
import { LinkButton } from '@guardian/source/react-components';
88
import { SKIMLINK_REL } from '../../lib/affiliateLinksUtils';
99
import { palette } from '../../palette';
10+
import {
11+
createAccessibleProductLabel,
12+
createStrikeThroughProductLabel,
13+
} from './productUtils';
1014
import { heightAutoStyle, wrapButtonTextStyle } from './styles';
1115
import { getPropsForLinkUrl } from './utils';
1216

@@ -37,6 +41,12 @@ const minimisePaddingStyle = css`
3741
}
3842
`;
3943

44+
const strikeThroughStyle = css`
45+
s {
46+
font-weight: normal;
47+
}
48+
`;
49+
4050
export const theme: Partial<ThemeButton> = {
4151
backgroundPrimary: palette('--product-button-primary-background'),
4252
backgroundPrimaryHover: palette(
@@ -67,7 +77,7 @@ export const ProductLinkButton = ({
6777

6878
return (
6979
<LinkButton
70-
{...getPropsForLinkUrl(label)}
80+
{...getPropsForLinkUrl(createAccessibleProductLabel(label))}
7181
href={url}
7282
rel={SKIMLINK_REL}
7383
priority={priority}
@@ -82,9 +92,9 @@ export const ProductLinkButton = ({
8292
>
8393
<span
8494
style={fullWidthText ? { width: '100%' } : {}}
85-
css={wrapButtonTextStyle}
95+
css={[wrapButtonTextStyle, strikeThroughStyle]}
8696
>
87-
{label}
97+
{createStrikeThroughProductLabel(label)}
8898
</span>
8999
</LinkButton>
90100
);
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import { render } from '@testing-library/react';
2+
import {
3+
createAccessibleProductLabel,
4+
createStrikeThroughProductLabel,
5+
} from './productUtils';
6+
7+
describe('createStrikeThroughProductLabel', () => {
8+
it('returns the label unchanged when there is no struck-through text', () => {
9+
const { container } = render(
10+
<>{createStrikeThroughProductLabel('£5 at Shop')}</>,
11+
);
12+
13+
expect(container.textContent).toBe('£5 at Shop');
14+
expect(container.querySelector('s')).toBeNull();
15+
});
16+
17+
it('renders the old price in an s element and preserves the rest', () => {
18+
const { container } = render(
19+
<>{createStrikeThroughProductLabel('~£10~ £5 at Shop')}</>,
20+
);
21+
22+
expect(container.querySelector('s')).toHaveTextContent('£10');
23+
expect(container.textContent).toBe('£10 £5 at Shop');
24+
});
25+
});
26+
27+
describe('createAccessibleProductLabel', () => {
28+
it('returns the label unchanged when there is no struck-through text', () => {
29+
expect(createAccessibleProductLabel('£5 at Shop')).toBe('£5 at Shop');
30+
});
31+
32+
it('describes the old and new prices accessibly', () => {
33+
expect(createAccessibleProductLabel('~£10~ £5 at Shop')).toBe(
34+
'Was £10, now £5 at Shop',
35+
);
36+
});
37+
});

0 commit comments

Comments
 (0)