Skip to content

The self-check's schema check alerts the owner while a revision is applied before its merge, as the project requires #360

Closed

Description

@lumenpearson

The tick's self-check (server/app/services/health.py, check_schema, on the monitoring branch, #359) reads failing whenever the database's revision differs from EXPECTED_REVISION, in either direction. A database ahead of the code is the window the project's own migration order creates on purpose: every additive revision goes on before the merge that needs it (CLAUDE.md, «Run the migration BEFORE the merge»), and api/public.py:_drift_detail already calls that window «the documented procedure working».

Failure scenario: with #359 merged and production running its code at 0019, the next additive revision 0020 is applied through Neon before its pull request merges. The next tick finds the database at 0020, ahead of the code's 0019, and writes to the owner «🔴 Схема базы не совпадает с кодом»; once the merge deploys, «🟢 … простой N мин». That happens on almost every migration, so the alarm is learnt as noise — and ignored on the day the order really is wrong (a database behind the code, which takes the bot down).

Fix, in #359 before it merges: when both revisions are numbers and the database is ahead, check_schema reads ok with a reason saying so («database at 0020, ahead of code at 0019: migrated before its merge»), as /api/v1/warmup reads the same window; behind stays failing. A deploy that never arrives is the deploy check's to report, after its fifteen minutes. Found by the final review of the monitoring branch.

Activity

  1. added 2 commits that reference this issue on Oct 6, 2026
    4fe6f3d
    4b0cd19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status
      Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions