Default server-side abTests to {} at request validation#16287
Merged
Conversation
…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.
|
Hello 👋! When you're ready to run Chromatic, please apply the You will need to reapply the label each time you want to run Chromatic. |
deedeeh
approved these changes
Jun 29, 2026
deedeeh
left a comment
Contributor
There was a problem hiding this comment.
Looks good @DanielCliftonGuardian
arelra
reviewed
Jun 29, 2026
{} at request validation
arelra
reviewed
Jun 30, 2026
arelra
approved these changes
Jun 30, 2026
arelra
left a comment
Member
There was a problem hiding this comment.
Looks good just some minor comments
Co-authored-by: Ravi <7014230+arelra@users.noreply.github.com>
|
Seen on PROD (merged by @DanielCliftonGuardian 10 minutes and 25 seconds ago) Please check your changes! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.abTestsis annotated with/** @default {} */on the three base FE config types (ConfigType,FEFrontConfig,FENewslettersConfigType), somake gen-schemasemits"default": {}into the page schema and AJV (already configured withuseDefaults) fillsabTests: {}during validation for any payload that omits it. Because AJV applies defaults before therequiredcheck, 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.