Skip to content

Default server-side abTests to {} at request validation#16287

Merged
DanielCliftonGuardian merged 6 commits into
mainfrom
dc/ab-optional-config
Jul 1, 2026
Merged

Default server-side abTests to {} at request validation#16287
DanielCliftonGuardian merged 6 commits into
mainfrom
dc/ab-optional-config

Conversation

@DanielCliftonGuardian

@DanielCliftonGuardian DanielCliftonGuardian commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

What does this change?

guardian/frontend#28888 removes the legacy server-side AB test framework and will stop sending config.abTests. This PR makes DCR tolerate that field being absent.

abTests is annotated with /** @default {} */ on the three base FE config types (ConfigType, FEFrontConfig,FENewslettersConfigType), so make gen-schemas emits "default": {} into the page schema and AJV (already configured withuseDefaults) fills abTests: {} during validation for any payload that omits it. Because AJV applies defaults before the required check, the field can be absent yet is declared required on the validated types.

See: https://ajv.js.org/options.html#usedefaults

Why?

We have migrated to a new AB testing framework and the legacy one can be deleted.


…ork and will stop sending . This PR makes DCR tolerate that field being either present () or absent, so it can be deployed to PROD **before** stops sending it.
@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown

@DanielCliftonGuardian DanielCliftonGuardian added the maintenance Departmental tracking: maintenance work, not a fix or a feature label Jun 29, 2026
@DanielCliftonGuardian DanielCliftonGuardian self-assigned this Jun 29, 2026
@DanielCliftonGuardian DanielCliftonGuardian marked this pull request as ready for review June 29, 2026 12:34
@DanielCliftonGuardian DanielCliftonGuardian requested a review from a team as a code owner June 29, 2026 12:34
@github-actions

Copy link
Copy Markdown

Hello 👋! When you're ready to run Chromatic, please apply the run_chromatic label to this PR.

You will need to reapply the label each time you want to run Chromatic.

Click here to see the Chromatic project.

@deedeeh deedeeh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DanielCliftonGuardian DanielCliftonGuardian added the run_chromatic Runs chromatic when label is applied label Jun 29, 2026
@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label Jun 29, 2026
Comment thread dotcom-rendering/src/components/AllEditorialNewslettersPage.tsx Outdated
@DanielCliftonGuardian DanielCliftonGuardian changed the title Make config.abTests optional and stop consuming it Default server-side abTests to {} at request validation Jun 29, 2026
@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown

Comment thread dotcom-rendering/src/types/config.ts Outdated

@arelra arelra left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good just some minor comments

DanielCliftonGuardian and others added 2 commits June 30, 2026 13:32
Co-authored-by: Ravi <7014230+arelra@users.noreply.github.com>
@DanielCliftonGuardian DanielCliftonGuardian added the run_chromatic Runs chromatic when label is applied label Jun 30, 2026
@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label Jun 30, 2026
@DanielCliftonGuardian DanielCliftonGuardian added the run_chromatic Runs chromatic when label is applied label Jul 1, 2026
@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label Jul 1, 2026
@DanielCliftonGuardian DanielCliftonGuardian merged commit bb8b7fb into main Jul 1, 2026
36 checks passed
@DanielCliftonGuardian DanielCliftonGuardian deleted the dc/ab-optional-config branch July 1, 2026 08:12
@gu-prout gu-prout Bot added the Seen-on-PROD label Jul 1, 2026
@gu-prout

gu-prout Bot commented Jul 1, 2026

Copy link
Copy Markdown

Seen on PROD (merged by @DanielCliftonGuardian 10 minutes and 25 seconds ago) Please check your changes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Departmental tracking: maintenance work, not a fix or a feature Seen-on-PROD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants