feat(make): doctor menu diagnostyczne + deploy bez auto-testów#13
Merged
Conversation
Deploy (make run) nie wysyla juz automatycznie testowych maili ani nie testuje Rollbara - diagnostyke uruchamiasz na zadanie. - run: usuniety prereq test-email; hint -> make doctor - test-email: rozlaczony od test-rollbar (kazdy test robi jedna rzecz) - test-ntfy: kanoniczny cel (symetria z test-email/test-rollbar); ntfy-test zostaje jako deprecated alias (backwards-compat) - doctor: interaktywne menu (mail/ntfy/rollbar/health/backup/wszystko) przez nowy scripts/doctor.sh + mk/doctor.mk; routuje przez make (single source of truth dla straznikow env i komend docker). Tryb nieinteraktywny: doctor.sh mail|ntfy|rollbar|health|backup|all - test-doctor: unit-testy doctor.sh (mock make), 19/19 PASS - help + docs (komendy, monitoring) zsynchronizowane; mkdocs --strict OK Spec: docs/superpowers/specs/2026-06-22-make-doctor-diagnostics-design.md Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
mpasternak
added a commit
that referenced
this pull request
Jun 30, 2026
`make up` (i `make run` przez zaleznosc) konczy sie lekka, read-only bramka
scripts/post-deploy-check.sh. Po `docker compose up --wait` healthchecked uslugi
sa juz zdrowe; bramka lapie to, co moglo pasc PO --wait albo czego --wait nie
pilnuje: usluge `unhealthy` lub `restarting` (crash-loop, takze bez healthchecka).
Zachowanie:
- wszystko OK -> "✓ Wszystkie uslugi zdrowe." + exit 0 (cicho),
- problem + TTY -> prompt [s] shell / [d] make doctor / [klawisz] wyjscie
(auto za 30s), exit 1,
- problem + nie-TTY -> wypis + exit 1 bez pytania (CI/cron/`| tee`),
- blad samej bramki -> fail-open (exit 0), nigdy nie blokuje deployu.
Bramkuje TYLKO na stanie kontenerow (NIE na grepie bledow w logach). `exited`
swiadomie NIE flagowane (lapaloby on-demand backup-runner). Read-only: NIE
wysyla maili/pushy/Rollbara — te zostaja opt-in w `make doctor` (intencja PR #13).
up-quick celowo bez bramki.
Opt-out BPP_SKIP_HEALTH_GATE=1 dla wewnetrznej automatyki wolajacej `make up` pod
`set -e` — bez tego transient flap zdrowia tuz po restarcie przerwalby sekwencje
(np. `make up` przed `make migrate` w upgrade-postgres.sh) albo prompt zawisalby
w TTY-bez-czlowieka. Ustawiaja go: scripts/upgrade-postgres.sh (krok 10, przed
migrate) i scripts/restore.sh. `read -t 30` dodatkowo chroni przed zawieszeniem
w PTY-bez-czlowieka (ssh -t / Ansible). Blad `docker compose ps` -> fail-open,
ale BEZ falszywego "zdrowe" (nie twierdzimy zdrowia, ktorego nie sprawdzilismy).
Prompt na stderr + read ze stdin -> dziala takze przy `make up | tee deploy.log`.
Testy: scripts/test-post-deploy-check.sh (mock docker compose ps + make; sciezki
OK/unhealthy/restarting/exited/pusty/blad-ps/opt-out), cel `make test-post-deploy-check`.
Zwalidowane: bash -n, shellcheck, unit-testy 7/7, smoke-test na realnym dockerze
(szablon ps + wykrycie unhealthy), test-doctor 19/19 bez regresji, mkdocs --strict.
Docs: notka w docs/eksploatacja/komendy.md + kontrakt w CLAUDE.md (Safety).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Po co
Po każdym deployu (
make run) wysyłały się testowe maile i odpalał się test Rollbara — uciążliwe (zalewa skrzynkę/Rollbar przygit pull && make up). Teraz operator wybiera, co i kiedy przetestować.Zmiany
make run— usunięty prereqtest-email; kończy się hintem→ make doctor.test-email— rozłączony odtest-rollbar(znikła linia$(MAKE) test-rollbar). Każdy test robi dokładnie jedną rzecz.test-ntfy— kanoniczny cel (symetria ztest-email/test-rollbar).ntfy-testzostaje jako deprecated alias (kontrakt backwards-compat — stare skrypty/pamięć działają).make doctor— interaktywne menu (scripts/doctor.sh+mk/doctor.mk):mail / ntfy / rollbar / health / backup / wszystko / q.healthibackup(backup-cycle: pg_dump+media+rclone+Rollbar) jako osobne pozycje.make test-*→ single source of truth dla strażników env i komend docker.bash scripts/doctor.sh mail|ntfy|rollbar|health|backup|all.make test-doctor— unit-testydoctor.sh(mockmake, wzorzec jaktest-letsencrypt).Weryfikacja
make test-doctor— 19/19 PASSmkdocs build --strict— exit 0make -n doctor/test-doctor/test-ntfy/ntfy-test/runparsują się;runnie zawieratest-emaildocs/eksploatacja/komendy.md(nowa sekcja Diagnostyka) +docs/monitoring/*zsynchronizowane (skill docs-sync).Spec:
docs/superpowers/specs/2026-06-22-make-doctor-diagnostics-design.md🤖 Generated with Claude Code