feat(workflow-executor): add migrate command and --skip-migrations#1700
Open
Scra3 wants to merge 1 commit into
Open
feat(workflow-executor): add migrate command and --skip-migrations#1700Scra3 wants to merge 1 commit into
Scra3 wants to merge 1 commit into
Conversation
1 new issue
|
Decouple migrations from boot without adding boot-time locking. Default behaviour is unchanged (auto-migrate on start, no concurrency handling). - `migrate` runs migrations then exits (one-shot for CI/release): Runner.migrate applies migrations and closes the connection, no agent probe / server / polling. - `--skip-migrations` boots without migrating (Runner.start skips runStore.init), for instances behind a pipeline that already ran `migrate`. Multi-instance deployments run `migrate` once then start N instances with --skip-migrations: zero boot-time race, no lock needed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
c8469f6 to
1d77bb3
Compare
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.
What
Three boot modes for the executor — progressive disclosure, no boot-time lock:
Why
Migrations run inside every booting instance (
Runner.start()→runStore.init()). For a single instance (demos/staging) that's fine; for N concurrent boots they race onSequelizeMeta. Rather than add boot-time locking plumbing, let serious deployments decouple: runmigrateonce in CI, then start N instances with--skip-migrations→ zero race, no lock.The default is deliberately left with no concurrency handling — simple by default, controllable when needed.
How
Runner:skipMigrations?config —start()skipsrunStore.init()when set. Newmigrate()applies migrations then closes the connection (no agent probe, no server, no polling) so the one-shot process exits.build-workflow-executor:skipMigrations?onExecutorOptionsthreaded to the runner;migrate()exposed onWorkflowExecutor.cli-core:migratepositional command +--skip-migrationsflag;runCliroutesmigratetoexecutor.migrate()(does not start the server). Help + README updated.One migration code path (
runStore.init()), two entry points. No new dependency, no advisory lock, no transaction gymnastics.Tests
parseArgs:migrateand--skip-migrations; unknown args still throw.runCli:migratecallsexecutor.migrate()and notstart();--skip-migrationsthreadsskipMigrations: trueinto the build options and still starts.Runner:start()withskipMigrationsdoes not callrunStore.init;migrate()callsinitthencloseand does not probe the agent.🤖 Generated with Claude Code
Note
Add
migratesubcommand and--skip-migrationsflag to workflow-executor CLImigratesubcommand to the CLI that runs database migrations and exits without starting the HTTP server or polling, useful for running migrations separately in concurrent deployments.--skip-migrationsflag that boots the executor without running migrations, intended for use when migrations are applied out-of-band via themigratesubcommand.migrate()method to theRunnerandWorkflowExecutorinterfaces that initializes the run store and closes it without probing the agent or starting normal activities.--skip-migrationsis set, queries will fail if the schema has not been migrated separately.Macroscope summarized 1d77bb3.