Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
120cd9b
fix wonky rebase
Jakeii Nov 17, 2025
8661b68
fix lint
Jakeii Nov 17, 2025
c26e301
fastly secrets
Jakeii Nov 17, 2025
74d0107
missing cdk
Jakeii Nov 17, 2025
6210367
build artifact download
Jakeii Nov 17, 2025
18755d3
cacheControl required
Jakeii Nov 17, 2025
e883016
more riff-raff tweaks
Jakeii Nov 17, 2025
8341e1a
fastly params are secure strings
Jakeii Nov 18, 2025
96b3493
need to read params directly from SSM
Jakeii Nov 18, 2025
1b3e319
refactor fastly client into class based api
Jakeii Nov 18, 2025
5828aca
read config from ssm
Jakeii Nov 18, 2025
bc7fe94
fix dictionary read
Jakeii Nov 18, 2025
dacfba3
snapshot
Jakeii Nov 18, 2025
0ee512f
fix ssm usage
Jakeii Nov 18, 2025
092f3d8
don't try and read fastly from env
Jakeii Nov 18, 2025
90d60ec
ensure error response gets sent
Jakeii Nov 18, 2025
5c7e200
stack/app name
Jakeii Nov 18, 2025
a712d54
don't forget delete requests
Jakeii Nov 18, 2025
415cb95
renamed stack
Jakeii Nov 19, 2025
73e9f66
custom implementation of async response logic
Jakeii Nov 19, 2025
e19a0da
simplify delete response
Jakeii Nov 19, 2025
7fd466f
artifact naming
Jakeii Nov 19, 2025
55ca26a
more logging
Jakeii Nov 19, 2025
01fbd42
s3 key format
Jakeii Nov 19, 2025
e875c30
split projects
Jakeii Nov 19, 2025
1cec5ed
naming
Jakeii Nov 19, 2025
2ac5ba6
cdk location
Jakeii Nov 20, 2025
d0f9f5e
lint-staged
Jakeii Nov 20, 2025
7f605ea
rename workflow
Jakeii Nov 20, 2025
6349e1e
tidy up
Jakeii Nov 20, 2025
35e6107
Add names to Riff-Raff jobs and create tsconfig for ab-testing
Jakeii Nov 20, 2025
7dd7c46
Merge remote-tracking branch 'origin/main' into jlk/ab-testing-deploy…
Jakeii Nov 20, 2025
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
58 changes: 0 additions & 58 deletions .github/workflows/ab-testing-checks.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/ab-testing-ci-code.yml

This file was deleted.

139 changes: 116 additions & 23 deletions .github/workflows/ab-testing-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,127 @@ permissions:
contents: read

on:
pull_request:
paths:
- 'ab-testing/**'
- '.github/workflows/ab-testing-*.yml'
push:
branches:
- main
paths:
- 'ab-testing/**'
- '.github/workflows/ab-testing-*.yml'
- '!ab-testing/deployment-lambda/**'
- '.github/workflows/ab-testing-ci.yml'

jobs:
ci:
name: CI
uses: ./.github/workflows/ab-testing-checks.yml
with:
save_build_artifact: true
secrets:
config-ci:
runs-on: ubuntu-latest
name: Config CI
defaults:
run:
working-directory: ab-testing/config
env:
FASTLY_AB_TESTING_CONFIG: ${{ secrets.FASTLY_PROD_AB_TESTING_CONFIG }}
FASTLY_API_TOKEN: ${{ secrets.FASTLY_PROD_API_TOKEN }}

deploy:
name: Deploy
needs: ci
if: github.ref == 'refs/heads/main'
uses: ./.github/workflows/ab-testing-deploy.yml
with:
stage: prod
secrets:
FASTLY_AB_TESTING_CONFIG: ${{ secrets.FASTLY_PROD_AB_TESTING_CONFIG }}
FASTLY_API_TOKEN: ${{ secrets.FASTLY_PROD_API_TOKEN }}
steps:
- uses: actions/checkout@v5

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

- name: Test
run: pnpm test

- name: Lint
run: pnpm lint

- name: Prettier Check
run: pnpm prettier:check

- name: Typecheck
run: pnpm tsc

- name: Validate
run: pnpm validate

- name: Build
run: pnpm build

- uses: actions/upload-artifact@v5
with:
name: ab-testing-build
path: ab-testing/config/dist

ui-ci:
name: UI CI
runs-on: ubuntu-latest
defaults:
run:
working-directory: ab-testing/frontend
permissions:
contents: read
steps:
- uses: actions/checkout@v5

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

- name: Build UI
run: pnpm build

- name: Save build
uses: actions/upload-artifact@v5
with:
name: ui-build
path: ab-testing/frontend/output/ab-tests.html
if-no-files-found: error

riff-raff:
name: Riff-Raff Artifacts
runs-on: ubuntu-latest
needs: [config-ci, ui-ci]
permissions:
id-token: write
contents: read
pull-requests: write
defaults:
run:
working-directory: ab-testing

steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
persist-credentials: false

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

- name: Fetch config build
uses: actions/[email protected]
with:
name: ab-testing-build
path: ab-testing/config/dist

- name: Fetch UI build
uses: actions/[email protected]
with:
name: ui-build
path: ab-testing/frontend/output/ab-tests.html

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

- name: CDK synth
run: pnpm --filter @guardian/ab-testing-cdk synth:ab-testing-config

- name: Riff-Raff Upload
uses: guardian/[email protected]
with:
roleArn: ${{ secrets.GU_RIFF_RAFF_ROLE_ARN }}
githubToken: ${{ secrets.GITHUB_TOKEN }}
projectName: dotcom:ab-testing
configPath: ab-testing/cdk/cdk.out/ab-testing-config/riff-raff.yaml
contentDirectories: |
ab-testing-config-artifacts:
- ab-testing/config/dist
ab-testing-ui-artifact:
- ab-testing/frontend/output/ab-tests.html
cdk.out/ab-testing-config:
- ab-testing/cdk/cdk.out/ab-testing-config
42 changes: 0 additions & 42 deletions .github/workflows/ab-testing-deploy.yml

This file was deleted.

89 changes: 89 additions & 0 deletions .github/workflows/ab-testing-lambda-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: 🧪 AB testing Lambda

permissions:
contents: read

on:
push:
paths:
- 'ab-testing/deploy-lambda/**'
- 'ab-testing/cdk/**'
- 'ab-testing/config/lib/**'
- '.github/workflows/ab-testing-lambda-ci.yml'

jobs:
ci:
name: CI
runs-on: ubuntu-latest
defaults:
run:
working-directory: ab-testing/deploy-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-lambda-build
path: ab-testing/deploy-lambda/dist/lambda.zip

riff-raff:
name: Riff-Raff Artifacts
runs-on: ubuntu-latest
needs: [ci]
permissions:
id-token: write
contents: read
pull-requests: write
defaults:
run:
working-directory: ab-testing

steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
persist-credentials: false

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

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

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

- name: CDK synth
run: pnpm --filter @guardian/ab-testing-cdk synth:deployment-lambda

- name: Riff-Raff Upload
uses: guardian/[email protected]
with:
roleArn: ${{ secrets.GU_RIFF_RAFF_ROLE_ARN }}
githubToken: ${{ secrets.GITHUB_TOKEN }}
projectName: dotcom:ab-testing-deployment-lambda
configPath: ab-testing/cdk/cdk.out/deployment-lambda/riff-raff.yaml
contentDirectories: |
ab-testing-deployment-lambda:
- ab-testing/deploy-lambda/dist/lambda.zip
cdk.out/deployment-lambda:
- ab-testing/cdk/cdk.out/deployment-lambda
Loading
Loading