Skip to content

feat(dashboard-agent-db): add a pending-migration status check#4037

Merged
ericallam merged 1 commit into
mainfrom
feat/dashboard-agent-db-migrate-status
Jun 25, 2026
Merged

feat(dashboard-agent-db): add a pending-migration status check#4037
ericallam merged 1 commit into
mainfrom
feat/dashboard-agent-db-migrate-status

Conversation

@ericallam

Copy link
Copy Markdown
Member

Summary

Adds migrate-status.mjs to @internal/dashboard-agent-db: a pending-migration status check for the trigger_dashboard_agent schema, exposed as db:migrate:status.

It reads the committed journal and compares it against the drizzle.__dashboard_agent_migrations table, then exits 0 when the schema is up to date and 1 when migrations are pending (2 on error). This lets a deploy pipeline check first and only gate + run migrate.mjs when 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_URL fallback, ?schema= stripped, pooler-safe prepare: false), and it queries the journal table directly so it needs no drizzle-kit and runs under plain node in the built image.

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.
@changeset-bot

changeset-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 4200cae

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 2c5190f1-0109-43a7-ae18-8d2e7bfee9b8

📥 Commits

Reviewing files that changed from the base of the PR and between 82bdd1f and 4200cae.

📒 Files selected for processing (2)
  • internal-packages/dashboard-agent-db/migrate-status.mjs
  • internal-packages/dashboard-agent-db/package.json
📜 Recent review details
⏰ Context from checks skipped due to timeout. (25)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (12, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (6, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (11, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (9, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (8, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (7, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (8, 10)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (10, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (4, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (7, 10)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (2, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (5, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (5, 10)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (1, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (10, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (1, 10)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (3, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (4, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (6, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (2, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (9, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (3, 10)
  • GitHub Check: typecheck / typecheck
  • GitHub Check: e2e-webapp / 🧪 E2E Tests: Webapp
  • GitHub Check: Analyze (javascript-typescript)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,ts,tsx,jsx,css,json,md}

📄 CodeRabbit inference engine (AGENTS.md)

Use Prettier for code formatting and run pnpm run format before committing

Files:

  • internal-packages/dashboard-agent-db/package.json
🔇 Additional comments (2)
internal-packages/dashboard-agent-db/migrate-status.mjs (1)

1-76: LGTM!

internal-packages/dashboard-agent-db/package.json (1)

20-20: LGTM!


Walkthrough

Adds a new migrate-status.mjs script for the dashboard agent database that reads the Drizzle journal, compares it with __dashboard_agent_migrations, reports pending migration counts and tags, and exits with status codes for up-to-date, pending, or error states. It also adds a db:migrate:status npm script in package.json.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description only has a Summary and omits the required issue link, checklist, Testing, Changelog, and Screenshots sections. Add the template sections: Closes #, checklist items, testing steps, changelog, and screenshots or a clear note that none are needed.
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately describes the new migration status check added to dashboard-agent-db.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/dashboard-agent-db-migrate-status

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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ericallam ericallam marked this pull request as ready for review June 25, 2026 12:05

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@ericallam ericallam merged commit 5379b74 into main Jun 25, 2026
46 checks passed
@ericallam ericallam deleted the feat/dashboard-agent-db-migrate-status branch June 25, 2026 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants