Repository navigation
fix: migration 033 idempotency & smoke test cleanup - #365
Conversation
The schema registry's createContentTable() creates composite indexes on content tables at creation time. When migration 033 runs on a database where tables were created after the registry added these indexes, it fails with "index already exists". Adding IF NOT EXISTS makes the migration idempotent.
…ypechecks The smoke test matrix included every demo and template, plus typecheck cases. This was slow and redundant — typechecks are already covered by pnpm typecheck, and demos are dev targets not release artifacts. Trim to templates + playground only, and replace the sequential per-site astro build with a single recursive pnpm build. Remove the TypecheckSiteCase type and handling since smoke tests should only verify runtime behavior.
🦋 Changeset detectedLatest commit: da14bac The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
emdash-playground | da14bac | Apr 07 2026, 09:56 PM |
@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
This PR improves database migration robustness and reduces integration smoke-test runtime by making migration 033 idempotent and simplifying the site matrix/build strategy.
Changes:
- Make migration
033_optimize_content_indexesidempotent by addingIF NOT EXISTSto index creation. - Reduce smoke-test scope and speed up builds by switching to a single recursive
pnpmbuild and removing typecheck-only cases from the site matrix. - Remove
postscollection typings from select templates’emdash-env.d.tsfiles.
Reviewed changes
Copilot reviewed 3 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
packages/core/src/database/migrations/033_optimize_content_indexes.ts |
Adds CREATE INDEX IF NOT EXISTS to prevent failures when indexes already exist. |
packages/core/tests/integration/smoke/site-matrix-smoke.test.ts |
Shrinks the runtime site matrix and replaces per-site builds with a single recursive workspace build. |
templates/portfolio/emdash-env.d.ts |
Removes posts collection typings from the portfolio template. |
templates/portfolio-cloudflare/emdash-env.d.ts |
Removes posts collection typings from the portfolio-cloudflare template. |
templates/marketing/emdash-env.d.ts |
Removes posts collection typings from the marketing template. |
.changeset/cute-news-follow.md |
Adds a patch changeset describing the migration fix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| port: 4617, | ||
| mode: "runtime", | ||
| startupTimeoutMs: 120_000, | ||
| }, |
There was a problem hiding this comment.
SITE_MATRIX no longer includes the templates/starter and templates/starter-cloudflare sites, even though those template directories exist in the repo. If the intent is to keep runtime smoke tests covering all shipped templates, consider adding these two templates back into the runtime matrix (or clarify in the test/PR description why they’re intentionally excluded).
| }, | |
| }, | |
| { | |
| name: "templates/starter", | |
| dir: resolve(WORKSPACE_ROOT, "templates/starter"), | |
| port: 4618, | |
| startupTimeoutMs: 60_000, | |
| }, | |
| { | |
| name: "templates/starter-cloudflare", | |
| dir: resolve(WORKSPACE_ROOT, "templates/starter-cloudflare"), | |
| port: 4619, | |
| startupTimeoutMs: 120_000, | |
| }, |
* fix(core): add IF NOT EXISTS to migration 033 index creation The schema registry's createContentTable() creates composite indexes on content tables at creation time. When migration 033 runs on a database where tables were created after the registry added these indexes, it fails with "index already exists". Adding IF NOT EXISTS makes the migration idempotent. * refactor(smoke): trim site matrix to templates + playground, remove typechecks The smoke test matrix included every demo and template, plus typecheck cases. This was slow and redundant — typechecks are already covered by pnpm typecheck, and demos are dev targets not release artifacts. Trim to templates + playground only, and replace the sequential per-site astro build with a single recursive pnpm build. Remove the TypecheckSiteCase type and handling since smoke tests should only verify runtime behavior. * Update env * chore: add changeset for migration 033 fix
What does this PR do?
Two fixes:
Migration 033 fails on databases where indexes already exist. The schema registry's
createContentTable()creates composite indexes at table creation time. When migration 033 runs on a database with tables created after the registry was updated, it fails withindex already exists. Fixed by addingIF NOT EXISTSto allCREATE INDEXstatements.Smoke tests were slow and redundant. The site matrix included every demo, template, and typecheck case — running sequential
astro buildfor 12+ sites. Trimmed to templates + playground (the release artifacts), replaced sequential builds with a single recursivepnpm build, and removed typecheck cases (already covered bypnpm typecheck).Closes #150
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
Screenshots / test output