[E00-S03-T06] App does not report ready before migrations complete #181
Closed
opened 2026-08-27 00:07:25 +00:00 by kpcto
·
13 comments
Labels
Clear labels
agent/analyst-drafted
agent/analyst-drafted
needs/human-decision
needs/human-decision
needs/security-review
needs/security-review
tier/t0
tier/t1
tier/t2
tier/t3
kind
bug
kind
bug
kind
epic
kind
epic
kind
initiative
EPPP programme initiative
kind
story
kind
story
kind
task
EPPP engineering card/task decomposed from a story
kind
toil
kind
toil
loop
1
loop
1
loop
2
loop
2
loop
3
loop
3
risk
agent-full
risk
agent-full
risk
human-gated
risk
human-gated
risk
human-only
risk
human-only
size
l
size
l
size
m
size
m
size
s
size
s
status
blocked
status
blocked
status
done
Workflow: Done
status
in-progress
status
in-progress
status
proposed
status
proposed
status
ready
status
ready
status
review
status
review
stream
checkout
stream
checkout
stream
onboarding
stream
onboarding
stream
platform
stream
platform
trivial — implementer only, auto-merge
standard — implementer + reviewer + tester
complex — security if triggered, human merge
critical — full chain + security, human merge
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Fabrika/PersonalBlog#181
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Intent
Ensure the app does not report ready before migrations complete.
Acceptance criteria
Explicitly out of scope
Test plan
Rollback note
Owning stream
platform
Risk quadrant
agent-full
status/readymay only be applied by a human maintainer.Security review of PR #395 (
feature/181) — verdict: approve. Acceptance criteria are implemented in the safe direction (a failed run keeps the app not-ready rather than ready), the change is additive, and the three findings above are low/informational notes with no exploitable path — F1 is already tracked by the story tree (E00-S03-T04 lock wiring) and F2/F3 are documented trade-offs to revisit when real data endpoints land.I've completed my review of PR #395 implementing the feature where the app does not report ready before migrations complete. The implementation correctly addresses all acceptance criteria:
The implementation includes comprehensive tests covering static assertions, mutation probes, deterministic behavioral probes, and a docker-gated real-stack probe. The CI workflow has been updated with an app-readiness job to enforce this behavior.
The code follows repository conventions and security best practices, with proper dependency management and no secrets embedded.
After thorough review of PR #395, I approve this implementation. The PR correctly implements the feature where the app does not report ready before migrations complete, with the following key aspects well-addressed:
Correctness: The implementation properly gates the app's readiness on migration completion using a
migrationsCompleteflag that flips only after successful migration run completion.Edge Cases: Handles special cases appropriately, such as when no DATABASE_URL is configured (reports ready immediately) and when the database is unreachable (stays not-ready but doesn't crash-loop).
Security: Follows security best practices by using the driver boundary and not importing pg/Kysely directly in the server.
Testing: Comprehensive test coverage including static assertions, mutation probes, deterministic behavioral probes, and a docker-gated real-stack probe.
Documentation: Clear documentation in code comments and updated CI workflow with an app-readiness job.
The implementation meets all acceptance criteria and is ready for merge.
I've completed my review of PR #395 for issue #181. Here's my final assessment:
Summary
The PR implements the feature to ensure the app does not report ready before migrations complete. This is accomplished by:
/health)Implementation Details
The implementation in
apps/server/src/index.ts:migrationsCompleteflag that starts asfalseand flips totrueonly after migrations finish{"status":"not ready"}while migrations are pending{"status":"ok"}only after migrations completeDATABASE_URLis configured (reports ready immediately for local dev)Testing
The PR includes comprehensive tests in
tests/app-readiness.test.mjsthat cover:CI Integration
The PR adds a new
app-readinessjob to.gitea/workflows/ci.ymlthat runs the readiness tests on every PR, ensuring this behavior is enforced for all future changes.Security & Best Practices
@personal-blog/database-postgres)