Skip to content

Commit a4ce1d7

Browse files
merge main
2 parents bc1c9bc + f4af771 commit a4ce1d7

File tree

59 files changed

+4275
-539
lines changed

Some content is hidden

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

59 files changed

+4275
-539
lines changed

.github/workflows/ab-testing-ci.yml

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
path: ab-testing/frontend/output/ab-tests.html
7474
if-no-files-found: error
7575

76-
lambda-ci:
76+
deploy-lambda-ci:
7777
name: Lambda CI
7878
runs-on: ubuntu-latest
7979
defaults:
@@ -99,13 +99,42 @@ jobs:
9999
- name: Save build
100100
uses: actions/upload-artifact@v5
101101
with:
102-
name: ab-testing-lambda-build
102+
name: ab-testing-deploy-lambda-build
103103
path: ab-testing/deploy-lambda/dist/lambda.zip
104104

105+
notification-lambda-ci:
106+
name: Notification Lambda CI
107+
runs-on: ubuntu-latest
108+
defaults:
109+
run:
110+
working-directory: ab-testing/notification-lambda
111+
permissions:
112+
contents: read
113+
steps:
114+
- uses: actions/checkout@v5
115+
116+
- name: Set up Node environment
117+
uses: ./.github/actions/setup-node-env
118+
119+
- name: Build Lambda
120+
run: pnpm build
121+
122+
- name: Zip app artifact
123+
run: |
124+
cd dist
125+
zip -r lambda.zip .
126+
zip -j lambda.zip ../package.json
127+
128+
- name: Save build
129+
uses: actions/upload-artifact@v5
130+
with:
131+
name: ab-testing-notification-lambda-build
132+
path: ab-testing/notification-lambda/dist/lambda.zip
133+
105134
riff-raff:
106135
name: Riff-Raff Artifacts
107136
runs-on: ubuntu-latest
108-
needs: [config-ci, ui-ci, lambda-ci]
137+
needs: [config-ci, ui-ci, deploy-lambda-ci, notification-lambda-ci]
109138
permissions:
110139
id-token: write
111140
contents: read
@@ -136,12 +165,18 @@ jobs:
136165
name: ui-build
137166
path: ab-testing/frontend/output/ab-tests.html
138167

139-
- name: Fetch Lambda build
168+
- name: Fetch Deploy Lambda build
140169
uses: actions/[email protected]
141170
with:
142-
name: ab-testing-lambda-build
171+
name: ab-testing-deploy-lambda-build
143172
path: ab-testing/deploy-lambda/dist/lambda.zip
144173

174+
- name: Fetch Notification Lambda build
175+
uses: actions/[email protected]
176+
with:
177+
name: ab-testing-notification-lambda-build
178+
path: ab-testing/notification-lambda/dist/lambda.zip
179+
145180
- name: CDK Test
146181
run: pnpm --filter @guardian/ab-testing-cdk test
147182

@@ -160,6 +195,8 @@ jobs:
160195
- ab-testing/config/dist
161196
ab-testing-deployment-lambda:
162197
- ab-testing/deploy-lambda/dist/lambda.zip
198+
ab-testing-notification-lambda:
199+
- ab-testing/notification-lambda/dist/lambda.zip
163200
ab-testing-ui-artifact:
164201
- ab-testing/frontend/output/ab-tests.html
165202
cdk.out:

ab-testing/cdk/bin/cdk.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import "source-map-support/register.js";
22
import { App } from "aws-cdk-lib";
33
import { AbTestingConfig } from "../lib/abTestingConfig.ts";
44
import { AbTestingDeploymentLambda } from "../lib/deploymentLambda.ts";
5+
import { AbTestingNotificationLambda } from "../lib/notificationLambda.ts";
56
import { riffRaffYamlFile } from "../lib/riffRaffYamlFile.ts";
67

78
const app = new App();
@@ -41,6 +42,22 @@ new AbTestingConfig(app, "AbTestingConfigProd", {
4142
},
4243
});
4344

45+
new AbTestingNotificationLambda(app, "AbTestingNotificationLambdaCode", {
46+
stack,
47+
stage: "CODE",
48+
env: {
49+
region,
50+
},
51+
});
52+
53+
new AbTestingNotificationLambda(app, "AbTestingNotificationLambdaProd", {
54+
stack,
55+
stage: "PROD",
56+
env: {
57+
region,
58+
},
59+
});
60+
4461
const riffRaff = riffRaffYamlFile({ app, stack, region });
4562

4663
riffRaff.synth();

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
exports[`The ID5 Baton Lambda stack > matches the CODE snapshot 1`] = `
1+
exports[`The AB testing deployment lambda stack > matches the CODE snapshot 1`] = `
22
{
33
"Metadata": {
44
"gu:cdk:constructs": [
@@ -320,7 +320,7 @@ exports[`The ID5 Baton Lambda stack > matches the CODE snapshot 1`] = `
320320
}
321321
`;
322322

323-
exports[`The ID5 Baton Lambda stack > matches the PROD snapshot 1`] = `
323+
exports[`The AB testing deployment lambda stack > matches the PROD snapshot 1`] = `
324324
{
325325
"Metadata": {
326326
"gu:cdk:constructs": [

0 commit comments

Comments
 (0)