Builds without a database are checked before a release #151
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MassiveDynamic/kataba#151
Loading…
Add table
Add a link
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?
Twice a page reached the database while prerendering (#104 broke it, #121/#134 reported it,
14a0fe3fixed it). Local and e2e builds always have a database, so this only shows in the Docker build at release time (ADR-0014).Decisions (grilling of #121)
npm run build:nodbmirrors the Docker build:DATABASE_URL= KATABA_STANDALONE=1 next build.DATABASE_URLis set to empty, not unset, so Next does not fill it in from.env.next.configtakesdistDirfromKATABA_DIST_DIR;build:nodbsets.next-nodb(gitignored), so it never touches the dev server's or the e2e build's.next.src/db.ts: in the build phase withoutDATABASE_URL, a Prisma$extendsquery hook throws on every operation, with a message like "No DATABASE_URL during the build: a page reaches the database while prerendering; await params/cookies first (ADR-0014)". The client is created at import, so the error has to come at query time, not import time. The decision (build phase and no URL) lives in a small pure function with a unit test (TDD seam). With a URL set, no hook: runtime is unchanged..claude/skills/release):npm run build:nodbruns first, before the merge request to master; a failure stops the release. The laterdocker buildstays as the final check.build:nodbbefore merging.Umgesetzt in #153 (feature/151-nodb-build → development):
npm run build:nodbbaut ohne Datenbank in.next-nodb,db.tsmeldet einen Datenbankzugriff beim Vorrendern klar, und der Release-Skill führt den Check als ersten Schritt aus.