CI should build the production Docker image to catch Dockerfile/peer-dep regressions #103
Labels
No labels
bug
duplicate
enhancement
future
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rbrooks/TeaLeaves#103
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: Low · Confidence: High · Effort: S · Category: ops
Evidence
.forgejo/workflows/ci.yml:52-60- usesnpm ci+npm run build; typechecks both packages (good).api/Dockerfile:12,27- usesnpm install --legacy-peer-deps; also does a manualcp -r src/db/migrations dist/db/migrations.Problem
CI typechecks and tests both packages (the biggest risk), but never exercises the multi-stage Docker build, the differing dependency resolution (
npm install --legacy-peer-depsvsnpm ci), or the manual migrations-copy step. A Dockerfile/peer-dep regression ships unverified (the v5.0.0 → v5.0.1@types/multerincident is the precedent).Impact
Build-only regressions escape CI and surface at deploy time.
Fix
Add a CI job that builds the production api image (no push) so the Dockerfile path is exercised.
Acceptance criteria
Filed from the 2026-07-15 codebase audit. Full report:
docs/.internal/report-2026-07-15.md(gitignored).Done in
109c53a(v7.2.0). The new job passed on its first real CI run.New
Images — production buildjob builds both production images (no push) — api and app:This exercises exactly what
npm ci+npm run buildcannot: the multi-stage build,npm install --legacy-peer-depsresolving differently fromnpm ci, and the manual migrations copy.Plus a guard the issue didn't ask for but the evidence implies. The issue calls out
cp -r src/db/migrations dist/db/migrationsas unexercised. A build can succeed and still ship an image with no migrations —tscemits only.js, so if that copy ever breaks you get an image that boots happily and silently skips every migration. That's a data-integrity failure, not a build failure, so a build-only check wouldn't catch it:Currently reports 45.
Two infrastructure notes:
forgejo-runner-ansible'sforgejo_runner_container_options: "-v /var/run/docker.sock:/var/run/docker.sock", commented "sodocker buildworks inside CI jobs". Comment corrected.ubuntu-latest, notdocker. Thedockerlabel resolves to a node image with no docker CLI;catthehacker/ubuntu:act-24.04ships docker 29.6.1 + node 24 + git. Confirmed by running the image before writing the workflow rather than finding out via a red build.Acceptance criteria:
Verified twice: replicated the exact build commands on the dev server first, then the real job went green in CI. Notably it also passed during the run where the API job flaked (iac-repo#159), which is itself a useful datapoint — the heaviest job is not the one failing.
Unblocks part of #134 (auto-deploy): with images building in CI and Forgejo's own container registry available on this instance, the registry-based CD path no longer needs anything stood up.