Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
ca66291
add scheduled validation lambda for ab testing expiry dates
cemms1 Dec 23, 2025
378254d
add policy to email lambda to allow sending emails, use existing emai…
cemms1 Dec 29, 2025
8660d09
separate prod rules from code
cemms1 Dec 29, 2025
dce71d2
force old AB test to ON status for testing
cemms1 Dec 29, 2025
a12bacc
install aws credentials providers
cemms1 Dec 29, 2025
2e86cf8
update test snapshot
cemms1 Dec 29, 2025
3e668ed
fix linting issue
cemms1 Dec 29, 2025
8032e8d
update email source to include name as well as email
cemms1 Dec 29, 2025
4a9b551
rework send email policy addition to notification lambda fn
cemms1 Dec 30, 2025
aa4087c
add basic monitoring to scheduled lambda
cemms1 Dec 30, 2025
ffb396d
reorganise email files, reduce complexity in index.ts, add fuller HTM…
cemms1 Dec 30, 2025
43ed649
tweak email table formatting
cemms1 Dec 30, 2025
a6a1a8a
move grouping logic to another file to keep handler small + use promi…
cemms1 Dec 30, 2025
80741ae
fix expiry checker function
cemms1 Dec 30, 2025
ad2aeed
add fake test
cemms1 Dec 30, 2025
7f34bae
add new verified email domain for use with ses
cemms1 Jan 5, 2026
0efc2b2
fix linting issues
cemms1 Jan 5, 2026
79ec5e6
provide name to send with email source
cemms1 Jan 5, 2026
426a6c9
add fake tests to test notify entire team
cemms1 Jan 5, 2026
1a9835c
refactor and improve readability + styling of email HTML
cemms1 Jan 5, 2026
40e01a4
add test for expiringTestsByOwner logic and tidy up
cemms1 Jan 5, 2026
c7ee12c
revert ab tests to version available in main branch
cemms1 Jan 5, 2026
3f705c7
improve display of plaintext version of email, make expiry time more …
cemms1 Jan 5, 2026
77c4e5f
update docs for running lambda locally
cemms1 Jan 6, 2026
b1a78f8
remove process.env.STAGE from local lambda code
cemms1 Jan 6, 2026
0656c46
simplify running lambda locally
cemms1 Jan 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 42 additions & 5 deletions .github/workflows/ab-testing-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
path: ab-testing/frontend/output/ab-tests.html
if-no-files-found: error

lambda-ci:
deploy-lambda-ci:
name: Lambda CI
runs-on: ubuntu-latest
defaults:
Expand All @@ -99,13 +99,42 @@ jobs:
- name: Save build
uses: actions/upload-artifact@v5
with:
name: ab-testing-lambda-build
name: ab-testing-deploy-lambda-build
path: ab-testing/deploy-lambda/dist/lambda.zip

notification-lambda-ci:
name: Notification Lambda CI
runs-on: ubuntu-latest
defaults:
run:
working-directory: ab-testing/notification-lambda
permissions:
contents: read
steps:
- uses: actions/checkout@v5

- name: Set up Node environment
uses: ./.github/actions/setup-node-env

- name: Build Lambda
run: pnpm build

- name: Zip app artifact
run: |
cd dist
zip -r lambda.zip .
zip -j lambda.zip ../package.json

- name: Save build
uses: actions/upload-artifact@v5
with:
name: ab-testing-notification-lambda-build
path: ab-testing/notification-lambda/dist/lambda.zip

riff-raff:
name: Riff-Raff Artifacts
runs-on: ubuntu-latest
needs: [config-ci, ui-ci, lambda-ci]
needs: [config-ci, ui-ci, deploy-lambda-ci, notification-lambda-ci]
permissions:
id-token: write
contents: read
Expand Down Expand Up @@ -136,12 +165,18 @@ jobs:
name: ui-build
path: ab-testing/frontend/output/ab-tests.html

- name: Fetch Lambda build
- name: Fetch Deploy Lambda build
uses: actions/[email protected]
with:
name: ab-testing-lambda-build
name: ab-testing-deploy-lambda-build
path: ab-testing/deploy-lambda/dist/lambda.zip

- name: Fetch Notification Lambda build
uses: actions/[email protected]
with:
name: ab-testing-notification-lambda-build
path: ab-testing/notification-lambda/dist/lambda.zip

- name: CDK Test
run: pnpm --filter @guardian/ab-testing-cdk test

Expand All @@ -160,6 +195,8 @@ jobs:
- ab-testing/config/dist
ab-testing-deployment-lambda:
- ab-testing/deploy-lambda/dist/lambda.zip
ab-testing-notification-lambda:
- ab-testing/notification-lambda/dist/lambda.zip
ab-testing-ui-artifact:
- ab-testing/frontend/output/ab-tests.html
cdk.out:
Expand Down
17 changes: 17 additions & 0 deletions ab-testing/cdk/bin/cdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import "source-map-support/register.js";
import { App } from "aws-cdk-lib";
import { AbTestingConfig } from "../lib/abTestingConfig.ts";
import { AbTestingDeploymentLambda } from "../lib/deploymentLambda.ts";
import { AbTestingNotificationLambda } from "../lib/notificationLambda.ts";
import { riffRaffYamlFile } from "../lib/riffRaffYamlFile.ts";

const app = new App();
Expand Down Expand Up @@ -41,6 +42,22 @@ new AbTestingConfig(app, "AbTestingConfigProd", {
},
});

new AbTestingNotificationLambda(app, "AbTestingNotificationLambdaCode", {
stack,
stage: "CODE",
env: {
region,
},
});

new AbTestingNotificationLambda(app, "AbTestingNotificationLambdaProd", {
stack,
stage: "PROD",
env: {
region,
},
});

const riffRaff = riffRaffYamlFile({ app, stack, region });

riffRaff.synth();
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
exports[`The ID5 Baton Lambda stack > matches the CODE snapshot 1`] = `
exports[`The AB testing deployment lambda stack > matches the CODE snapshot 1`] = `
{
"Metadata": {
"gu:cdk:constructs": [
Expand Down Expand Up @@ -320,7 +320,7 @@ exports[`The ID5 Baton Lambda stack > matches the CODE snapshot 1`] = `
}
`;

exports[`The ID5 Baton Lambda stack > matches the PROD snapshot 1`] = `
exports[`The AB testing deployment lambda stack > matches the PROD snapshot 1`] = `
{
"Metadata": {
"gu:cdk:constructs": [
Expand Down
Loading
Loading