Skip to content

feat: migrate generate/verify and test smoke for pre-deploy checks - #143

Merged
cultron merged 1 commit into
mainfrom
feat/migrate-verify-smoke
Oct 4, 2026
Merged

cultron merged 1 commit into
mainfrom
feat/migrate-verify-smoke

Conversation

@cultron

@cultron cultron commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Pre-deploy checks for TypeScript services, run against PGlite. The in-browser editor runs the CLI in a WebContainer and will call these instead of its own copy of the migration steps, so the CLI and the editor check deploys the same way.

Commands (all take --json):

  • apso migrate generate --baseline <deployed .apsorc>: scaffolds the deployed schema in a temp copy of the project (shared node_modules), schema:syncs it into PGlite, and generates the TypeORM migration to this project's entities. Reports "no migration needed" when nothing changed.
  • apso migrate verify --baseline <file> --migration <file>: runs only that migration on a fresh baseline (so migrations the deployed database already ran are not replayed), then fails if migration:generate --check still finds changes.
  • apso test smoke: builds, syncs a PGlite database, starts dist/main on a free port, and calls /health plus every entity's list endpoint. With auth configured, only /health.

Verified

  • Customer CRM (staging svc 4720, real repo): migrate generate against the pre-index deploy produced the same 21 CREATE INDEX statements the editor generated and the deploy ran. migrate verify passed. Removing one CREATE INDEX made the drift step fail and name the missing index. Generate with the current schema as baseline reported no migration needed. test smoke passed on all 12 entities. A server that throws on boot fails the start step with its log.
  • scripts/scaffold-smoke.sh typescript now runs smoke, then adds a field and runs generate + verify; passes locally on a fresh apso init project (57s total).
  • Lint (0 errors), tsc, 366 unit tests pass.

Not included: create/read/delete in the smoke test (needs payloads built from required fields and relationships); Python/Go.

Pre-deploy checks for TypeScript services, against PGlite, shared with the
in-browser editor (which runs the CLI in a WebContainer):
- apso migrate generate --baseline <deployed .apsorc>: scaffold the deployed
  schema in a copy of the project, schema:sync it, and generate the migration
  to this project's entities.
- apso migrate verify --baseline <file> --migration <file>: run only that
  migration on a fresh baseline, then fail if migration:generate --check
  still finds changes.
- apso test smoke: start the built service and call /health and every
  entity's list endpoint.
All take --json. The scaffold smoke workflow now runs all three.
@cultron
cultron merged commit 2b3da35 into main Oct 4, 2026
4 checks passed
@cultron
cultron deleted the feat/migrate-verify-smoke branch October 4, 2026 16:16
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.

1 participant