Skip to content

Puzzles/add dcr base page pipeline - #16656

Merged
gustavo-olmedo merged 20 commits into
mainfrom
puzzles/add-dcr-base-page-pipeline
Sep 3, 2026
Merged

Puzzles/add dcr base page pipeline#16656
gustavo-olmedo merged 20 commits into
mainfrom
puzzles/add-dcr-base-page-pipeline

Conversation

@gustavo-olmedo

@gustavo-olmedo gustavo-olmedo commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

What does this change?

Adds the base DCR puzzles-page pipeline.

The new POST /PuzzlesPage endpoint:

  • Validates the Frontend page payload and puzzles blueprint recursively.
  • Checks for the exact puzzles-new-hub:variant participation.
  • Renders the Guardian masthead, Puzzles & Games heading and footer.
  • Returns the rendered HTML and prefetch headers to Frontend.
  • Returns 404 without invoking the renderer when the experiment is off.

It also adds the puzzles-page types, shared experiment helper, development and production routes, render function, base page components and unit tests.

The blueprint-driven directory and final visual design will be implemented in the following tickets.

Why?

The Frontend /puzzles route added in the previous tickets needs a dedicated DCR endpoint.

Frontend builds the puzzles-page payload and sends it to POST /PuzzlesPage. DCR validates the data, applies the experiment guard, renders the base HTML document and returns it to Frontend.

This establishes a safe foundation for the following puzzles layout, styling and interaction work.

How has this change been tested?

Automated tests

Added Jest tests covering:

  • Minimal and complete valid payloads.
  • Rows, nested containers, items and archives.
  • Card variants, cadence metadata, colours and desktop spans.
  • Navigation targets, filter references and duplicate stable IDs.
  • Variant, control, absent, malformed, unknown-group and unrelated experiment participations.
  • Invalid-payload rejection.
  • Proof that the renderer is not called when the experiment is off.
  • Page title, description, canonical URL and Guardian configuration.
  • Navigation extraction and ad-free/ad-enabled inputs.

The focused Jest tests and TypeScript checks pass.

Manual testing

Deployed to CODE and verified that:

  • /puzzles returns the DCR-rendered base page for puzzles-new-hub:variant.
  • The page contains the Guardian masthead, Puzzles & Games heading and footer.
  • Experiment-off requests do not render the puzzles page.
  • Ad-free users do not receive the header ad.

Screenshots

Not applicable. This PR establishes the page contract and rendering pipeline. The final blueprint-driven visual layout is covered by the following tickets.

@gustavo-olmedo gustavo-olmedo added the feature Departmental tracking: work on a new feature label Sep 1, 2026
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

🚀 Image pushed to AWS ECR

Image digest: sha256:c2e972555658e482ba17292958b80a21abd663880d766e41f2978a041a55fc83

🐛 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:c2e972555658e482ba17292958b80a21abd663880d766e41f2978a041a55fc83"

# Refer to image using branch tag
# IMAGE_IDENTIFIER=":branch-puzzles-add-dcr-base-page-pipeline"

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

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

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

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

@gustavo-olmedo
gustavo-olmedo marked this pull request as ready for review September 2, 2026 09:35
@gustavo-olmedo
gustavo-olmedo requested a review from a team as a code owner September 2, 2026 09:35
@github-actions

github-actions Bot commented Sep 2, 2026

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.

dependabot Bot and others added 4 commits September 3, 2026 08:52
…es (#16600)

Bumps the storybook group with 4 updates in the / directory: [@storybook/addon-a11y](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/a11y), [@storybook/addon-docs](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/docs), [@storybook/react-webpack5](https://github.com/storybookjs/storybook/tree/HEAD/code/frameworks/react-webpack5) and [storybook](https://github.com/storybookjs/storybook/tree/HEAD/code/core).


Updates `@storybook/addon-a11y` from 10.5.7 to 10.5.10
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v10.5.10/code/addons/a11y)

Updates `@storybook/addon-docs` from 10.5.7 to 10.5.10
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v10.5.10/code/addons/docs)

Updates `@storybook/react-webpack5` from 10.5.7 to 10.5.10
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v10.5.10/code/frameworks/react-webpack5)

Updates `storybook` from 10.5.7 to 10.5.10
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v10.5.10/code/core)

---
updated-dependencies:
- dependency-name: "@storybook/addon-a11y"
  dependency-version: 10.5.10
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/addon-docs"
  dependency-version: 10.5.10
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/react-webpack5"
  dependency-version: 10.5.10
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: storybook
  dependency-version: 10.5.10
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: storybook
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@gustavo-olmedo gustavo-olmedo added the run_chromatic Runs chromatic when label is applied label Sep 3, 2026
@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label Sep 3, 2026
@gustavo-olmedo
gustavo-olmedo added this pull request to the merge queue Sep 3, 2026
Merged via the queue into main with commit 677c04d Sep 3, 2026
26 checks passed
@gustavo-olmedo
gustavo-olmedo deleted the puzzles/add-dcr-base-page-pipeline branch September 3, 2026 08:34
@gu-prout

gu-prout Bot commented Sep 3, 2026

Copy link
Copy Markdown

Seen on PROD (merged by @gustavo-olmedo 8 minutes and 53 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.

3 participants