You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tower: extract runGlobalMigrations(db) so migration tests drive the real production runner #1476
The global.db migration tests exercise a faithful replica of the production migration block, not the real runner. The production migrations live inside the private ensureGlobalDatabase path, so tests can't drive them directly — they re-declare the same statements and assert on the replica, with source guards pinning the exact production SQL so the two can't silently diverge.
Extract the migration block into a standalone runGlobalMigrations(db) that both ensureGlobalDatabase and the tests call, so migration tests drive the real production runner instead of a copy.
Why
A replica test proves "this SQL does what we think", not "the SQL that actually ships does what we think" — the two are kept in sync by hand + a source guard, which is a maintenance tax and a latent drift risk every time a migration is added (v15 → v16 → v17 already, and growing). A single extracted runner collapses that to one source of truth the tests can call directly.
Notes
Repo precedent today is replica-based; this is the agreed way to retire that precedent for migrations specifically.
Keep the extraction pure (takes a db handle, runs the PRAGMA-gated ADD COLUMN / CREATE TABLE sequence) so it's callable from both production init and tests without side effects.
Activity
[Air #1476] feat: extract runGlobalMigrations(db) so migration tests …
[Air #1476] docs+test: address CMAP minors (JSDoc caveat, stale point…
[Air #1476] docs: builder thread log through the PR gate
[Air #1476] feat: reject a marker-less fresh schema at the runner entry
[Air #1476] docs: thread log — architect CMAP findings and responses
[Air #1476] docs: thread log — protocol complete, PR parked for maint…
Merge pull request #1485 from cluesmith/builder/air-1476