feat(config): gate MySQL-only features for postgres targets - #993
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds explicit gating for MySQL-dialect-only features (pending drops, deferred cutover) so Postgres targets fail early with a named-feature error rather than falling through to a generic “no engine” style failure.
Changes:
- Introduces
schema.SupportsFeature(databaseType, feature)andFeatureidentifiers to centralize dialect feature support checks. - Adds
validateDatabaseFeatures(...)and hooks it into server config validation and apply queueing. - Expands tests to cover the new feature predicate and validation behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/schema/dialect.go | Adds feature identifiers and a predicate to check feature support per database type/dialect. |
| pkg/schema/dialect_test.go | Adds unit coverage for SupportsFeature across supported/unsupported database types/features. |
| pkg/api/plan_handlers.go | Adds apply-time gating for unsupported feature usage based on plan/request options. |
| pkg/api/config.go | Adds config-time validation helper to reject unsupported feature + database type combinations. |
| pkg/api/config_test.go | Updates config validation coverage and adds tests for validateDatabaseFeatures. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Pending drops and deferred cutover are Spirit/MySQL semantics. Fail closed with a named-feature error at config validation and apply request time for postgres databases instead of the generic no-engine error. MySQL and Vitess behavior is unchanged.
Scope feature checks to apply options so existing PostgreSQL configs remain valid.
Kiran01bm
force-pushed
the
kiran01bm/pg-capability-gating
branch
from
August 10, 2026 08:00
5824604 to
c384cea
Compare
Kiran01bm
marked this pull request as ready for review
August 10, 2026 08:21
Kiran01bm
requested review from
JashLal,
aparajon,
eeSeeGee,
jayjanssen,
jemiahw and
morgo
as code owners
August 10, 2026 08:21
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
morgo
approved these changes
Aug 10, 2026
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.
Summary
Gates deferred cutover — a MySQL-dialect feature — at apply request time with a typed, named-feature rejection instead of the generic no-engine failure that postgres targets previously fell through to. Also corrects Strata's advertised capability: it never executed deferred cutover, so it no longer claims it. MySQL and Vitess behavior is unchanged.
What
pkg/schema/dialect.go:SupportsFeature(databaseType, feature)— deferred cutover is supported by MySQL and Vitess only; unknown database types and unknown features fail closed.pkg/api/plan_handlers.go: apply queueing rejects a deferred-cutover request against an unsupported target with a typedUnsupportedFeatureError, translated to HTTP 400invalid_requestnaming the feature and database (previously a 500). Span status, apply metric, and triage log context are recorded on rejection.pkg/webhook: the apply PR comment renders the actionable named-feature message instead of a generic failure.Why
Deferred cutover is a semantic of the Spirit/MySQL engine (gh-ost-style cutover deferral); it has no meaning for the planned Postgres engine's native path. Until the feature has a Postgres design of its own, the honest behavior is an explicit "not supported for this database type" at the earliest point the intent is visible — the apply request — not a generic routing error at execution time. The gate is additive: no engine exists for postgres yet, so nothing that works today changes.