feat(dashboard-agent-db): add a pending-migration status check#4037
Conversation
migrate-status.mjs reports whether the trigger_dashboard_agent schema has unapplied migrations (exit 0 = up to date, 1 = pending), so a deploy pipeline can check before gating and running migrate.mjs. Sibling of migrate.mjs: same connection handling, queries the journal table directly, exposed as db:migrate:status.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📜 Recent review details⏰ Context from checks skipped due to timeout. (25)
🧰 Additional context used📓 Path-based instructions (1)**/*.{js,ts,tsx,jsx,css,json,md}📄 CodeRabbit inference engine (AGENTS.md)
Files:
🔇 Additional comments (2)
WalkthroughAdds a new 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed: private package registry requires authentication. Disable ESLint in CodeRabbit settings or use public packages. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Adds
migrate-status.mjsto@internal/dashboard-agent-db: a pending-migration status check for thetrigger_dashboard_agentschema, exposed asdb:migrate:status.It reads the committed journal and compares it against the
drizzle.__dashboard_agent_migrationstable, then exits0when the schema is up to date and1when migrations are pending (2on error). This lets a deploy pipeline check first and only gate + runmigrate.mjswhen there is actually something to apply, matching how the other migration sets work.It's the sibling of
migrate.mjs: same connection handling (DASHBOARD_AGENT_DATABASE_URLfallback,?schema=stripped, pooler-safeprepare: false), and it queries the journal table directly so it needs nodrizzle-kitand runs under plainnodein the built image.