Let callers run deferred workspace migration actions in process
Prerequisite for removing IS_DEFERRED_WORKSPACE_MIGRATION_ACTIONS_ENABLED.
Deferred mode persists the slow parts of a migration (join column index builds, foreign key validation, workflow run and logic function cleanup) and leaves them to the worker. It also blocks the next schema-affecting migration until those actions finish. That suits a user editing their data model. It breaks callers that run many migrations back to back or run without a worker: with the flag on, seeding a workspace queues 152 actions and the very next createOneObject is rejected.
What changes
WorkspaceMigrationRunnerService.runand everyWorkspaceMigrationValidateBuildAndRunService.validateBuildAndRun*method take an optionalshouldDeferActions(defaulttrue), threaded the same way asdryRun.ObjectMetadataService.createOneObject,FieldMetadataService.createManyFieldsandupdateOneFieldaccept and forward it.- The standard app sync passes
shouldDeferActions: false. It only runs at workspace creation and seeding, where more migrations follow right away. - The dev seeder passes
shouldDeferActions: falseon its object and field calls, since seeding runs without a worker. - The runner defers only when the flag is on and
shouldDeferActionsresolves totrue. Otherwise it behaves as it does today with the flag off: indexes and foreign keys are built and validated inline, cleanup actions run right after commit. - The index and field handlers read
shouldDeferActionsfrom the runner context instead of the feature flag map.featureFlagsMapis dropped from that context since this flag was its only consumer.
No behaviour change while the flag stays on its current rollout. Upgrade and workspace commands keep the default: committed upgrade commands can't be edited, so they defer on flagged workspaces and rely on a running worker. New commands can pass shouldDeferActions: false.