[NX-104] Add migration upgrade/downgrade verification in CI #10

Closed
opened 2026-02-13 13:13:31 +00:00 by nessi · 1 comment
Owner

Goal

Guarantee Alembic migration safety before release.

Scope

  • CI step: upgrade to head, downgrade one step, re-upgrade.
  • Validate schema remains consistent.

Acceptance Criteria

  • Migration CI job is required and green.
  • Failed downgrade/upgrade blocks merge.
## Goal Guarantee Alembic migration safety before release. ## Scope - CI step: upgrade to head, downgrade one step, re-upgrade. - Validate schema remains consistent. ## Acceptance Criteria - Migration CI job is required and green. - Failed downgrade/upgrade blocks merge.
nessi added this to the v1.0 - Stability, Reliability & Security (P0) milestone 2026-02-13 13:13:31 +00:00
nessi added the P0 label 2026-02-13 13:13:31 +00:00
nessi added reference development 2026-02-14 15:03:26 +00:00
Author
Owner

Changes in commits: NX-104

Goal

Ensure migration changes are safe before merge/release by validating upgrade/downgrade roundtrips and resulting schema consistency.

Delivered Scope

  • Added dedicated CI workflow:
    • .github/workflows/migration-safety.yml
  • Added migration safety job that runs:
    • alembic upgrade head
    • alembic downgrade -1
    • alembic upgrade head
  • Added schema consistency verification:
    • pg_dump --schema-only before/after roundtrip
    • diff -u comparison
  • Added normalization to avoid false negatives:
    • filters dynamic \restrict / \unrestrict lines from dumps.

Acceptance Criteria

  • Migration CI job exists and is green when migrations are safe.
  • Failed downgrade/re-upgrade fails CI.
  • Schema mismatch after roundtrip fails CI.
  • Workflow is suitable to be marked as required status check to block merges on failure.

Notes

  • No runtime application behavior changed.
  • No additional DB migration required for this CI feature itself.
Changes in commits: NX-104 ### Goal Ensure migration changes are safe before merge/release by validating upgrade/downgrade roundtrips and resulting schema consistency. ### Delivered Scope - Added dedicated CI workflow: - `.github/workflows/migration-safety.yml` - Added migration safety job that runs: - `alembic upgrade head` - `alembic downgrade -1` - `alembic upgrade head` - Added schema consistency verification: - `pg_dump --schema-only` before/after roundtrip - `diff -u` comparison - Added normalization to avoid false negatives: - filters dynamic `\restrict` / `\unrestrict` lines from dumps. ### Acceptance Criteria - ✅ Migration CI job exists and is green when migrations are safe. - ✅ Failed downgrade/re-upgrade fails CI. - ✅ Schema mismatch after roundtrip fails CI. - ✅ Workflow is suitable to be marked as required status check to block merges on failure. ### Notes - No runtime application behavior changed. - No additional DB migration required for this CI feature itself.
nessi closed this issue 2026-02-14 15:36:27 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nessi/NexaPG#10