P2-ops: migration alignment, deploy test list, monitor alerts/single-host, backup/rollback closure, Caddy template

- migrations: MIGRATION_TABLES now equals POSTGRES_SCHEMA tables
  (uploads, task_attachments, task_followups, environments added);
  SEQUENCE_TABLES matches IDENTITY tables; task_followups
  sender_task_id column ensured before insert; UNMIGRATED_TABLES
  and migration_coverage() report tables with no PG schema instead
  of silently skipping them; CLI prints the coverage report.
- deploy: DEFAULT_TEST_SUITES gains deploy/tests (discover -s only,
  never package path); regression tests pin the default list.
- monitor: MONITOR_SINGLE_HOST=1 makes the server check single-host;
  default stays dual to avoid silent downgrade; server_mode is in
  the JSON. Optional fail-only alert outlet (webhook or mail,
  default off, alert body is pass/fail JSON only, no secrets).
- backup/rollback: README and restore-drill document what is
  recoverable (DB, code) vs not (worktrees, traces, uploads, host
  configs); rollback.sh shares the server-unit list and dual-port
  health success standard with host_deploy.sh (sync test guards it).
- public entry: Caddyfile uses native {$DOMAIN}/{$ACME_EMAIL}
  variables plus a caddy.service template; README documents the
  steps and the current BT-nginx production status.
This commit is contained in:
host committed 2026-10-27 16:37:28 +00:00
1 parent ef532a38c2
commit 64995fafab
14 files changed
+953 -44

No files matched your search

+10 -1
View File
@@ -291,8 +291,17 @@ def transfer(host, user, local, remote, expected_sha):
sys.exit(1)
# 部署前默认跑的测试清单:必须用 discover -s <目录>,
# 绝不能用 deploy.tests 这种包路径——包路径会把 deploy 当包
# import、盖掉 deploy.py 本体(2026-10-27 教训),导致
# 13 个假报错。P2-ops:deploy/tests 以前漏在清单外,
# deploy.py 自身的回归(如 ssh 分发)可能带病上线,
# 现补进默认清单。
DEFAULT_TEST_SUITES = ("tests", "cloud/tests", "deploy/tests")
def run_tests():
for suite in ("tests", "cloud/tests"):
for suite in DEFAULT_TEST_SUITES:
run(["python3", "-m", "unittest", "discover", "-s", suite],
cwd=REPO_ROOT)