Repository navigation
feat: migrate generate/verify and test smoke for pre-deploy checks - #143
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 ifmigration:generate --checkstill finds changes.apso test smoke: builds, syncs a PGlite database, startsdist/mainon a free port, and calls/healthplus every entity's list endpoint. With auth configured, only/health.Verified
migrate generateagainst the pre-index deploy produced the same 21CREATE INDEXstatements the editor generated and the deploy ran.migrate verifypassed. Removing oneCREATE INDEXmade the drift step fail and name the missing index. Generate with the current schema as baseline reported no migration needed.test smokepassed on all 12 entities. A server that throws on boot fails thestartstep with its log.scripts/scaffold-smoke.sh typescriptnow runs smoke, then adds a field and runs generate + verify; passes locally on a freshapso initproject (57s total).Not included: create/read/delete in the smoke test (needs payloads built from required fields and relationships); Python/Go.