Add Alembic migration testing against Postgres in CI #164
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/pal-e-api#164
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?
Lineage
plan-pal-e-docs→ Phase 7 (CI/Infra Hardening)todo-migration-testing-ci-pal-e-docs— existing TODO noteRepo
forgejo_admin/pal-e-docsUser Story
As a developer merging schema changes
I want CI to test Alembic migrations against Postgres before deploy
So that broken migrations never reach production (two past incidents: 2026-02-26, 2026-03-02)
Context
The CI test step uses
PALDOCS_DATABASE_PATH=":memory:"(SQLite) — zero migration testing against Postgres. pal-e-docs has been on Postgres since 2026-03-08. Two production incidents from untested migrations that worked on SQLite but failed on Postgres. The test step runs ruff + pytest but never runsalembic upgrade head. Woodpecker supports service containers (likepostgres:17), so we can spin up a real Postgres for migration testing.File Targets
Files the agent should modify or create:
.woodpecker.yaml— addmigration-teststep betweentestandbuild-and-pushFiles the agent should NOT touch:
alembic/— migration scripts are correct, just untested in CIk8s/— deployment manifestsAcceptance Criteria
migration-teststep using a Postgres 17 service containeralembic upgrade headagainst the Postgres servicepushandpull_requesteventsbuild-and-push)Test Expectations
Constraints
services:block for Postgres container (not a step)PALDOCS_DATABASE_URLformat used in production:postgresql+psycopg://user:pass@host:5432/dbnamepython:3.12-slimor similar (needs pip install for alembic + psycopg):memory:— it's fast for unit tests. Migration test is a separate concern.Checklist
Related
pal-e-docs— project this affectstodo-migration-testing-ci-pal-e-docs— existing TODOtodo-pal-e-docs-deployment-reliability— parent reliability TODOphase-pal-e-docs-ci-infra— Phase 7