Skip to content

Prevent adding 100% AB tests without intermediate smaller test - #16623

Merged
Jakeii merged 1 commit into
mainfrom
jlk/prevent-100-perc-test
Sep 2, 2026
Merged

Prevent adding 100% AB tests without intermediate smaller test#16623
Jakeii merged 1 commit into
mainfrom
jlk/prevent-100-perc-test

Conversation

@Jakeii

@Jakeii Jakeii commented Aug 27, 2026

Copy link
Copy Markdown
Member

What does this change?

Prevent new 100% tests that didn't start at a smaller size, with a link to documentation on why

Why?

This has come up a few times with 100% tests, it's mentioned in the docs but it's easy to miss.

The link explains that this can cause a massive cache invalidation, which would spike traffic to origin, this should prevent it happening in the future.

I've added this in the build step rather than the validation step as the validation step doesn't have access to the current/previews state of the tests.

How has this change been tested?

Added unit tests

@github-actions

Copy link
Copy Markdown

🚀 Image pushed to AWS ECR

Image digest: sha256:25b46774e43c72fb0557e2f0b2e8fd73ccc2b1d4230188ad54f834418c63e872

🐛 Run the image locally

The following can be used to run the image locally:

# Refer to image using the immutable digest. Find alternatives below.
IMAGE_IDENTIFIER="@sha256:25b46774e43c72fb0557e2f0b2e8fd73ccc2b1d4230188ad54f834418c63e872"

# Refer to image using branch tag
# IMAGE_IDENTIFIER=":branch-jlk-prevent-100-perc-test"

# Refer to image using build tag
# IMAGE_IDENTIFIER=":build-30502"

# Refer to image via the GitHub commit SHA tag
# IMAGE_IDENTIFIER=":sha-34b1bf51d71a397117fc7126aba6bff75d3a4aad"

# Set environment variables for the AWS CLI
AWS_PROFILE="<A_PROFILE_FROM_JANUS>"
AWS_DEFAULT_REGION="eu-west-1"

IMAGE_ACCOUNT_ID=$(aws ssm get-parameter --name /organisation/accounts/deployTools --query "Parameter.Value" --output text)
REGISTRY="${IMAGE_ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com"
IMAGE="${REGISTRY}/guardian/dotcom-rendering${IMAGE_IDENTIFIER}"

# Login to AWS ECR https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry_auth.html
aws ecr get-login-password | docker login --username AWS --password-stdin $REGISTRY

# Pull the image
docker pull $IMAGE

# Run the image. You'll likely need to set additional flags. See https://docs.docker.com/reference/cli/docker/container/run.
docker run $IMAGE

From guardian/actions-publish-image.

@Jakeii Jakeii added the feature Departmental tracking: work on a new feature label Aug 27, 2026
@Jakeii Jakeii self-assigned this Aug 27, 2026
@Jakeii
Jakeii marked this pull request as ready for review August 27, 2026 11:36
@Jakeii
Jakeii requested a review from a team as a code owner August 27, 2026 11:36

@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.

Great to have this as an automated check

@Jakeii
Jakeii added this pull request to the merge queue Sep 2, 2026
Merged via the queue into main with commit 6ddce15 Sep 2, 2026
57 of 61 checks passed
@Jakeii
Jakeii deleted the jlk/prevent-100-perc-test branch September 2, 2026 15:08
@gu-prout

gu-prout Bot commented Sep 2, 2026

Copy link
Copy Markdown

Seen on PROD (merged by @Jakeii 7 minutes and 45 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

feature Departmental tracking: work on a new feature Seen-on-PROD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants