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.jsonnow excludesplaywright.config.tsandtests/e2e, so the production build no longer reads them.- A new
frontend/tsconfig.e2e.jsonstill type-checks those test files throughnpm 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
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 buildon thefrontend/context twice. The first build uses the broken merge commit, and the second uses this PR's head, which it then starts and calls withcurl. - Which part of the PR it proves
- It proves the
tsconfig.jsonexclusion fixes the exact failure staging hit, and that the fixed image actually serves the app. The new CIdocker-buildjob 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 ofplaywright.config.tsshows the outside import. - The build fails at the TypeScript step with
Cannot find module '../scripts/lib/env-profiles.cjs', then printsdocker build exit code: 1. - After: the same checkout moves to
b2da08c0, clean and with nonode_modules, and the same build runs again. -
docker build exit code: 0, thendocker runstarts Next.js 16.1.4 andcurlprintsGET / -> HTTP 200. - to the end: 3-second hold on the result.
Other checks
CI at b2da08c0 | green, including both new docker-build jobs |
npm run typecheck | passed. 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 build | 1106 passed (5 skips were already there before this PR); build passed |
| Backend pytest | 1589 passed, 37 documented skips |
| New-code checker | 0 findings |
| CI security | Runs on pull_request with read-only permissions, no secrets, no registry login and no push. |
For you
- Owner review. The checker flags changes to
.github/workflows/ci.ymlandfrontend/tsconfig.jsonfor your review, because they change CI and build config. - Merge to
stagingwhen you're happy. The next staging deploy should then go green.