PR evidence · RubberDuck · PR #138 → staging

PR #138: fix the staging frontend deploy that #137 broke

The merge of #137 broke the staging frontend Docker build. This PR fixes it and adds a CI job, so a broken Docker build is caught on the PR before it reaches staging. Nothing in it deploys, merges or touches production.

REVIEW CLEAN  Two review rounds by a separate GPT-5.6 Sol reviewer (high reasoning). Round 1 reproduced the fix independently and raised a single blocker: the PR had no video. Round 2 checked the recorded video and approved. CI is green at head b2da08c0. Built by Claude Opus in a Cursor cloud agent. Only you merge to staging.

What broke

The staging deploy builds the frontend image with only the frontend/ folder as the Docker context. #137 added frontend/playwright.config.ts, which imports ../scripts/lib/env-profiles.cjs, a file outside that folder. next build type-checks every .ts file, so it couldn't find the import and the build failed (deploy run #395).

What the PR changes

  • frontend/tsconfig.json now excludes playwright.config.ts and tests/e2e, so the production build no longer reads them.
  • A new frontend/tsconfig.e2e.json still type-checks those test files through npm run typecheck, so their type errors are still caught.
  • A new docker-build CI job builds both the frontend and backend images on every PR, the same way the deploy does. It doesn't push, and it gets no secrets.

How the fix works

Before (4c5c76f) docker build frontend/ next build type-checksplaywright.config.ts ✗ ../scripts/lib/env-profiles.cjsis outside the context, so the deploy fails After (b2da08c0) docker build frontend/ E2E files excludedchecked by typecheck instead ✓ build exit 0 · app answers HTTP 200CI docker-build now catches this on PRs

The video

The video is a terminal screen recording, 2 min 52 s at real speed (both builds use --no-cache, so they really run). It holds 3 seconds on a title screen before the first command and 3 seconds on the final result. Only public placeholder build args are used, and no secrets appear. Click a timestamp to jump there and pause.

Same build, before and after the fix

PASS
What this checks
It runs the exact deploy-style docker build on the frontend/ context twice. The first build uses the broken merge commit, and the second uses this PR's head, which it then starts and calls with curl.
Which part of the PR it proves
It proves the tsconfig.json exclusion fixes the exact failure staging hit, and that the fixed image actually serves the app. The new CI docker-build job runs this same build on every PR.
What to watch for
  • 3-second hold on the title screen.
  • Before: a fresh checkout of 4c5c76f (the merge of #137). Line 2 of playwright.config.ts shows the outside import.
  • The build fails at the TypeScript step with Cannot find module '../scripts/lib/env-profiles.cjs', then prints docker build exit code: 1.
  • After: the same checkout moves to b2da08c0, clean and with no node_modules, and the same build runs again.
  • docker build exit code: 0, then docker run starts Next.js 16.1.4 and curl prints GET / -> HTTP 200.
  • to the end: 3-second hold on the result.
Speed:

Other checks

CI at b2da08c0green, including both new docker-build jobs
npm run typecheckpassed. The reviewer also planted type errors in the E2E files, and the check failed on them as it should, so those files are still checked.
Frontend tests and build1106 passed (5 skips were already there before this PR); build passed
Backend pytest1589 passed, 37 documented skips
New-code checker0 findings
CI securityRuns on pull_request with read-only permissions, no secrets, no registry login and no push.

For you

  1. Owner review. The checker flags changes to .github/workflows/ci.yml and frontend/tsconfig.json for your review, because they change CI and build config.
  2. Merge to staging when you're happy. The next staging deploy should then go green.