Conversation
|
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
emdash-playground | ded9146 | Apr 07 2026, 10:59 AM |
@emdash-cms/admin
@emdash-cms/auth
@emdash-cms/blocks
@emdash-cms/cloudflare
emdash
create-emdash
@emdash-cms/gutenberg-to-portable-text
@emdash-cms/x402
@emdash-cms/plugin-ai-moderation
@emdash-cms/plugin-atproto
@emdash-cms/plugin-audit-log
@emdash-cms/plugin-color
@emdash-cms/plugin-embeds
@emdash-cms/plugin-forms
@emdash-cms/plugin-webhook-notifier
commit: |
There was a problem hiding this comment.
Pull request overview
Refactors the core database migration runner to centralize the migration registry and exposes a derived migration count so tests no longer hardcode the expected number of migrations.
Changes:
- Hoists the static migrations map in
runner.tsto a module-level constant and exportsMIGRATION_COUNT. - Updates migration-related tests to assert against
MIGRATION_COUNTinstead of hardcoded lengths.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/core/src/database/migrations/runner.ts | Introduces module-level MIGRATIONS and exports MIGRATION_COUNT; StaticMigrationProvider now returns the shared map. |
| packages/core/tests/integration/database/migrations.test.ts | Replaces hardcoded migration record counts with MIGRATION_COUNT. |
| packages/core/tests/integration/database/dialect-compat.test.ts | Replaces hardcoded migration record counts with MIGRATION_COUNT across dialect tests. |
| packages/core/tests/database/migrations.test.ts | Replaces hardcoded applied/record counts with MIGRATION_COUNT. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Overlapping PRsThis PR modifies files that are also changed by other open PRs:
This may cause merge conflicts or duplicated work. A maintainer will coordinate. |
What does this PR do?
Extracts the migrations map from inside
StaticMigrationProvider.getMigrations()to a module-levelconst, and exports aMIGRATION_COUNTderived fromObject.keys(). The three migration test files now importMIGRATION_COUNTinstead of hardcoding the number.Before, every new migration required updating 5 separate
toHaveLength(N)calls across 3 files. Now it requires no test changes at all — the count is always derived from the source of truth.Type of change
Checklist
pnpm typecheckpassespnpm --silent lint:json | jq '.diagnostics | length'returns 0pnpm testpasses (or targeted tests for my change)pnpm formathas been runAI-generated code disclosure