Skip to content

Commit ac6c1c8

Browse files
authored
Merge branch 'main' into jm/feat-qualify-epic-impression
2 parents e2f335e + 2a1b06b commit ac6c1c8

File tree

108 files changed

+4696
-2443
lines changed

Some content is hidden

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

108 files changed

+4696
-2443
lines changed

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

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,26 @@ jobs:
3030
steps:
3131
- uses: actions/checkout@v5
3232

33-
# https://github.com/denoland/setup-deno#latest-stable-for-a-major
34-
- uses: denoland/setup-deno@v1
35-
with:
36-
deno-version: v2.3
33+
- name: Set up Node environment
34+
uses: ./.github/actions/setup-node-env
3735

3836
- name: Test
39-
run: deno test
37+
run: pnpm test
38+
39+
- name: Lint
40+
run: pnpm lint
41+
42+
- name: Prettier Check
43+
run: pnpm prettier:check
44+
45+
- name: Typecheck
46+
run: pnpm tsc
4047

4148
- name: Validate
42-
run: deno run scripts/validation/index.ts
49+
run: pnpm validate
4350

4451
- name: Build
45-
run: deno task build
52+
run: pnpm build
4653

4754
- if: ${{ inputs.save_build_artifact }}
4855
uses: actions/upload-artifact@v5

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,8 @@ jobs:
2626
steps:
2727
- uses: actions/checkout@v5
2828

29-
# https://github.com/denoland/setup-deno#latest-stable-for-a-major
30-
- uses: denoland/setup-deno@v1
31-
with:
32-
deno-version: v2.3
29+
- name: Set up Node environment
30+
uses: ./.github/actions/setup-node-env
3331

3432
- name: Download build artifact
3533
uses: actions/download-artifact@v6.0.0
@@ -38,7 +36,7 @@ jobs:
3836
path: ab-testing/dist
3937

4038
- name: Deploy
41-
run: deno run deploy
39+
run: pnpm run deploy
4240
env:
4341
FASTLY_AB_TESTING_CONFIG: ${{ secrets.FASTLY_AB_TESTING_CONFIG }}
4442
FASTLY_API_TOKEN: ${{ secrets.FASTLY_API_TOKEN }}

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

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 🦕 AB testing UI
1+
name: 🧪 AB testing UI
22
on:
33
pull_request:
44
paths:
@@ -15,22 +15,20 @@ jobs:
1515
build-ui:
1616
name: AB testing UI build
1717
runs-on: ubuntu-latest
18-
permissions:
19-
contents: read
2018
defaults:
2119
run:
2220
working-directory: ab-testing/frontend
21+
permissions:
22+
contents: read
2323
steps:
2424
- uses: actions/checkout@v5
2525

26-
# https://github.com/denoland/setup-deno#latest-stable-for-a-major
27-
- uses: denoland/setup-deno@v1
28-
with:
29-
deno-version: v2.3
30-
- name: Install
31-
run: deno install
32-
- name: Build
33-
run: deno run build
26+
- name: Set up Node environment
27+
uses: ./.github/actions/setup-node-env
28+
29+
- name: Build UI
30+
run: pnpm build
31+
3432
- name: Save build
3533
uses: actions/upload-artifact@v5
3634
with:
@@ -41,6 +39,7 @@ jobs:
4139
riff-raff:
4240
name: AB testing Riffraff upload
4341
runs-on: ubuntu-latest
42+
needs: build-ui
4443
permissions:
4544
id-token: write
4645
contents: read

.vscode/settings.json.required

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Copy these to .vscode/settings.json to apply them to your editor – but don't commit it!
33
// https://github.com/guardian/recommendations/blob/main/VSCode.md#do-not-commit-vscode
44
{
5-
"deno.enablePaths": ["scripts/deno", "ab-testing/scripts"],
5+
"deno.enablePaths": ["scripts/deno"],
66
"deno.lint": true,
77
"deno.unstable": false,
88
"typescript.tsdk": "node_modules/typescript/lib",

ab-testing/.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
frontend/.svelte-kit

ab-testing/.prettierrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

ab-testing/abTest.ts

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

ab-testing/abTests.ts

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import type { ABTest } from "./types.ts";
2+
3+
/**
4+
* Tests are defined here. They will be assigned mvt ranges based on the
5+
* size of the test and the number of groups, these ranges may not be contiguous.
6+
*
7+
* For 100% tests to run concurrently with other tests, they should be assigned to different
8+
* test spaces. This means that some users will be in multiple tests at the same time.
9+
*
10+
* Example:
11+
* [Space A]
12+
* - 20% Test control MVT 0-99
13+
* - 20% Test variant MVT 100-199
14+
* - 50% Test control MVT 200-449
15+
* - 50% Test variant MVT 450-699
16+
*
17+
* [Space B]
18+
* - 100% Test control MVT 0-499
19+
* - 100% Test variant MVT 500-999
20+
*/
21+
22+
const ABTests: ABTest[] = [
23+
{
24+
name: "commercial-prebid-v10",
25+
description: "Testing Prebid.js v10 integration on DCR",
26+
owners: ["commercial.dev@guardian.co.uk"],
27+
status: "ON",
28+
expirationDate: "2025-12-10",
29+
type: "client",
30+
audienceSize: 10 / 100,
31+
audienceSpace: "A",
32+
groups: ["control", "variant"],
33+
shouldForceMetricsCollection: true,
34+
},
35+
{
36+
name: "commercial-user-module-ID5",
37+
description:
38+
"Tests whether we can get the users email, hash it and pass pd value to the userId array",
39+
owners: ["commercial.dev@guardian.co.uk"],
40+
expirationDate: `2025-12-19`,
41+
type: "client",
42+
status: "ON",
43+
audienceSize: 10 / 100,
44+
audienceSpace: "A",
45+
groups: ["control", "variant"],
46+
shouldForceMetricsCollection: true,
47+
},
48+
];
49+
50+
const activeABtests = ABTests.filter((test) => test.status === "ON");
51+
52+
export { ABTests as allABTests, activeABtests };

ab-testing/deno.json

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

ab-testing/deno.lock

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

0 commit comments

Comments
 (0)