[codex] Add configurable MySQL OSC executors#28
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (14)
📝 WalkthroughWalkthroughThis change implements full-stack support for MySQL online DDL executors (gh-ost and pt-online-schema-change), adding system configuration for binary paths, frontend UI for executor selection, backend DDL analysis and compatibility resolution, and API routing for executor-aware workflow execution and scheduling. Changes
Sequence DiagramsequenceDiagram
participant UI as Frontend UI
participant API as Workflow API
participant Engine as MySQL Engine
participant DDLSvc as DDL Executor Service
participant Tool as External DDL Tool
UI->>API: POST execute/schedule with executor selection
API->>Engine: execute_workflow(..., execution_options={executor})
Engine->>Engine: Detect DDL-only workflow
alt DDL-only detected
Engine->>DDLSvc: resolve_ddl_executor(workflow, executor_id)
DDLSvc->>DDLSvc: Inspect available executors & blockers
alt Executor available
DDLSvc->>DDLSvc: Validate executor compatibility
DDLSvc-->>Engine: Return resolved executor
Engine->>DDLSvc: execute_external_ddl_workflow(...)
DDLSvc->>Tool: Run tool subprocess with SQL
Tool-->>DDLSvc: Return execution result
DDLSvc-->>Engine: ReviewResult with executor_id
else Executor unavailable
DDLSvc-->>Engine: Raise MysqlDDLExecutorError
Engine-->>API: Error response
API-->>UI: Display error & blockers
end
else Non-DDL or no executor needed
Engine->>Engine: Execute via standard flow
end
Engine-->>API: ReviewSet with executor context
API-->>UI: Workflow status & execution info
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| try: | ||
| return validate_binary_path(value, "gh-ost") | ||
| except ValueError as exc: | ||
| raise serializers.ValidationError(str(exc)) |
| try: | ||
| return validate_binary_path(value, "pt-online-schema-change") | ||
| except ValueError as exc: | ||
| raise serializers.ValidationError(str(exc)) |
| preflight=True, | ||
| ) | ||
| except MysqlDDLExecutorError as exc: | ||
| raise serializers.ValidationError({"errors": str(exc)}) |
| preflight=True, | ||
| ) | ||
| except MysqlDDLExecutorError as exc: | ||
| raise serializers.ValidationError({"errors": str(exc)}) |
Summary
Add MySQL DDL executor support for
direct,gh-ost, andpt-online-schema-change, with configurable binary paths, compatibility checks, API plumbing, UI selection, and end-to-end coverage.What Changed
sql/engines/mysql_ddl.pyto inspect, resolve, preflight, and execute MySQL schema changes throughdirect,gh-ost, orpt-oscgh_ostandpt_oscbinary locationsWhy
Online schema change support needs to respect tool-specific limitations instead of treating all MySQL DDL the same. This change makes executor choice explicit and safe, and it establishes a structure that can be extended with additional tools later.
Root Cause
Previously, MySQL DDL execution only had the direct path, so there was no safe way to route schema changes through online schema change tools or surface compatibility constraints in the product.
Impact
Users can now:
gh-ostandpt-oscbinary paths in system settingsValidation
black --check .npm run buildinfrontend/docker exec datamingle-app python manage.py test sql.engines.tests.TestMysqlDDLExecutorService sql_api.tests.TestWorkflowE2E_START_FRONTEND=1 bash scripts/e2e/run-local-playwright.shSummary by CodeRabbit