fix(ci): arm the maintenance flag on the test-contour deploy #172
Reference in New Issue
Block a user
Delete Branch "fix/maintenance-flag-test-contour"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Диагноз
Оверлей не показался, потому что тест-контур никогда не поднимал maintenance-флаг — его армит только
prod-deploy.sh. Ре-деплой тест-контура = голое пересоздание gateway/backend → SPA видит транзиентный 502 («Reconnecting…»), а НЕ 503-с-маркеромX-Scrabble-Maintenance, по которому строго срабатывает оверлей. На проде фича корректна, но проверить её вне прода было негде — моя недоработка.Фикс
Армлю флаг и в ci-deploy, зеркаля прод. Порядок важен из-за reseed: ci делает
rm -rf $conf+ пересоздаёт каталог, поэтому работающий caddy сидит на СТАРОМ (unlinked) bind-mount и флаг в новом каталоге не видит, пока не пересоздан. Поэтому: поднять флаг → сначала force-recreate caddy (садится на свежий маунт, несёт флаг, 503-ит) → пересоздать gateway/backend (окно) → пересоздать остальное → снять. Trap + reseed следующего деплоя не дают контуру залипнуть в maintenance. Caddy-пробы идут следующим шагом, после снятия.Как проверить после мержа
Открытый SPA должен уже быть на бандле #171 (там код оверлея) — перезагрузи приложение один раз, чтобы подхватить его. Потом любой тест-деплой покажет оверлей на время пересоздания и авто-reload после.
Немедленно, без деплоя (могу прямо сейчас)
На устоявшемся контуре caddy на текущем маунте — я могу вручную поднять флаг (
touch .../caddy/on), ты в открытом (перезагруженном) приложении увидишь оверлей, я сниму → приложение само перезагрузится. Скажи, и продемонстрирую.The maintenance overlay never showed on the test contour: only prod-deploy.sh raised the caddy maintenance flag, so a test redeploy was a bare gateway/backend recreate — the SPA saw a transient 502 ("Reconnecting…"), never the 503 + X-Scrabble-Maintenance marker the overlay keys on. So the feature (PR #171) was unverifiable off prod. Raise the flag around the recreate in ci.yaml's deploy job too, mirroring prod. Ordering matters because of the config reseed: ci does `rm -rf $conf` + recreate, so the running caddy sits on the stale pre-reseed bind mount and cannot see a flag written to the new dir until it is recreated. So: raise the flag, force-recreate caddy FIRST (onto the fresh mount, where it carries the flag and 503s), then recreate gateway/backend (the window), then the other config services, then lower it. A trap clears the flag if the step fails, and the next deploy's reseed wipes a stale one — so the contour can't stick in maintenance. The caddy-routed probes run in the next step, after the flag is lowered. Prod was already correct (prod-deploy.sh); this only makes the test contour faithful so the overlay + reload can be seen there. An open SPA must already be on the PR-#171 bundle (which carries the overlay code) — reload once to bootstrap onto it.