Context
Tests use aiosqlite + SQLAlchemy create_all — there is no Postgres and no Alembic in ci.yml. The migration chain (001→006) is never run end-to-end in CI.
This let a real defect ship: migration 004_intent_engine was written non-self-contained (it assumed a pre-existing toy crypto_intents table + crypto_intent_status enum and only did add_column / ALTER TYPE). It was unappliable on any clean DB and would have failed every fresh deploy. CI was green throughout because prod sat at alembic 001 and the test suite builds its schema via create_all, never via the migrations. The break was only caught during the manual production deploy and fixed in PR #8 (004 rewritten self-contained, verified by diffing the migrated schema against create_all).
A CI gate that actually runs the migrations would have caught it on the PR.
Action items
- Add a Postgres service container to
.github/workflows/ci.yml (the self-hosted runner has Docker) with a throwaway hyrule DB.
- Add a step that runs the chain as a roundtrip on every PR:
alembic upgrade head then alembic downgrade base against that Postgres.
- (Optional, strong) Assert the migrated
head schema matches Base.metadata.create_all — the exact parity check used to validate the 004 fix — so future model/migration drift fails CI.
Related
Context
Tests use
aiosqlite+ SQLAlchemycreate_all— there is no Postgres and no Alembic inci.yml. The migration chain (001→006) is never run end-to-end in CI.This let a real defect ship: migration
004_intent_enginewas written non-self-contained (it assumed a pre-existing toycrypto_intentstable +crypto_intent_statusenum and only didadd_column/ALTER TYPE). It was unappliable on any clean DB and would have failed every fresh deploy. CI was green throughout because prod sat at alembic001and the test suite builds its schema viacreate_all, never via the migrations. The break was only caught during the manual production deploy and fixed in PR #8 (004 rewritten self-contained, verified by diffing the migrated schema againstcreate_all).A CI gate that actually runs the migrations would have caught it on the PR.
Action items
.github/workflows/ci.yml(the self-hosted runner has Docker) with a throwawayhyruleDB.alembic upgrade headthenalembic downgrade baseagainst that Postgres.headschema matchesBase.metadata.create_all— the exact parity check used to validate the 004 fix — so future model/migration drift fails CI.Related
.github/workflows/ci.ymlalembic/versions/*,hyrule_cloud/db.py