Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
feat(backend): gh-ost feature gate (#1697)
p0ny0e6409cc26da
diff --git a/api/plan.go b/api/plan.goindex 0c92a9a814..af485b6e5a 100644--- a/api/plan.go+++ b/api/plan.go@@ -64,6 +64,9 @@ const (// - Support defining extra data source for a database and exposing the related data source UI.FeatureDataSource FeatureType = "bb.feature.data-source"+ // FeatureGhost allows user to use gh-ost for MySQL database migration.+ FeatureGhost FeatureType = "bb.feature.ghost"+// Policy Control// FeatureApprovalPolicy allows user to specify approval policy for the environment@@ -114,6 +117,8 @@ func (e FeatureType) String() string {return "bb.feature.dba-workflow"case FeatureDataSource:return "bb.feature.data-source"+ case FeatureGhost:+ return "bb.feature.ghost"case FeatureApprovalPolicy:return "bb.feature.approval-policy"case FeatureBackupPolicy:@@ -143,6 +148,8 @@ func (e FeatureType) Name() string {return "DBA workflow"case FeatureDataSource:return "Data source"+ case FeatureGhost:+ return "gh-ost integration"case FeatureApprovalPolicy:return "Approval policy"case FeatureBackupPolicy:@@ -183,6 +190,7 @@ var FeatureMatrix = map[FeatureType][3]bool{"bb.feature.multi-tenancy": {false, true, true},"bb.feature.dba-workflow": {false, false, true},"bb.feature.data-source": {false, false, false},+ "bb.feature.ghost": {false, true, true},"bb.feature.approval-policy": {false, true, true},"bb.feature.backup-policy": {false, true, true},"bb.feature.schema-review-policy": {false, true, true},diff --git a/server/issue.go b/server/issue.goindex f41b63c263..a81dd062b4 100644--- a/server/issue.go+++ b/server/issue.go@@ -799,6 +799,9 @@ func (s *Server) getPipelineCreate(ctx context.Context, issueCreate *api.IssueCrreturn create, nilcase api.IssueDatabaseSchemaUpdateGhost:+ if !s.feature(api.FeatureGhost) {+ return nil, echo.NewHTTPError(http.StatusForbidden, api.FeatureGhost.AccessErrorMessage())+ }c := api.UpdateSchemaGhostContext{}if err := json.Unmarshal([]byte(issueCreate.CreateContext), &c); err != nil {return nil, err