Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
refactor: plan check run config (#7740)
p0nyc4f7c64a46bf
diff --git a/backend/api/v1/issue_service.go b/backend/api/v1/issue_service.goindex 65c60bfdf9..a6173d59af 100644--- a/backend/api/v1/issue_service.go+++ b/backend/api/v1/issue_service.go@@ -681,7 +681,7 @@ func (s *IssueService) UpdateIssue(ctx context.Context, request *v1pb.UpdateIssureturn nil, status.Errorf(codes.NotFound, "plan %q not found", *issue.PlanUID)}- planCheckRuns, err := getPlanCheckRunsForPlan(ctx, s.store, plan)+ planCheckRuns, err := getPlanCheckRunsFromPlan(ctx, s.store, plan)if err != nil {return nil, status.Errorf(codes.Internal, "failed to get plan check runs for plan, error: %v", err)}diff --git a/backend/api/v1/rollout_service.go b/backend/api/v1/rollout_service.goindex 0a8ec600a2..f53b75bf62 100644--- a/backend/api/v1/rollout_service.go+++ b/backend/api/v1/rollout_service.go@@ -161,7 +161,7 @@ func (s *RolloutService) CreatePlan(ctx context.Context, request *v1pb.CreatePlareturn nil, status.Errorf(codes.Internal, "failed to create plan, error: %v", err)}- planCheckRuns, err := getPlanCheckRunsForPlan(ctx, s.store, plan)+ planCheckRuns, err := getPlanCheckRunsFromPlan(ctx, s.store, plan)if err != nil {return nil, status.Errorf(codes.Internal, "failed to get plan check runs for plan, error: %v", err)}@@ -346,7 +346,7 @@ func (s *RolloutService) RunPlanChecks(ctx context.Context, request *v1pb.RunPlareturn nil, status.Errorf(codes.NotFound, "plan not found")}- planCheckRuns, err := getPlanCheckRunsForPlan(ctx, s.store, plan)+ planCheckRuns, err := getPlanCheckRunsFromPlan(ctx, s.store, plan)if err != nil {return nil, status.Errorf(codes.Internal, "failed to get plan check runs for plan, error: %v", err)}diff --git a/backend/api/v1/rollout_service_converter.go b/backend/api/v1/rollout_service_converter.goindex d905756086..9eed19d62c 100644--- a/backend/api/v1/rollout_service_converter.go+++ b/backend/api/v1/rollout_service_converter.go@@ -326,28 +326,13 @@ func convertToPlanCheckRun(ctx context.Context, s *store.Store, parent string, rError: run.Result.Error,}- switch config := run.Config.Target.(type) {- case *storepb.PlanCheckRunConfig_DatabaseTarget_:- instanceUID := int(config.DatabaseTarget.InstanceUid)- databaseName := config.DatabaseTarget.DatabaseName- instance, err := s.GetInstanceV2(ctx, &store.FindInstanceMessage{UID: &instanceUID})- if err != nil {- return nil, errors.Wrapf(err, "failed to get instance")- }- converted.Target = fmt.Sprintf("%s%s/%s%s", common.InstanceNamePrefix, instance.ResourceID, common.DatabaseIDPrefix, databaseName)-- case *storepb.PlanCheckRunConfig_DatabaseGroupTarget_:- databaseGroupUID := int64(config.DatabaseGroupTarget.DatabaseGroupUid)- databaseGroup, err := s.GetDatabaseGroup(ctx, &store.FindDatabaseGroupMessage{UID: &databaseGroupUID})- if err != nil {- return nil, errors.Wrapf(err, "failed to get database group")- }- project, err := s.GetProjectV2(ctx, &store.FindProjectMessage{UID: &databaseGroup.ProjectUID})- if err != nil {- return nil, errors.Wrapf(err, "failed to get project")- }- converted.Target = fmt.Sprintf("%s%s/%s%s", common.ProjectNamePrefix, project.ResourceID, common.DatabaseGroupNamePrefix, databaseGroup.ResourceID)+ instanceUID := int(run.Config.InstanceUid)+ databaseName := run.Config.DatabaseName+ instance, err := s.GetInstanceV2(ctx, &store.FindInstanceMessage{UID: &instanceUID})+ if err != nil {+ return nil, errors.Wrapf(err, "failed to get instance")}+ converted.Target = fmt.Sprintf("%s%s/%s%s", common.InstanceNamePrefix, instance.ResourceID, common.DatabaseIDPrefix, databaseName)if run.Config.SheetUid != 0 {sheetUID := int(run.Config.SheetUid)diff --git a/backend/api/v1/rollout_service_plan_check.go b/backend/api/v1/rollout_service_plan_check.goindex 5fdce98f33..fcf7984058 100644--- a/backend/api/v1/rollout_service_plan_check.go+++ b/backend/api/v1/rollout_service_plan_check.go@@ -9,14 +9,15 @@ import ("github.com/bytebase/bytebase/backend/common"api "github.com/bytebase/bytebase/backend/legacyapi""github.com/bytebase/bytebase/backend/store"+ "github.com/bytebase/bytebase/backend/utils"storepb "github.com/bytebase/bytebase/proto/generated-go/store")-func getPlanCheckRunsForPlan(ctx context.Context, s *store.Store, plan *store.PlanMessage) ([]*store.PlanCheckRunMessage, error) {+func getPlanCheckRunsFromPlan(ctx context.Context, s *store.Store, plan *store.PlanMessage) ([]*store.PlanCheckRunMessage, error) {var planCheckRuns []*store.PlanCheckRunMessagefor _, step := range plan.Config.Steps {for _, spec := range step.Specs {- runs, err := getPlanCheckRunsForSpec(ctx, s, plan, spec)+ runs, err := getPlanCheckRunsFromSpec(ctx, s, plan, spec)if err != nil {return nil, errors.Wrapf(err, "failed to get plan check runs for plan")}@@ -26,12 +27,17 @@ func getPlanCheckRunsForPlan(ctx context.Context, s *store.Store, plan *store.Plreturn planCheckRuns, nil}-func getPlanCheckRunsForSpec(ctx context.Context, s *store.Store, plan *store.PlanMessage, spec *storepb.PlanConfig_Spec) ([]*store.PlanCheckRunMessage, error) {+func getPlanCheckRunsFromSpec(ctx context.Context, s *store.Store, plan *store.PlanMessage, spec *storepb.PlanConfig_Spec) ([]*store.PlanCheckRunMessage, error) {switch config := spec.Config.(type) {case *storepb.PlanConfig_Spec_CreateDatabaseConfig:// TODO(p0ny): implementcase *storepb.PlanConfig_Spec_ChangeDatabaseConfig:- return getPlanCheckRunsForSpecWithChangeDatabaseConfigDatabaseTarget(ctx, s, plan, config)+ if _, _, err := common.GetInstanceDatabaseID(config.ChangeDatabaseConfig.Target); err == nil {+ return getPlanCheckRunsFromChangeDatabaseConfigDatabaseTarget(ctx, s, plan, config.ChangeDatabaseConfig)+ }+ if _, _, err := common.GetProjectIDDatabaseGroupID(config.ChangeDatabaseConfig.Target); err == nil {+ return getPlanCheckRunsFromChangeDatabaseConfigDatabaseGroupTarget(ctx, s, plan, config.ChangeDatabaseConfig)+ }case *storepb.PlanConfig_Spec_RestoreDatabaseConfig:var planCheckRuns []*store.PlanCheckRunMessage@@ -61,12 +67,8 @@ func getPlanCheckRunsForSpec(ctx context.Context, s *store.Store, plan *store.PlConfig: &storepb.PlanCheckRunConfig{SheetUid: 0,ChangeDatabaseType: storepb.PlanCheckRunConfig_CHANGE_DATABASE_TYPE_UNSPECIFIED,- Target: &storepb.PlanCheckRunConfig_DatabaseTarget_{- DatabaseTarget: &storepb.PlanCheckRunConfig_DatabaseTarget{- InstanceUid: int32(targetInstance.UID),- DatabaseName: config.RestoreDatabaseConfig.CreateDatabaseConfig.Database,- },- },+ InstanceUid: int32(targetInstance.UID),+ DatabaseName: config.RestoreDatabaseConfig.CreateDatabaseConfig.Database,},})} else {@@ -108,12 +110,8 @@ func getPlanCheckRunsForSpec(ctx context.Context, s *store.Store, plan *store.PlConfig: &storepb.PlanCheckRunConfig{SheetUid: 0,ChangeDatabaseType: storepb.PlanCheckRunConfig_CHANGE_DATABASE_TYPE_UNSPECIFIED,- Target: &storepb.PlanCheckRunConfig_DatabaseTarget_{- DatabaseTarget: &storepb.PlanCheckRunConfig_DatabaseTarget{- InstanceUid: int32(instance.UID),- DatabaseName: database.DatabaseName,- },- },+ InstanceUid: int32(instance.UID),+ DatabaseName: database.DatabaseName,},})}@@ -125,85 +123,119 @@ func getPlanCheckRunsForSpec(ctx context.Context, s *store.Store, plan *store.Plreturn nil, nil}-func getPlanCheckRunsForSpecWithChangeDatabaseConfigDatabaseTarget(ctx context.Context, s *store.Store, plan *store.PlanMessage, config *storepb.PlanConfig_Spec_ChangeDatabaseConfig) ([]*store.PlanCheckRunMessage, error) {- configTarget, err := func() (*storepb.PlanCheckRunConfig, error) {- if instanceID, databaseName, err := common.GetInstanceDatabaseID(config.ChangeDatabaseConfig.Target); err == nil {- instance, err := s.GetInstanceV2(ctx, &store.FindInstanceMessage{- ResourceID: &instanceID,- })- if err != nil {- return nil, errors.Wrapf(err, "failed to get instance %q", instanceID)- }- if instance == nil {- return nil, errors.Errorf("instance %q not found", instanceID)- }- database, err := s.GetDatabaseV2(ctx, &store.FindDatabaseMessage{- InstanceID: &instanceID,- DatabaseName: &databaseName,- IgnoreCaseSensitive: store.IgnoreDatabaseAndTableCaseSensitive(instance),- })- if err != nil {- return nil, errors.Wrapf(err, "failed to get database %q", databaseName)- }- if database == nil {- return nil, errors.Errorf("database %q not found", databaseName)- }+func getPlanCheckRunsFromChangeDatabaseConfigDatabaseGroupTarget(ctx context.Context, s *store.Store, plan *store.PlanMessage, config *storepb.PlanConfig_ChangeDatabaseConfig) ([]*store.PlanCheckRunMessage, error) {+ switch config.Type {+ case storepb.PlanConfig_ChangeDatabaseConfig_MIGRATE:+ case storepb.PlanConfig_ChangeDatabaseConfig_DATA:+ default:+ return nil, errors.Errorf("unsupported change database config type %q for database group target", config.Type)+ }- return &storepb.PlanCheckRunConfig{- Target: &storepb.PlanCheckRunConfig_DatabaseTarget_{- DatabaseTarget: &storepb.PlanCheckRunConfig_DatabaseTarget{- InstanceUid: int32(instance.UID),- DatabaseName: database.DatabaseName,- },- },- }, nil- }- if projectID, databaseGroupID, err := common.GetProjectIDDatabaseGroupID(config.ChangeDatabaseConfig.Target); err == nil {- project, err := s.GetProjectV2(ctx, &store.FindProjectMessage{- ResourceID: &projectID,- })- if err != nil {- return nil, errors.Wrapf(err, "failed to get project %q", projectID)- }- if project == nil {- return nil, errors.Errorf("project %q not found", projectID)- }- databaseGroup, err := s.GetDatabaseGroup(ctx, &store.FindDatabaseGroupMessage{- ProjectUID: &project.UID,- ResourceID: &databaseGroupID,- })- if err != nil {- return nil, errors.Wrapf(err, "failed to get database group %q", databaseGroupID)- }- if databaseGroup == nil {- return nil, errors.Errorf("database group %q not found", databaseGroupID)- }+ projectID, databaseGroupID, err := common.GetProjectIDDatabaseGroupID(config.Target)+ if err != nil {+ return nil, errors.Wrapf(err, "failed to get project id and database group id from target %q", config.Target)+ }- return &storepb.PlanCheckRunConfig{- Target: &storepb.PlanCheckRunConfig_DatabaseGroupTarget_{- DatabaseGroupTarget: &storepb.PlanCheckRunConfig_DatabaseGroupTarget{- DatabaseGroupUid: databaseGroup.UID,- },- },- }, nil+ _, sheetUIDStr, err := common.GetProjectResourceIDSheetID(config.Sheet)+ if err != nil {+ return nil, errors.Wrapf(err, "failed to get sheet id from sheet name %q", config.Sheet)+ }+ sheetUID, err := strconv.Atoi(sheetUIDStr)+ if err != nil {+ return nil, errors.Wrapf(err, "failed to convert sheet id from %q", sheetUIDStr)+ }++ project, err := s.GetProjectV2(ctx, &store.FindProjectMessage{+ ResourceID: &projectID,+ })+ if err != nil {+ return nil, errors.Wrapf(err, "failed to get project %q", projectID)+ }+ if project == nil {+ return nil, errors.Errorf("project %q not found", projectID)+ }+ databaseGroup, err := s.GetDatabaseGroup(ctx, &store.FindDatabaseGroupMessage{ProjectUID: &project.UID, ResourceID: &databaseGroupID})+ if err != nil {+ return nil, errors.Wrapf(err, "failed to get database group %q", databaseGroupID)+ }+ if databaseGroup == nil {+ return nil, errors.Errorf("database group %q not found", databaseGroupID)+ }+ allDatabases, err := s.ListDatabases(ctx, &store.FindDatabaseMessage{ProjectID: &project.ResourceID})+ if err != nil {+ return nil, errors.Wrapf(err, "failed to list databases for project %q", project.ResourceID)+ }++ matchedDatabases, _, err := utils.GetMatchedAndUnmatchedDatabasesInDatabaseGroup(ctx, databaseGroup, allDatabases)+ if err != nil {+ return nil, errors.Wrapf(err, "failed to get matched and unmatched databases in database group %q", databaseGroupID)+ }+ if len(matchedDatabases) == 0 {+ return nil, errors.Errorf("no matched databases found in database group %q", databaseGroupID)+ }++ var planCheckRuns []*store.PlanCheckRunMessage+ for _, database := range matchedDatabases {+ runs, err := getPlanCheckRunsFromChangeDatabaseConfigForDatabase(ctx, s, plan, config, sheetUID, database, &databaseGroup.UID)+ if err != nil {+ return nil, errors.Wrapf(err, "failed to get plan check runs from spec with change database config for database %q", database.DatabaseName)}- return nil, errors.Errorf("unknown target %q", config.ChangeDatabaseConfig.Target)- }()+ planCheckRuns = append(planCheckRuns, runs...)+ }++ return planCheckRuns, nil+}++func getPlanCheckRunsFromChangeDatabaseConfigDatabaseTarget(ctx context.Context, s *store.Store, plan *store.PlanMessage, config *storepb.PlanConfig_ChangeDatabaseConfig) ([]*store.PlanCheckRunMessage, error) {+ instanceID, databaseName, err := common.GetInstanceDatabaseID(config.Target)if err != nil {- return nil, errors.Wrapf(err, "failed to get plan check run config target")+ return nil, errors.Wrapf(err, "failed to get instance and database from target %q", config.Target)+ }+ instance, err := s.GetInstanceV2(ctx, &store.FindInstanceMessage{+ ResourceID: &instanceID,+ })+ if err != nil {+ return nil, errors.Wrapf(err, "failed to get instance %q", instanceID)+ }+ if instance == nil {+ return nil, errors.Errorf("instance %q not found", instanceID)+ }+ database, err := s.GetDatabaseV2(ctx, &store.FindDatabaseMessage{+ InstanceID: &instanceID,+ DatabaseName: &databaseName,+ IgnoreCaseSensitive: store.IgnoreDatabaseAndTableCaseSensitive(instance),+ })+ if err != nil {+ return nil, errors.Wrapf(err, "failed to get database %q", databaseName)+ }+ if database == nil {+ return nil, errors.Errorf("database %q not found", databaseName)}- _, sheetUIDStr, err := common.GetProjectResourceIDSheetID(config.ChangeDatabaseConfig.Sheet)+ _, sheetUIDStr, err := common.GetProjectResourceIDSheetID(config.Sheet)if err != nil {- return nil, errors.Wrapf(err, "failed to get sheet id from sheet name %q", config.ChangeDatabaseConfig.Sheet)+ return nil, errors.Wrapf(err, "failed to get sheet id from sheet name %q", config.Sheet)}sheetUID, err := strconv.Atoi(sheetUIDStr)if err != nil {return nil, errors.Wrapf(err, "failed to convert sheet id from %q", sheetUIDStr)}- var planCheckRuns []*store.PlanCheckRunMessage+ return getPlanCheckRunsFromChangeDatabaseConfigForDatabase(ctx, s, plan, config, sheetUID, database, nil)+}++func getPlanCheckRunsFromChangeDatabaseConfigForDatabase(ctx context.Context, s *store.Store, plan *store.PlanMessage, config *storepb.PlanConfig_ChangeDatabaseConfig, sheetUID int, database *store.DatabaseMessage, databaseGroupUID *int64) ([]*store.PlanCheckRunMessage, error) {+ instance, err := s.GetInstanceV2(ctx, &store.FindInstanceMessage{+ ResourceID: &database.InstanceID,+ })+ if err != nil {+ return nil, errors.Wrapf(err, "failed to get instance %q", database.InstanceID)+ }+ if instance == nil {+ return nil, errors.Errorf("instance %q not found", database.InstanceID)+ }+ var planCheckRuns []*store.PlanCheckRunMessageplanCheckRuns = append(planCheckRuns, &store.PlanCheckRunMessage{CreatorUID: api.SystemBotID,UpdaterUID: api.SystemBotID,@@ -213,7 +245,9 @@ func getPlanCheckRunsForSpecWithChangeDatabaseConfigDatabaseTarget(ctx context.CConfig: &storepb.PlanCheckRunConfig{SheetUid: 0,ChangeDatabaseType: storepb.PlanCheckRunConfig_CHANGE_DATABASE_TYPE_UNSPECIFIED,- Target: configTarget.Target,+ InstanceUid: int32(instance.UID),+ DatabaseName: database.DatabaseName,+ DatabaseGroupUid: nil,},})planCheckRuns = append(planCheckRuns, &store.PlanCheckRunMessage{@@ -224,8 +258,10 @@ func getPlanCheckRunsForSpecWithChangeDatabaseConfigDatabaseTarget(ctx context.CType: store.PlanCheckDatabaseStatementType,Config: &storepb.PlanCheckRunConfig{SheetUid: int32(sheetUID),- ChangeDatabaseType: convertToChangeDatabaseType(config.ChangeDatabaseConfig.Type),- Target: configTarget.Target,+ ChangeDatabaseType: convertToChangeDatabaseType(config.Type),+ InstanceUid: int32(instance.UID),+ DatabaseName: database.DatabaseName,+ DatabaseGroupUid: databaseGroupUID,},})planCheckRuns = append(planCheckRuns, &store.PlanCheckRunMessage{@@ -236,8 +272,10 @@ func getPlanCheckRunsForSpecWithChangeDatabaseConfigDatabaseTarget(ctx context.CType: store.PlanCheckDatabaseStatementAdvise,Config: &storepb.PlanCheckRunConfig{SheetUid: int32(sheetUID),- ChangeDatabaseType: convertToChangeDatabaseType(config.ChangeDatabaseConfig.Type),- Target: configTarget.Target,+ ChangeDatabaseType: convertToChangeDatabaseType(config.Type),+ InstanceUid: int32(instance.UID),+ DatabaseName: database.DatabaseName,+ DatabaseGroupUid: databaseGroupUID,},})planCheckRuns = append(planCheckRuns, &store.PlanCheckRunMessage{@@ -248,11 +286,13 @@ func getPlanCheckRunsForSpecWithChangeDatabaseConfigDatabaseTarget(ctx context.CType: store.PlanCheckDatabaseStatementSummaryReport,Config: &storepb.PlanCheckRunConfig{SheetUid: int32(sheetUID),- ChangeDatabaseType: convertToChangeDatabaseType(config.ChangeDatabaseConfig.Type),- Target: configTarget.Target,+ ChangeDatabaseType: convertToChangeDatabaseType(config.Type),+ InstanceUid: int32(instance.UID),+ DatabaseName: database.DatabaseName,+ DatabaseGroupUid: databaseGroupUID,},})- if config.ChangeDatabaseConfig.Type == storepb.PlanConfig_ChangeDatabaseConfig_MIGRATE_GHOST {+ if databaseGroupUID == nil && config.Type == storepb.PlanConfig_ChangeDatabaseConfig_MIGRATE_GHOST {planCheckRuns = append(planCheckRuns, &store.PlanCheckRunMessage{CreatorUID: api.SystemBotID,UpdaterUID: api.SystemBotID,@@ -261,8 +301,10 @@ func getPlanCheckRunsForSpecWithChangeDatabaseConfigDatabaseTarget(ctx context.CType: store.PlanCheckDatabaseGhostSync,Config: &storepb.PlanCheckRunConfig{SheetUid: int32(sheetUID),- ChangeDatabaseType: convertToChangeDatabaseType(config.ChangeDatabaseConfig.Type),- Target: configTarget.Target,+ ChangeDatabaseType: convertToChangeDatabaseType(config.Type),+ InstanceUid: int32(instance.UID),+ DatabaseName: database.DatabaseName,+ DatabaseGroupUid: databaseGroupUID,},})}diff --git a/backend/runner/plancheck/database_connect_executor.go b/backend/runner/plancheck/database_connect_executor.goindex 3a5d76a076..2f96e090d3 100644--- a/backend/runner/plancheck/database_connect_executor.go+++ b/backend/runner/plancheck/database_connect_executor.go@@ -9,7 +9,6 @@ import ("github.com/bytebase/bytebase/backend/common""github.com/bytebase/bytebase/backend/component/dbfactory""github.com/bytebase/bytebase/backend/store"- "github.com/bytebase/bytebase/backend/utils"storepb "github.com/bytebase/bytebase/proto/generated-go/store")@@ -31,17 +30,8 @@ type DatabaseConnectExecutor struct {// Run runs the executor.func (e *DatabaseConnectExecutor) Run(ctx context.Context, planCheckRun *store.PlanCheckRunMessage) ([]*storepb.PlanCheckRunResult_Result, error) {- if target := planCheckRun.Config.GetDatabaseTarget(); target != nil {- return e.runForDatabaseTarget(ctx, target)- }- if target := planCheckRun.Config.GetDatabaseGroupTarget(); target != nil {- return e.runForDatabaseGroupTarget(ctx, target)- }- return nil, errors.New("plan check run target is required")-}--func (e *DatabaseConnectExecutor) runForDatabaseTarget(ctx context.Context, target *storepb.PlanCheckRunConfig_DatabaseTarget) ([]*storepb.PlanCheckRunResult_Result, error) {- instanceUID := int(target.InstanceUid)+ config := planCheckRun.Config+ instanceUID := int(config.InstanceUid)instance, err := e.store.GetInstanceV2(ctx, &store.FindInstanceMessage{UID: &instanceUID})if err != nil {return nil, errors.Wrapf(err, "failed to get instance UID %v", instanceUID)@@ -50,74 +40,17 @@ func (e *DatabaseConnectExecutor) runForDatabaseTarget(ctx context.Context, targreturn nil, errors.Errorf("instance not found UID %v", instanceUID)}- database, err := e.store.GetDatabaseV2(ctx, &store.FindDatabaseMessage{InstanceID: &instance.ResourceID, DatabaseName: &target.DatabaseName})+ database, err := e.store.GetDatabaseV2(ctx, &store.FindDatabaseMessage{InstanceID: &instance.ResourceID, DatabaseName: &config.DatabaseName})if err != nil {- return nil, errors.Wrapf(err, "failed to get database %q", target.DatabaseName)+ return nil, errors.Wrapf(err, "failed to get database %q", config.DatabaseName)}if database == nil {- return nil, errors.Errorf("database not found %q", target.DatabaseName)+ return nil, errors.Errorf("database not found %q", config.DatabaseName)}return []*storepb.PlanCheckRunResult_Result{e.checkDatabaseConnection(ctx, instance, database)}, nil}-func (e *DatabaseConnectExecutor) runForDatabaseGroupTarget(ctx context.Context, target *storepb.PlanCheckRunConfig_DatabaseGroupTarget) ([]*storepb.PlanCheckRunResult_Result, error) {- databaseGroup, err := e.store.GetDatabaseGroup(ctx, &store.FindDatabaseGroupMessage{- UID: &target.DatabaseGroupUid,- })- if err != nil {- return nil, errors.Wrapf(err, "failed to get database group %d", target.DatabaseGroupUid)- }- if databaseGroup == nil {- return nil, errors.Errorf("database group not found %d", target.DatabaseGroupUid)- }- project, err := e.store.GetProjectV2(ctx, &store.FindProjectMessage{- UID: &databaseGroup.ProjectUID,- })- if err != nil {- return nil, errors.Wrapf(err, "failed to get project %d", databaseGroup.ProjectUID)- }- if project == nil {- return nil, errors.Errorf("project not found %d", databaseGroup.ProjectUID)- }-- allDatabases, err := e.store.ListDatabases(ctx, &store.FindDatabaseMessage{ProjectID: &project.ResourceID})- if err != nil {- return nil, errors.Wrapf(err, "failed to list databases for project %q", project.ResourceID)- }-- matchedDatabases, _, err := utils.GetMatchedAndUnmatchedDatabasesInDatabaseGroup(ctx, databaseGroup, allDatabases)- if err != nil {- return nil, errors.Wrapf(err, "failed to get matched and unmatched databases in database group %q", databaseGroup.ResourceID)- }- if len(matchedDatabases) == 0 {- return nil, errors.Errorf("no matched databases found in database group %q", databaseGroup.ResourceID)- }-- instances := map[string]*store.InstanceMessage{}-- for _, db := range matchedDatabases {- if _, ok := instances[db.InstanceID]; ok {- continue- }- instance, err := e.store.GetInstanceV2(ctx, &store.FindInstanceMessage{ResourceID: &db.InstanceID})- if err != nil {- return nil, errors.Wrapf(err, "failed to get instance %q", db.InstanceID)- }- if instance == nil {- return nil, errors.Errorf("instance not found %q", db.InstanceID)- }- instances[db.InstanceID] = instance- }-- var results []*storepb.PlanCheckRunResult_Result- for _, db := range matchedDatabases {- results = append(results, e.checkDatabaseConnection(ctx, instances[db.InstanceID], db))- }-- return results, nil-}-func (e *DatabaseConnectExecutor) checkDatabaseConnection(ctx context.Context, instance *store.InstanceMessage, database *store.DatabaseMessage) *storepb.PlanCheckRunResult_Result {err := func() error {driver, err := e.dbFactory.GetAdminDatabaseDriver(ctx, instance, database)diff --git a/backend/runner/plancheck/ghost_sync_executor.go b/backend/runner/plancheck/ghost_sync_executor.goindex 30cba8ee24..ffc567526b 100644--- a/backend/runner/plancheck/ghost_sync_executor.go+++ b/backend/runner/plancheck/ghost_sync_executor.go@@ -52,12 +52,11 @@ func (e *GhostSyncExecutor) Run(ctx context.Context, planCheckRun *store.PlanChe}}()- target := planCheckRun.Config.GetDatabaseTarget()- if target == nil {- return nil, errors.New("database target is required")+ if planCheckRun.Config.DatabaseGroupUid != nil {+ return nil, errors.Errorf("database group is not supported")}- instanceUID := int(target.InstanceUid)+ instanceUID := int(planCheckRun.Config.InstanceUid)instance, err := e.store.GetInstanceV2(ctx, &store.FindInstanceMessage{UID: &instanceUID})if err != nil {return nil, errors.Wrapf(err, "failed to get instance UID %v", instanceUID)@@ -66,12 +65,12 @@ func (e *GhostSyncExecutor) Run(ctx context.Context, planCheckRun *store.PlanChereturn nil, errors.Errorf("instance not found UID %v", instanceUID)}- database, err := e.store.GetDatabaseV2(ctx, &store.FindDatabaseMessage{InstanceID: &instance.ResourceID, DatabaseName: &target.DatabaseName})+ database, err := e.store.GetDatabaseV2(ctx, &store.FindDatabaseMessage{InstanceID: &instance.ResourceID, DatabaseName: &planCheckRun.Config.DatabaseName})if err != nil {- return nil, errors.Wrapf(err, "failed to get database %q", target.DatabaseName)+ return nil, errors.Wrapf(err, "failed to get database %q", planCheckRun.Config.DatabaseName)}if database == nil {- return nil, errors.Errorf("database not found %q", target.DatabaseName)+ return nil, errors.Errorf("database not found %q", planCheckRun.Config.DatabaseName)}adminDataSource := utils.DataSourceFromInstanceWithType(instance, api.Admin)diff --git a/backend/runner/plancheck/pitr_mysql_executor.go b/backend/runner/plancheck/pitr_mysql_executor.goindex 37ff5d3c12..f2450fff4a 100644--- a/backend/runner/plancheck/pitr_mysql_executor.go+++ b/backend/runner/plancheck/pitr_mysql_executor.go@@ -28,12 +28,11 @@ type PITRMySQLExecutor struct {// Run runs the PITR MySQL executor.func (e *PITRMySQLExecutor) Run(ctx context.Context, planCheckRun *store.PlanCheckRunMessage) ([]*storepb.PlanCheckRunResult_Result, error) {- target := planCheckRun.Config.GetDatabaseTarget()- if target == nil {- return nil, errors.New("database target is required")+ if planCheckRun.Config.DatabaseGroupUid != nil {+ return nil, errors.Errorf("database group is not supported")}- instanceUID := int(target.InstanceUid)+ instanceUID := int(planCheckRun.Config.InstanceUid)instance, err := e.store.GetInstanceV2(ctx, &store.FindInstanceMessage{UID: &instanceUID})if err != nil {return nil, errors.Wrapf(err, "failed to get instance UID %v", instanceUID)@@ -41,7 +40,7 @@ func (e *PITRMySQLExecutor) Run(ctx context.Context, planCheckRun *store.PlanCheif instance == nil {return nil, errors.Errorf("instance not found UID %v", instanceUID)}- databaseName := target.DatabaseName+ databaseName := planCheckRun.Config.DatabaseNamedriver, err := e.dbFactory.GetAdminDatabaseDriver(ctx, instance, nil /* database */)if err != nil {diff --git a/backend/runner/plancheck/scheduler.go b/backend/runner/plancheck/scheduler.goindex 56677d5dad..777aa52510 100644--- a/backend/runner/plancheck/scheduler.go+++ b/backend/runner/plancheck/scheduler.go@@ -103,11 +103,7 @@ func (s *Scheduler) runPlanCheckRun(ctx context.Context, planCheckRun *store.Plareturn}- var instanceUID int- if target := planCheckRun.Config.GetDatabaseTarget(); target != nil {- instanceUID = int(target.InstanceUid)- }- // DatabaseGroupTarget uses instanceUID = 0+ instanceUID := int(planCheckRun.Config.InstanceUid)s.stateCfg.Lock()if s.stateCfg.InstanceOutstandingConnections[instanceUID] >= state.InstanceMaximumConnectionNumber {diff --git a/backend/runner/plancheck/statement_advise_executor.go b/backend/runner/plancheck/statement_advise_executor.goindex 0727e0292a..9a8d57ad15 100644--- a/backend/runner/plancheck/statement_advise_executor.go+++ b/backend/runner/plancheck/statement_advise_executor.go@@ -47,19 +47,18 @@ func (e *StatementAdviseExecutor) Run(ctx context.Context, planCheckRun *store.Pif changeType == storepb.PlanCheckRunConfig_CHANGE_DATABASE_TYPE_UNSPECIFIED {return nil, errors.Errorf("change database type is unspecified")}- if target := planCheckRun.Config.GetDatabaseTarget(); target != nil {- return e.runForDatabaseTarget(ctx, planCheckRun, target)- }- if target := planCheckRun.Config.GetDatabaseGroupTarget(); target != nil {- return e.runForDatabaseGroupTarget(ctx, planCheckRun, target)++ if planCheckRun.Config.DatabaseGroupUid != nil {+ return e.runForDatabaseGroupTarget(ctx, planCheckRun, *planCheckRun.Config.DatabaseGroupUid)}- return nil, errors.New("plan check run target is required")+ return e.runForDatabaseTarget(ctx, planCheckRun)}-func (e *StatementAdviseExecutor) runForDatabaseTarget(ctx context.Context, planCheckRun *store.PlanCheckRunMessage, target *storepb.PlanCheckRunConfig_DatabaseTarget) ([]*storepb.PlanCheckRunResult_Result, error) {+func (e *StatementAdviseExecutor) runForDatabaseTarget(ctx context.Context, planCheckRun *store.PlanCheckRunMessage) ([]*storepb.PlanCheckRunResult_Result, error) {changeType := planCheckRun.Config.ChangeDatabaseType+ config := planCheckRun.Config- instanceUID := int(target.InstanceUid)+ instanceUID := int(config.InstanceUid)instance, err := e.store.GetInstanceV2(ctx, &store.FindInstanceMessage{UID: &instanceUID})if err != nil {return nil, errors.Wrapf(err, "failed to get instance UID %v", instanceUID)@@ -79,12 +78,12 @@ func (e *StatementAdviseExecutor) runForDatabaseTarget(ctx context.Context, plan}, nil}- database, err := e.store.GetDatabaseV2(ctx, &store.FindDatabaseMessage{InstanceID: &instance.ResourceID, DatabaseName: &target.DatabaseName})+ database, err := e.store.GetDatabaseV2(ctx, &store.FindDatabaseMessage{InstanceID: &instance.ResourceID, DatabaseName: &config.DatabaseName})if err != nil {- return nil, errors.Wrapf(err, "failed to get database %q", target.DatabaseName)+ return nil, errors.Wrapf(err, "failed to get database %q", config.DatabaseName)}if database == nil {- return nil, errors.Errorf("database not found %q", target.DatabaseName)+ return nil, errors.Errorf("database not found %q", config.DatabaseName)}environment, err := e.store.GetEnvironmentV2(ctx, &store.FindEnvironmentMessage{ResourceID: &database.EffectiveEnvironmentID})@@ -229,16 +228,17 @@ func (e *StatementAdviseExecutor) runForDatabaseTarget(ctx context.Context, planreturn results, nil}-func (e *StatementAdviseExecutor) runForDatabaseGroupTarget(ctx context.Context, planCheckRun *store.PlanCheckRunMessage, target *storepb.PlanCheckRunConfig_DatabaseGroupTarget) ([]*storepb.PlanCheckRunResult_Result, error) {+func (e *StatementAdviseExecutor) runForDatabaseGroupTarget(ctx context.Context, planCheckRun *store.PlanCheckRunMessage, databaseGroupUID int64) ([]*storepb.PlanCheckRunResult_Result, error) {changeType := planCheckRun.Config.ChangeDatabaseType+ config := planCheckRun.ConfigdatabaseGroup, err := e.store.GetDatabaseGroup(ctx, &store.FindDatabaseGroupMessage{- UID: &target.DatabaseGroupUid,+ UID: &databaseGroupUID,})if err != nil {- return nil, errors.Wrapf(err, "failed to get database group %d", target.DatabaseGroupUid)+ return nil, errors.Wrapf(err, "failed to get database group %d", databaseGroupUID)}if databaseGroup == nil {- return nil, errors.Errorf("database group not found %d", target.DatabaseGroupUid)+ return nil, errors.Errorf("database group not found %d", databaseGroupUID)}schemaGroups, err := e.store.ListSchemaGroups(ctx, &store.FindSchemaGroupMessage{DatabaseGroupUID: &databaseGroup.UID})if err != nil {@@ -292,6 +292,10 @@ func (e *StatementAdviseExecutor) runForDatabaseGroupTarget(ctx context.Context,var results []*storepb.PlanCheckRunResult_Resultfor _, db := range matchedDatabases {+ if db.DatabaseName != config.DatabaseName {+ continue+ }+instance, err := e.store.GetInstanceV2(ctx, &store.FindInstanceMessage{ResourceID: &db.InstanceID})if err != nil {return nil, errors.Wrapf(err, "failed to get instance %q", db.InstanceID)@@ -299,6 +303,9 @@ func (e *StatementAdviseExecutor) runForDatabaseGroupTarget(ctx context.Context,if instance == nil {return nil, errors.Errorf("instance %q not found", db.InstanceID)}+ if instance.UID != int(config.InstanceUid) {+ continue+ }environment, err := e.store.GetEnvironmentV2(ctx, &store.FindEnvironmentMessage{ResourceID: &db.EffectiveEnvironmentID})if err != nil {diff --git a/backend/runner/plancheck/statement_report_executor.go b/backend/runner/plancheck/statement_report_executor.goindex 524035b25d..10b23e70e8 100644--- a/backend/runner/plancheck/statement_report_executor.go+++ b/backend/runner/plancheck/statement_report_executor.go@@ -41,17 +41,16 @@ type StatementReportExecutor struct {// Run runs the statement report executor.func (e *StatementReportExecutor) Run(ctx context.Context, planCheckRun *store.PlanCheckRunMessage) ([]*storepb.PlanCheckRunResult_Result, error) {- if target := planCheckRun.Config.GetDatabaseTarget(); target != nil {- return e.runForDatabaseTarget(ctx, planCheckRun, target)+ if planCheckRun.Config.DatabaseGroupUid != nil {+ return e.runForDatabaseGroupTarget(ctx, planCheckRun, *planCheckRun.Config.DatabaseGroupUid)}- if target := planCheckRun.Config.GetDatabaseGroupTarget(); target != nil {- return e.runForDatabaseGroupTarget(ctx, planCheckRun, target)- }- return nil, errors.New("plan check run target is required")+ return e.runForDatabaseTarget(ctx, planCheckRun)}-func (e *StatementReportExecutor) runForDatabaseTarget(ctx context.Context, planCheckRun *store.PlanCheckRunMessage, target *storepb.PlanCheckRunConfig_DatabaseTarget) ([]*storepb.PlanCheckRunResult_Result, error) {- instanceUID := int(target.InstanceUid)+func (e *StatementReportExecutor) runForDatabaseTarget(ctx context.Context, planCheckRun *store.PlanCheckRunMessage) ([]*storepb.PlanCheckRunResult_Result, error) {+ config := planCheckRun.Config++ instanceUID := int(config.InstanceUid)instance, err := e.store.GetInstanceV2(ctx, &store.FindInstanceMessage{UID: &instanceUID})if err != nil {return nil, errors.Wrapf(err, "failed to get instance UID %v", instanceUID)@@ -71,12 +70,12 @@ func (e *StatementReportExecutor) runForDatabaseTarget(ctx context.Context, plan}, nil}- database, err := e.store.GetDatabaseV2(ctx, &store.FindDatabaseMessage{InstanceID: &instance.ResourceID, DatabaseName: &target.DatabaseName})+ database, err := e.store.GetDatabaseV2(ctx, &store.FindDatabaseMessage{InstanceID: &instance.ResourceID, DatabaseName: &config.DatabaseName})if err != nil {- return nil, errors.Wrapf(err, "failed to get database %q", target.DatabaseName)+ return nil, errors.Wrapf(err, "failed to get database %q", config.DatabaseName)}if database == nil {- return nil, errors.Errorf("database not found %q", target.DatabaseName)+ return nil, errors.Errorf("database not found %q", config.DatabaseName)}dbSchema, err := e.store.GetDBSchema(ctx, database.UID)@@ -157,15 +156,17 @@ func (e *StatementReportExecutor) runForDatabaseTarget(ctx context.Context, plan}}-func (e *StatementReportExecutor) runForDatabaseGroupTarget(ctx context.Context, planCheckRun *store.PlanCheckRunMessage, target *storepb.PlanCheckRunConfig_DatabaseGroupTarget) ([]*storepb.PlanCheckRunResult_Result, error) {+func (e *StatementReportExecutor) runForDatabaseGroupTarget(ctx context.Context, planCheckRun *store.PlanCheckRunMessage, databaseGroupUID int64) ([]*storepb.PlanCheckRunResult_Result, error) {+ config := planCheckRun.Config+databaseGroup, err := e.store.GetDatabaseGroup(ctx, &store.FindDatabaseGroupMessage{- UID: &target.DatabaseGroupUid,+ UID: &databaseGroupUID,})if err != nil {- return nil, errors.Wrapf(err, "failed to get database group %d", target.DatabaseGroupUid)+ return nil, errors.Wrapf(err, "failed to get database group %d", databaseGroupUID)}if databaseGroup == nil {- return nil, errors.Errorf("database group not found %d", target.DatabaseGroupUid)+ return nil, errors.Errorf("database group not found %d", databaseGroupUID)}schemaGroups, err := e.store.ListSchemaGroups(ctx, &store.FindSchemaGroupMessage{DatabaseGroupUID: &databaseGroup.UID})if err != nil {@@ -220,6 +221,10 @@ func (e *StatementReportExecutor) runForDatabaseGroupTarget(ctx context.Context,var results []*storepb.PlanCheckRunResult_Resultfor _, database := range matchedDatabases {+ if database.DatabaseName != config.DatabaseName {+ continue+ }+instance, err := e.store.GetInstanceV2(ctx, &store.FindInstanceMessage{ResourceID: &database.InstanceID})if err != nil {return nil, errors.Wrapf(err, "failed to get instance %q", database.InstanceID)@@ -227,6 +232,9 @@ func (e *StatementReportExecutor) runForDatabaseGroupTarget(ctx context.Context,if instance == nil {return nil, errors.Errorf("instance %q not found", database.InstanceID)}+ if instance.UID != int(config.InstanceUid) {+ continue+ }environment, err := e.store.GetEnvironmentV2(ctx, &store.FindEnvironmentMessage{ResourceID: &database.EffectiveEnvironmentID})if err != nil {diff --git a/backend/runner/plancheck/statement_type_executor.go b/backend/runner/plancheck/statement_type_executor.goindex dd2e838625..db84e6ab61 100644--- a/backend/runner/plancheck/statement_type_executor.go+++ b/backend/runner/plancheck/statement_type_executor.go@@ -44,19 +44,17 @@ func (e *StatementTypeExecutor) Run(ctx context.Context, planCheckRun *store.Plareturn nil, errors.Errorf("change database type is unspecified")}- if target := planCheckRun.Config.GetDatabaseTarget(); target != nil {- return e.runForDatabaseTarget(ctx, planCheckRun, target)+ if planCheckRun.Config.DatabaseGroupUid != nil {+ return e.runForDatabaseGroupTarget(ctx, planCheckRun, *planCheckRun.Config.DatabaseGroupUid)}- if target := planCheckRun.Config.GetDatabaseGroupTarget(); target != nil {- return e.runForDatabaseGroupTarget(ctx, planCheckRun, target)- }- return nil, errors.New("plan check run target is required")+ return e.runForDatabaseTarget(ctx, planCheckRun)}-func (e *StatementTypeExecutor) runForDatabaseTarget(ctx context.Context, planCheckRun *store.PlanCheckRunMessage, target *storepb.PlanCheckRunConfig_DatabaseTarget) ([]*storepb.PlanCheckRunResult_Result, error) {+func (e *StatementTypeExecutor) runForDatabaseTarget(ctx context.Context, planCheckRun *store.PlanCheckRunMessage) ([]*storepb.PlanCheckRunResult_Result, error) {changeType := planCheckRun.Config.ChangeDatabaseType+ config := planCheckRun.Config- instanceUID := int(target.InstanceUid)+ instanceUID := int(config.InstanceUid)instance, err := e.store.GetInstanceV2(ctx, &store.FindInstanceMessage{UID: &instanceUID})if err != nil {return nil, errors.Wrapf(err, "failed to get instance UID %v", instanceUID)@@ -76,12 +74,12 @@ func (e *StatementTypeExecutor) runForDatabaseTarget(ctx context.Context, planCh}, nil}- database, err := e.store.GetDatabaseV2(ctx, &store.FindDatabaseMessage{InstanceID: &instance.ResourceID, DatabaseName: &target.DatabaseName})+ database, err := e.store.GetDatabaseV2(ctx, &store.FindDatabaseMessage{InstanceID: &instance.ResourceID, DatabaseName: &config.DatabaseName})if err != nil {- return nil, errors.Wrapf(err, "failed to get database %q", target.DatabaseName)+ return nil, errors.Wrapf(err, "failed to get database %q", config.DatabaseName)}if database == nil {- return nil, errors.Errorf("database not found %q", target.DatabaseName)+ return nil, errors.Errorf("database not found %q", config.DatabaseName)}dbSchema, err := e.store.GetDBSchema(ctx, database.UID)@@ -160,17 +158,18 @@ func (e *StatementTypeExecutor) runForDatabaseTarget(ctx context.Context, planChreturn results, nil}-func (e *StatementTypeExecutor) runForDatabaseGroupTarget(ctx context.Context, planCheckRun *store.PlanCheckRunMessage, target *storepb.PlanCheckRunConfig_DatabaseGroupTarget) ([]*storepb.PlanCheckRunResult_Result, error) {+func (e *StatementTypeExecutor) runForDatabaseGroupTarget(ctx context.Context, planCheckRun *store.PlanCheckRunMessage, databaseGroupUID int64) ([]*storepb.PlanCheckRunResult_Result, error) {changeType := planCheckRun.Config.ChangeDatabaseType+ config := planCheckRun.ConfigdatabaseGroup, err := e.store.GetDatabaseGroup(ctx, &store.FindDatabaseGroupMessage{- UID: &target.DatabaseGroupUid,+ UID: &databaseGroupUID,})if err != nil {- return nil, errors.Wrapf(err, "failed to get database group %d", target.DatabaseGroupUid)+ return nil, errors.Wrapf(err, "failed to get database group %d", databaseGroupUID)}if databaseGroup == nil {- return nil, errors.Errorf("database group not found %d", target.DatabaseGroupUid)+ return nil, errors.Errorf("database group not found %d", databaseGroupUID)}schemaGroups, err := e.store.ListSchemaGroups(ctx, &store.FindSchemaGroupMessage{DatabaseGroupUID: &databaseGroup.UID})@@ -226,6 +225,10 @@ func (e *StatementTypeExecutor) runForDatabaseGroupTarget(ctx context.Context, pvar results []*storepb.PlanCheckRunResult_Resultfor _, database := range matchedDatabases {+ if database.DatabaseName != config.DatabaseName {+ continue+ }+instance, err := e.store.GetInstanceV2(ctx, &store.FindInstanceMessage{ResourceID: &database.InstanceID})if err != nil {return nil, errors.Wrapf(err, "failed to get instance %q", database.InstanceID)@@ -236,6 +239,9 @@ func (e *StatementTypeExecutor) runForDatabaseGroupTarget(ctx context.Context, pif !isStatementTypeCheckSupported(instance.Engine) {continue}+ if instance.UID != int(config.InstanceUid) {+ continue+ }environment, err := e.store.GetEnvironmentV2(ctx, &store.FindEnvironmentMessage{ResourceID: &database.EffectiveEnvironmentID})if err != nil {diff --git a/frontend/src/components/IssueV1/logic/plan-check.ts b/frontend/src/components/IssueV1/logic/plan-check.tsindex f7fc1afb03..cc94b45f4b 100644--- a/frontend/src/components/IssueV1/logic/plan-check.ts+++ b/frontend/src/components/IssueV1/logic/plan-check.ts@@ -10,7 +10,7 @@ import {Task,Task_Status,} from "@/types/proto/v1/rollout_service";-import { databaseForTask, specForTask, targetForSpec } from ".";+import { databaseForTask } from ".";export const planSpecHasPlanChecks = (spec: Plan_Spec) => {if (spec.createDatabaseConfig) {@@ -36,12 +36,7 @@ export const planSpecHasPlanChecks = (spec: Plan_Spec) => {};export const planCheckRunListForTask = (issue: ComposedIssue, task: Task) => {- const spec = specForTask(issue.planEntity, task);- // If the task's spec is found, use its target.- // This is useful when the spec's target is a database group, which means the- // planCheckRuns' targets will be the database group rather than the databases.- // Otherwise use database for task as the fallback target.- const target = targetForSpec(spec) ?? databaseForTask(issue, task).name;+ const target = databaseForTask(issue, task).name;return issue.planCheckRunList.filter((check) => check.target === target);};diff --git a/frontend/src/types/proto/store/plan.ts b/frontend/src/types/proto/store/plan.tsindex dd8b968c4e..845b426656 100644--- a/frontend/src/types/proto/store/plan.ts+++ b/frontend/src/types/proto/store/plan.ts@@ -59,7 +59,7 @@ export interface PlanConfig_ChangeDatabaseConfig {/*** The resource name of the target.* Format: instances/{instance-id}/databases/{database-name}.- * Format: projects/{project}/deploymentConfig.+ * Format: projects/{project}/databaseGroups/{databaseGroup}*/target: string;/**diff --git a/frontend/src/types/proto/store/plan_check_run.ts b/frontend/src/types/proto/store/plan_check_run.tsindex 98822171cc..e7474a9715 100644--- a/frontend/src/types/proto/store/plan_check_run.ts+++ b/frontend/src/types/proto/store/plan_check_run.ts@@ -8,8 +8,10 @@ export const protobufPackage = "bytebase.store";export interface PlanCheckRunConfig {sheetUid: number;changeDatabaseType: PlanCheckRunConfig_ChangeDatabaseType;- databaseTarget?: PlanCheckRunConfig_DatabaseTarget | undefined;- databaseGroupTarget?: PlanCheckRunConfig_DatabaseGroupTarget | undefined;+ instanceUid: number;+ databaseName: string;+ /** database_group_uid is optional. If it's set, it means the database is part of a database group. */+ databaseGroupUid?: number | undefined;}export enum PlanCheckRunConfig_ChangeDatabaseType {@@ -57,15 +59,6 @@ export function planCheckRunConfig_ChangeDatabaseTypeToJSON(object: PlanCheckRun}}-export interface PlanCheckRunConfig_DatabaseTarget {- instanceUid: number;- databaseName: string;-}--export interface PlanCheckRunConfig_DatabaseGroupTarget {- databaseGroupUid: number;-}-export interface PlanCheckRunResult {results: PlanCheckRunResult_Result[];error: string;@@ -142,7 +135,7 @@ export interface PlanCheckRunResult_Result_SqlReviewReport {}function createBasePlanCheckRunConfig(): PlanCheckRunConfig {- return { sheetUid: 0, changeDatabaseType: 0, databaseTarget: undefined, databaseGroupTarget: undefined };+ return { sheetUid: 0, changeDatabaseType: 0, instanceUid: 0, databaseName: "", databaseGroupUid: undefined };}export const PlanCheckRunConfig = {@@ -153,11 +146,14 @@ export const PlanCheckRunConfig = {if (message.changeDatabaseType !== 0) {writer.uint32(16).int32(message.changeDatabaseType);}- if (message.databaseTarget !== undefined) {- PlanCheckRunConfig_DatabaseTarget.encode(message.databaseTarget, writer.uint32(26).fork()).ldelim();+ if (message.instanceUid !== 0) {+ writer.uint32(24).int32(message.instanceUid);+ }+ if (message.databaseName !== "") {+ writer.uint32(34).string(message.databaseName);}- if (message.databaseGroupTarget !== undefined) {- PlanCheckRunConfig_DatabaseGroupTarget.encode(message.databaseGroupTarget, writer.uint32(34).fork()).ldelim();+ if (message.databaseGroupUid !== undefined) {+ writer.uint32(40).int64(message.databaseGroupUid);}return writer;},@@ -184,18 +180,25 @@ export const PlanCheckRunConfig = {message.changeDatabaseType = reader.int32() as any;continue;case 3:- if (tag !== 26) {+ if (tag !== 24) {break;}- message.databaseTarget = PlanCheckRunConfig_DatabaseTarget.decode(reader, reader.uint32());+ message.instanceUid = reader.int32();continue;case 4:if (tag !== 34) {break;}- message.databaseGroupTarget = PlanCheckRunConfig_DatabaseGroupTarget.decode(reader, reader.uint32());+ message.databaseName = reader.string();+ continue;+ case 5:+ if (tag !== 40) {+ break;+ }++ message.databaseGroupUid = longToNumber(reader.int64() as Long);continue;}if ((tag & 7) === 4 || tag === 0) {@@ -212,12 +215,9 @@ export const PlanCheckRunConfig = {changeDatabaseType: isSet(object.changeDatabaseType)? planCheckRunConfig_ChangeDatabaseTypeFromJSON(object.changeDatabaseType): 0,- databaseTarget: isSet(object.databaseTarget)- ? PlanCheckRunConfig_DatabaseTarget.fromJSON(object.databaseTarget)- : undefined,- databaseGroupTarget: isSet(object.databaseGroupTarget)- ? PlanCheckRunConfig_DatabaseGroupTarget.fromJSON(object.databaseGroupTarget)- : undefined,+ instanceUid: isSet(object.instanceUid) ? Number(object.instanceUid) : 0,+ databaseName: isSet(object.databaseName) ? String(object.databaseName) : "",+ databaseGroupUid: isSet(object.databaseGroupUid) ? Number(object.databaseGroupUid) : undefined,};},@@ -226,12 +226,9 @@ export const PlanCheckRunConfig = {message.sheetUid !== undefined && (obj.sheetUid = Math.round(message.sheetUid));message.changeDatabaseType !== undefined &&(obj.changeDatabaseType = planCheckRunConfig_ChangeDatabaseTypeToJSON(message.changeDatabaseType));- message.databaseTarget !== undefined && (obj.databaseTarget = message.databaseTarget- ? PlanCheckRunConfig_DatabaseTarget.toJSON(message.databaseTarget)- : undefined);- message.databaseGroupTarget !== undefined && (obj.databaseGroupTarget = message.databaseGroupTarget- ? PlanCheckRunConfig_DatabaseGroupTarget.toJSON(message.databaseGroupTarget)- : undefined);+ message.instanceUid !== undefined && (obj.instanceUid = Math.round(message.instanceUid));+ message.databaseName !== undefined && (obj.databaseName = message.databaseName);+ message.databaseGroupUid !== undefined && (obj.databaseGroupUid = Math.round(message.databaseGroupUid));return obj;},@@ -243,139 +240,9 @@ export const PlanCheckRunConfig = {const message = createBasePlanCheckRunConfig();message.sheetUid = object.sheetUid ?? 0;message.changeDatabaseType = object.changeDatabaseType ?? 0;- message.databaseTarget = (object.databaseTarget !== undefined && object.databaseTarget !== null)- ? PlanCheckRunConfig_DatabaseTarget.fromPartial(object.databaseTarget)- : undefined;- message.databaseGroupTarget = (object.databaseGroupTarget !== undefined && object.databaseGroupTarget !== null)- ? PlanCheckRunConfig_DatabaseGroupTarget.fromPartial(object.databaseGroupTarget)- : undefined;- return message;- },-};--function createBasePlanCheckRunConfig_DatabaseTarget(): PlanCheckRunConfig_DatabaseTarget {- return { instanceUid: 0, databaseName: "" };-}--export const PlanCheckRunConfig_DatabaseTarget = {- encode(message: PlanCheckRunConfig_DatabaseTarget, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {- if (message.instanceUid !== 0) {- writer.uint32(8).int32(message.instanceUid);- }- if (message.databaseName !== "") {- writer.uint32(18).string(message.databaseName);- }- return writer;- },-- decode(input: _m0.Reader | Uint8Array, length?: number): PlanCheckRunConfig_DatabaseTarget {- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);- let end = length === undefined ? reader.len : reader.pos + length;- const message = createBasePlanCheckRunConfig_DatabaseTarget();- while (reader.pos < end) {- const tag = reader.uint32();- switch (tag >>> 3) {- case 1:- if (tag !== 8) {- break;- }-- message.instanceUid = reader.int32();- continue;- case 2:- if (tag !== 18) {- break;- }-- message.databaseName = reader.string();- continue;- }- if ((tag & 7) === 4 || tag === 0) {- break;- }- reader.skipType(tag & 7);- }- return message;- },-- fromJSON(object: any): PlanCheckRunConfig_DatabaseTarget {- return {- instanceUid: isSet(object.instanceUid) ? Number(object.instanceUid) : 0,- databaseName: isSet(object.databaseName) ? String(object.databaseName) : "",- };- },-- toJSON(message: PlanCheckRunConfig_DatabaseTarget): unknown {- const obj: any = {};- message.instanceUid !== undefined && (obj.instanceUid = Math.round(message.instanceUid));- message.databaseName !== undefined && (obj.databaseName = message.databaseName);- return obj;- },-- create(base?: DeepPartial<PlanCheckRunConfig_DatabaseTarget>): PlanCheckRunConfig_DatabaseTarget {- return PlanCheckRunConfig_DatabaseTarget.fromPartial(base ?? {});- },-- fromPartial(object: DeepPartial<PlanCheckRunConfig_DatabaseTarget>): PlanCheckRunConfig_DatabaseTarget {- const message = createBasePlanCheckRunConfig_DatabaseTarget();message.instanceUid = object.instanceUid ?? 0;message.databaseName = object.databaseName ?? "";- return message;- },-};--function createBasePlanCheckRunConfig_DatabaseGroupTarget(): PlanCheckRunConfig_DatabaseGroupTarget {- return { databaseGroupUid: 0 };-}--export const PlanCheckRunConfig_DatabaseGroupTarget = {- encode(message: PlanCheckRunConfig_DatabaseGroupTarget, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {- if (message.databaseGroupUid !== 0) {- writer.uint32(8).int64(message.databaseGroupUid);- }- return writer;- },-- decode(input: _m0.Reader | Uint8Array, length?: number): PlanCheckRunConfig_DatabaseGroupTarget {- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);- let end = length === undefined ? reader.len : reader.pos + length;- const message = createBasePlanCheckRunConfig_DatabaseGroupTarget();- while (reader.pos < end) {- const tag = reader.uint32();- switch (tag >>> 3) {- case 1:- if (tag !== 8) {- break;- }-- message.databaseGroupUid = longToNumber(reader.int64() as Long);- continue;- }- if ((tag & 7) === 4 || tag === 0) {- break;- }- reader.skipType(tag & 7);- }- return message;- },-- fromJSON(object: any): PlanCheckRunConfig_DatabaseGroupTarget {- return { databaseGroupUid: isSet(object.databaseGroupUid) ? Number(object.databaseGroupUid) : 0 };- },-- toJSON(message: PlanCheckRunConfig_DatabaseGroupTarget): unknown {- const obj: any = {};- message.databaseGroupUid !== undefined && (obj.databaseGroupUid = Math.round(message.databaseGroupUid));- return obj;- },-- create(base?: DeepPartial<PlanCheckRunConfig_DatabaseGroupTarget>): PlanCheckRunConfig_DatabaseGroupTarget {- return PlanCheckRunConfig_DatabaseGroupTarget.fromPartial(base ?? {});- },-- fromPartial(object: DeepPartial<PlanCheckRunConfig_DatabaseGroupTarget>): PlanCheckRunConfig_DatabaseGroupTarget {- const message = createBasePlanCheckRunConfig_DatabaseGroupTarget();- message.databaseGroupUid = object.databaseGroupUid ?? 0;+ message.databaseGroupUid = object.databaseGroupUid ?? undefined;return message;},};diff --git a/frontend/src/types/proto/v1/rollout_service.ts b/frontend/src/types/proto/v1/rollout_service.tsindex b581a3cdd1..629eba259c 100644--- a/frontend/src/types/proto/v1/rollout_service.ts+++ b/frontend/src/types/proto/v1/rollout_service.ts@@ -372,10 +372,7 @@ export interface PlanCheckRun {uid: string;type: PlanCheckRun_Type;status: PlanCheckRun_Status;- /**- * Format: instances/{instance}/databases/{database}- * Format: projects/{project}/databaseGroups/{databaseGroup}- */+ /** Format: instances/{instance}/databases/{database} */target: string;/** Format: projects/{project}/sheets/{sheet} */sheet: string;diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.mdindex 009fa7db6e..6bafa6c379 100644--- a/proto/gen/grpc-doc/store/README.md+++ b/proto/gen/grpc-doc/store/README.md@@ -108,8 +108,6 @@- [store/plan_check_run.proto](#store_plan_check_run-proto)- [PlanCheckRunConfig](#bytebase-store-PlanCheckRunConfig)- - [PlanCheckRunConfig.DatabaseGroupTarget](#bytebase-store-PlanCheckRunConfig-DatabaseGroupTarget)- - [PlanCheckRunConfig.DatabaseTarget](#bytebase-store-PlanCheckRunConfig-DatabaseTarget)- [PlanCheckRunResult](#bytebase-store-PlanCheckRunResult)- [PlanCheckRunResult.Result](#bytebase-store-PlanCheckRunResult-Result)- [PlanCheckRunResult.Result.SqlReviewReport](#bytebase-store-PlanCheckRunResult-Result-SqlReviewReport)@@ -1511,7 +1509,7 @@ InstanceOptions is the option for instances.| Field | Type | Label | Description || ----- | ---- | ----- | ----------- |-| target | [string](#string) | | The resource name of the target. Format: instances/{instance-id}/databases/{database-name}. Format: projects/{project}/deploymentConfig. |+| target | [string](#string) | | The resource name of the target. Format: instances/{instance-id}/databases/{database-name}. Format: projects/{project}/databaseGroups/{databaseGroup} || sheet | [string](#string) | | The resource name of the sheet. Format: projects/{project}/sheets/{sheet} || type | [PlanConfig.ChangeDatabaseConfig.Type](#bytebase-store-PlanConfig-ChangeDatabaseConfig-Type) | | || schema_version | [string](#string) | | schema_version is parsed from VCS file name. It is automatically generated in the UI workflow. |@@ -1675,39 +1673,9 @@ Type is the database change type.| ----- | ---- | ----- | ----------- || sheet_uid | [int32](#int32) | | || change_database_type | [PlanCheckRunConfig.ChangeDatabaseType](#bytebase-store-PlanCheckRunConfig-ChangeDatabaseType) | | |-| database_target | [PlanCheckRunConfig.DatabaseTarget](#bytebase-store-PlanCheckRunConfig-DatabaseTarget) | | |-| database_group_target | [PlanCheckRunConfig.DatabaseGroupTarget](#bytebase-store-PlanCheckRunConfig-DatabaseGroupTarget) | | |-------<a name="bytebase-store-PlanCheckRunConfig-DatabaseGroupTarget"></a>--### PlanCheckRunConfig.DatabaseGroupTarget----| Field | Type | Label | Description |-| ----- | ---- | ----- | ----------- |-| database_group_uid | [int64](#int64) | | |-------<a name="bytebase-store-PlanCheckRunConfig-DatabaseTarget"></a>--### PlanCheckRunConfig.DatabaseTarget----| Field | Type | Label | Description |-| ----- | ---- | ----- | ----------- || instance_uid | [int32](#int32) | | || database_name | [string](#string) | | |+| database_group_uid | [int64](#int64) | optional | database_group_uid is optional. If it's set, it means the database is part of a database group. |diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.mdindex 26fb6eecee..5791d37532 100644--- a/proto/gen/grpc-doc/v1/README.md+++ b/proto/gen/grpc-doc/v1/README.md@@ -7481,7 +7481,7 @@ When paginating, all other parameters provided to `ListRolloutTaskRuns` must mat| uid | [string](#string) | | The system-assigned, unique identifier for a resource. || type | [PlanCheckRun.Type](#bytebase-v1-PlanCheckRun-Type) | | || status | [PlanCheckRun.Status](#bytebase-v1-PlanCheckRun-Status) | | |-| target | [string](#string) | | Format: instances/{instance}/databases/{database} Format: projects/{project}/databaseGroups/{databaseGroup} |+| target | [string](#string) | | Format: instances/{instance}/databases/{database} || sheet | [string](#string) | | Format: projects/{project}/sheets/{sheet} || results | [PlanCheckRun.Result](#bytebase-v1-PlanCheckRun-Result) | repeated | || error | [string](#string) | | error is set if the Status is FAILED. |diff --git a/proto/generated-go/store/plan.pb.go b/proto/generated-go/store/plan.pb.goindex f109008ac5..408940ed3a 100644--- a/proto/generated-go/store/plan.pb.go+++ b/proto/generated-go/store/plan.pb.go@@ -426,7 +426,7 @@ type PlanConfig_ChangeDatabaseConfig struct {// The resource name of the target.// Format: instances/{instance-id}/databases/{database-name}.- // Format: projects/{project}/deploymentConfig.+ // Format: projects/{project}/databaseGroups/{databaseGroup}Target string `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"`// The resource name of the sheet.// Format: projects/{project}/sheets/{sheet}diff --git a/proto/generated-go/store/plan_check_run.pb.go b/proto/generated-go/store/plan_check_run.pb.goindex e86aee732c..cad0c3b80f 100644--- a/proto/generated-go/store/plan_check_run.pb.go+++ b/proto/generated-go/store/plan_check_run.pb.go@@ -131,11 +131,10 @@ type PlanCheckRunConfig struct {SheetUid int32 `protobuf:"varint,1,opt,name=sheet_uid,json=sheetUid,proto3" json:"sheet_uid,omitempty"`ChangeDatabaseType PlanCheckRunConfig_ChangeDatabaseType `protobuf:"varint,2,opt,name=change_database_type,json=changeDatabaseType,proto3,enum=bytebase.store.PlanCheckRunConfig_ChangeDatabaseType" json:"change_database_type,omitempty"`- // Types that are assignable to Target:- //- // *PlanCheckRunConfig_DatabaseTarget_- // *PlanCheckRunConfig_DatabaseGroupTarget_- Target isPlanCheckRunConfig_Target `protobuf_oneof:"target"`+ InstanceUid int32 `protobuf:"varint,3,opt,name=instance_uid,json=instanceUid,proto3" json:"instance_uid,omitempty"`+ DatabaseName string `protobuf:"bytes,4,opt,name=database_name,json=databaseName,proto3" json:"database_name,omitempty"`+ // database_group_uid is optional. If it's set, it means the database is part of a database group.+ DatabaseGroupUid *int64 `protobuf:"varint,5,opt,name=database_group_uid,json=databaseGroupUid,proto3,oneof" json:"database_group_uid,omitempty"`}func (x *PlanCheckRunConfig) Reset() {@@ -184,43 +183,27 @@ func (x *PlanCheckRunConfig) GetChangeDatabaseType() PlanCheckRunConfig_ChangeDareturn PlanCheckRunConfig_CHANGE_DATABASE_TYPE_UNSPECIFIED}-func (m *PlanCheckRunConfig) GetTarget() isPlanCheckRunConfig_Target {- if m != nil {- return m.Target+func (x *PlanCheckRunConfig) GetInstanceUid() int32 {+ if x != nil {+ return x.InstanceUid}- return nil+ return 0}-func (x *PlanCheckRunConfig) GetDatabaseTarget() *PlanCheckRunConfig_DatabaseTarget {- if x, ok := x.GetTarget().(*PlanCheckRunConfig_DatabaseTarget_); ok {- return x.DatabaseTarget+func (x *PlanCheckRunConfig) GetDatabaseName() string {+ if x != nil {+ return x.DatabaseName}- return nil+ return ""}-func (x *PlanCheckRunConfig) GetDatabaseGroupTarget() *PlanCheckRunConfig_DatabaseGroupTarget {- if x, ok := x.GetTarget().(*PlanCheckRunConfig_DatabaseGroupTarget_); ok {- return x.DatabaseGroupTarget+func (x *PlanCheckRunConfig) GetDatabaseGroupUid() int64 {+ if x != nil && x.DatabaseGroupUid != nil {+ return *x.DatabaseGroupUid}- return nil-}--type isPlanCheckRunConfig_Target interface {- isPlanCheckRunConfig_Target()-}--type PlanCheckRunConfig_DatabaseTarget_ struct {- DatabaseTarget *PlanCheckRunConfig_DatabaseTarget `protobuf:"bytes,3,opt,name=database_target,json=databaseTarget,proto3,oneof"`-}--type PlanCheckRunConfig_DatabaseGroupTarget_ struct {- DatabaseGroupTarget *PlanCheckRunConfig_DatabaseGroupTarget `protobuf:"bytes,4,opt,name=database_group_target,json=databaseGroupTarget,proto3,oneof"`+ return 0}-func (*PlanCheckRunConfig_DatabaseTarget_) isPlanCheckRunConfig_Target() {}--func (*PlanCheckRunConfig_DatabaseGroupTarget_) isPlanCheckRunConfig_Target() {}-type PlanCheckRunResult struct {state protoimpl.MessageStatesizeCache protoimpl.SizeCache@@ -276,108 +259,6 @@ func (x *PlanCheckRunResult) GetError() string {return ""}-type PlanCheckRunConfig_DatabaseTarget struct {- state protoimpl.MessageState- sizeCache protoimpl.SizeCache- unknownFields protoimpl.UnknownFields-- InstanceUid int32 `protobuf:"varint,1,opt,name=instance_uid,json=instanceUid,proto3" json:"instance_uid,omitempty"`- DatabaseName string `protobuf:"bytes,2,opt,name=database_name,json=databaseName,proto3" json:"database_name,omitempty"`-}--func (x *PlanCheckRunConfig_DatabaseTarget) Reset() {- *x = PlanCheckRunConfig_DatabaseTarget{}- if protoimpl.UnsafeEnabled {- mi := &file_store_plan_check_run_proto_msgTypes[2]- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))- ms.StoreMessageInfo(mi)- }-}--func (x *PlanCheckRunConfig_DatabaseTarget) String() string {- return protoimpl.X.MessageStringOf(x)-}--func (*PlanCheckRunConfig_DatabaseTarget) ProtoMessage() {}--func (x *PlanCheckRunConfig_DatabaseTarget) ProtoReflect() protoreflect.Message {- mi := &file_store_plan_check_run_proto_msgTypes[2]- if protoimpl.UnsafeEnabled && x != nil {- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))- if ms.LoadMessageInfo() == nil {- ms.StoreMessageInfo(mi)- }- return ms- }- return mi.MessageOf(x)-}--// Deprecated: Use PlanCheckRunConfig_DatabaseTarget.ProtoReflect.Descriptor instead.-func (*PlanCheckRunConfig_DatabaseTarget) Descriptor() ([]byte, []int) {- return file_store_plan_check_run_proto_rawDescGZIP(), []int{0, 0}-}--func (x *PlanCheckRunConfig_DatabaseTarget) GetInstanceUid() int32 {- if x != nil {- return x.InstanceUid- }- return 0-}--func (x *PlanCheckRunConfig_DatabaseTarget) GetDatabaseName() string {- if x != nil {- return x.DatabaseName- }- return ""-}--type PlanCheckRunConfig_DatabaseGroupTarget struct {- state protoimpl.MessageState- sizeCache protoimpl.SizeCache- unknownFields protoimpl.UnknownFields-- DatabaseGroupUid int64 `protobuf:"varint,1,opt,name=database_group_uid,json=databaseGroupUid,proto3" json:"database_group_uid,omitempty"`-}--func (x *PlanCheckRunConfig_DatabaseGroupTarget) Reset() {- *x = PlanCheckRunConfig_DatabaseGroupTarget{}- if protoimpl.UnsafeEnabled {- mi := &file_store_plan_check_run_proto_msgTypes[3]- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))- ms.StoreMessageInfo(mi)- }-}--func (x *PlanCheckRunConfig_DatabaseGroupTarget) String() string {- return protoimpl.X.MessageStringOf(x)-}--func (*PlanCheckRunConfig_DatabaseGroupTarget) ProtoMessage() {}--func (x *PlanCheckRunConfig_DatabaseGroupTarget) ProtoReflect() protoreflect.Message {- mi := &file_store_plan_check_run_proto_msgTypes[3]- if protoimpl.UnsafeEnabled && x != nil {- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))- if ms.LoadMessageInfo() == nil {- ms.StoreMessageInfo(mi)- }- return ms- }- return mi.MessageOf(x)-}--// Deprecated: Use PlanCheckRunConfig_DatabaseGroupTarget.ProtoReflect.Descriptor instead.-func (*PlanCheckRunConfig_DatabaseGroupTarget) Descriptor() ([]byte, []int) {- return file_store_plan_check_run_proto_rawDescGZIP(), []int{0, 1}-}--func (x *PlanCheckRunConfig_DatabaseGroupTarget) GetDatabaseGroupUid() int64 {- if x != nil {- return x.DatabaseGroupUid- }- return 0-}-type PlanCheckRunResult_Result struct {state protoimpl.MessageStatesizeCache protoimpl.SizeCache@@ -397,7 +278,7 @@ type PlanCheckRunResult_Result struct {func (x *PlanCheckRunResult_Result) Reset() {*x = PlanCheckRunResult_Result{}if protoimpl.UnsafeEnabled {- mi := &file_store_plan_check_run_proto_msgTypes[4]+ mi := &file_store_plan_check_run_proto_msgTypes[2]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -410,7 +291,7 @@ func (x *PlanCheckRunResult_Result) String() string {func (*PlanCheckRunResult_Result) ProtoMessage() {}func (x *PlanCheckRunResult_Result) ProtoReflect() protoreflect.Message {- mi := &file_store_plan_check_run_proto_msgTypes[4]+ mi := &file_store_plan_check_run_proto_msgTypes[2]if protoimpl.UnsafeEnabled && x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -506,7 +387,7 @@ type PlanCheckRunResult_Result_SqlSummaryReport struct {func (x *PlanCheckRunResult_Result_SqlSummaryReport) Reset() {*x = PlanCheckRunResult_Result_SqlSummaryReport{}if protoimpl.UnsafeEnabled {- mi := &file_store_plan_check_run_proto_msgTypes[5]+ mi := &file_store_plan_check_run_proto_msgTypes[3]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -519,7 +400,7 @@ func (x *PlanCheckRunResult_Result_SqlSummaryReport) String() string {func (*PlanCheckRunResult_Result_SqlSummaryReport) ProtoMessage() {}func (x *PlanCheckRunResult_Result_SqlSummaryReport) ProtoReflect() protoreflect.Message {- mi := &file_store_plan_check_run_proto_msgTypes[5]+ mi := &file_store_plan_check_run_proto_msgTypes[3]if protoimpl.UnsafeEnabled && x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -578,7 +459,7 @@ type PlanCheckRunResult_Result_SqlReviewReport struct {func (x *PlanCheckRunResult_Result_SqlReviewReport) Reset() {*x = PlanCheckRunResult_Result_SqlReviewReport{}if protoimpl.UnsafeEnabled {- mi := &file_store_plan_check_run_proto_msgTypes[6]+ mi := &file_store_plan_check_run_proto_msgTypes[4]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -591,7 +472,7 @@ func (x *PlanCheckRunResult_Result_SqlReviewReport) String() string {func (*PlanCheckRunResult_Result_SqlReviewReport) ProtoMessage() {}func (x *PlanCheckRunResult_Result_SqlReviewReport) ProtoReflect() protoreflect.Message {- mi := &file_store_plan_check_run_proto_msgTypes[6]+ mi := &file_store_plan_check_run_proto_msgTypes[4]if protoimpl.UnsafeEnabled && x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -643,7 +524,7 @@ var file_store_plan_check_run_proto_rawDesc = []byte{0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x1a, 0x23, 0x73, 0x74,0x6f, 0x72, 0x65, 0x2f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x63, 0x68, 0x61,0x6e, 0x67, 0x65, 0x5f, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74,- 0x6f, 0x22, 0xe6, 0x04, 0x0a, 0x12, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52,+ 0x6f, 0x22, 0x83, 0x03, 0x0a, 0x12, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52,0x75, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x68, 0x65, 0x65,0x74, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, 0x68, 0x65,0x65, 0x74, 0x55, 0x69, 0x64, 0x12, 0x67, 0x0a, 0x14, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x5f,@@ -652,92 +533,78 @@ var file_store_plan_check_run_proto_rawDesc = []byte{0x74, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75,0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x61,0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x12, 0x63, 0x68, 0x61, 0x6e,- 0x67, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x5c,- 0x0a, 0x0f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65,- 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,- 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65,- 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x44, 0x61, 0x74, 0x61,- 0x62, 0x61, 0x73, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x48, 0x00, 0x52, 0x0e, 0x64, 0x61,- 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x6c, 0x0a, 0x15,- 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x74,- 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x62, 0x79,- 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x6c, 0x61,- 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e,- 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x54, 0x61, 0x72,- 0x67, 0x65, 0x74, 0x48, 0x00, 0x52, 0x13, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x47,- 0x72, 0x6f, 0x75, 0x70, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x1a, 0x58, 0x0a, 0x0e, 0x44, 0x61,- 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x21, 0x0a, 0x0c,- 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,- 0x28, 0x05, 0x52, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x55, 0x69, 0x64, 0x12,- 0x23, 0x0a, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65,- 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65,- 0x4e, 0x61, 0x6d, 0x65, 0x1a, 0x43, 0x0a, 0x13, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65,- 0x47, 0x72, 0x6f, 0x75, 0x70, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x2c, 0x0a, 0x12, 0x64,- 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x75, 0x69,- 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73,- 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x55, 0x69, 0x64, 0x22, 0x55, 0x0a, 0x12, 0x43, 0x68, 0x61,+ 0x67, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x21,+ 0x0a, 0x0c, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x03,+ 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x55, 0x69,+ 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x6e, 0x61,+ 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61,+ 0x73, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x31, 0x0a, 0x12, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61,+ 0x73, 0x65, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01,+ 0x28, 0x03, 0x48, 0x00, 0x52, 0x10, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x47, 0x72,+ 0x6f, 0x75, 0x70, 0x55, 0x69, 0x64, 0x88, 0x01, 0x01, 0x22, 0x55, 0x0a, 0x12, 0x43, 0x68, 0x61,0x6e, 0x67, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12,0x24, 0x0a, 0x20, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x42, 0x41,0x53, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46,0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x44, 0x44, 0x4c, 0x10, 0x01, 0x12, 0x07,0x0a, 0x03, 0x44, 0x4d, 0x4c, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x53, 0x44, 0x4c, 0x10, 0x03,- 0x42, 0x08, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x22, 0xdf, 0x06, 0x0a, 0x12, 0x50,- 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c,- 0x74, 0x12, 0x43, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03,- 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74,- 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e,- 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72,- 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18,- 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x1a, 0xed, 0x05, 0x0a,- 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x48, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75,- 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x30, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,- 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65,- 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x75,- 0x6c, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75,- 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,- 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65,- 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e,- 0x74, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52,- 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x6a, 0x0a, 0x12, 0x73, 0x71, 0x6c, 0x5f, 0x73, 0x75, 0x6d,- 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28,- 0x0b, 0x32, 0x3a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f,- 0x72, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x52,- 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x53, 0x71, 0x6c,- 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x48, 0x00, 0x52,- 0x10, 0x73, 0x71, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x70, 0x6f, 0x72,- 0x74, 0x12, 0x67, 0x0a, 0x11, 0x73, 0x71, 0x6c, 0x5f, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x5f,- 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x62,- 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x6c,- 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74,- 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x53, 0x71, 0x6c, 0x52, 0x65, 0x76, 0x69, 0x65,- 0x77, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x48, 0x00, 0x52, 0x0f, 0x73, 0x71, 0x6c, 0x52, 0x65,- 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x1a, 0xc3, 0x01, 0x0a, 0x10, 0x53,- 0x71, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12,- 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63,- 0x6f, 0x64, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74,- 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x74,- 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, 0x23, 0x0a, 0x0d,- 0x61, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x03, 0x20,- 0x01, 0x28, 0x03, 0x52, 0x0c, 0x61, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x52, 0x6f, 0x77,- 0x73, 0x12, 0x4d, 0x0a, 0x11, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x73,- 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x62,- 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x68,- 0x61, 0x6e, 0x67, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x10,- 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73,- 0x1a, 0x69, 0x0a, 0x0f, 0x53, 0x71, 0x6c, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x70,- 0x6f, 0x72, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,- 0x03, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d,- 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x12,- 0x16, 0x0a, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,- 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18,- 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x45, 0x0a, 0x06, 0x53,- 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f,- 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a,- 0x05, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x57, 0x41, 0x52, 0x4e,- 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53,- 0x10, 0x03, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x42, 0x14, 0x5a, 0x12,- 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x73, 0x74, 0x6f,- 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,+ 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x67, 0x72,+ 0x6f, 0x75, 0x70, 0x5f, 0x75, 0x69, 0x64, 0x22, 0xdf, 0x06, 0x0a, 0x12, 0x50, 0x6c, 0x61, 0x6e,+ 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x43,+ 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32,+ 0x29, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65,+ 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x73,+ 0x75, 0x6c, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75,+ 0x6c, 0x74, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01,+ 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x1a, 0xed, 0x05, 0x0a, 0x06, 0x52, 0x65,+ 0x73, 0x75, 0x6c, 0x74, 0x12, 0x48, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01,+ 0x20, 0x01, 0x28, 0x0e, 0x32, 0x30, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,+ 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52,+ 0x75, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e,+ 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x14,+ 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74,+ 0x69, 0x74, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18,+ 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x12,+ 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f,+ 0x64, 0x65, 0x12, 0x6a, 0x0a, 0x12, 0x73, 0x71, 0x6c, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72,+ 0x79, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a,+ 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e,+ 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x73, 0x75,+ 0x6c, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x53, 0x71, 0x6c, 0x53, 0x75, 0x6d,+ 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x48, 0x00, 0x52, 0x10, 0x73, 0x71,+ 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x67,+ 0x0a, 0x11, 0x73, 0x71, 0x6c, 0x5f, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x72, 0x65, 0x70,+ 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x62, 0x79, 0x74, 0x65,+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x43,+ 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x52, 0x65,+ 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x53, 0x71, 0x6c, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65,+ 0x70, 0x6f, 0x72, 0x74, 0x48, 0x00, 0x52, 0x0f, 0x73, 0x71, 0x6c, 0x52, 0x65, 0x76, 0x69, 0x65,+ 0x77, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x1a, 0xc3, 0x01, 0x0a, 0x10, 0x53, 0x71, 0x6c, 0x53,+ 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x12, 0x0a, 0x04,+ 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65,+ 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79,+ 0x70, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x74, 0x61, 0x74, 0x65,+ 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x66, 0x66,+ 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03,+ 0x52, 0x0c, 0x61, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x52, 0x6f, 0x77, 0x73, 0x12, 0x4d,+ 0x0a, 0x11, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72,+ 0x63, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65,+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67,+ 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x10, 0x63, 0x68, 0x61,+ 0x6e, 0x67, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x1a, 0x69, 0x0a,+ 0x0f, 0x53, 0x71, 0x6c, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74,+ 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04,+ 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x18, 0x02,+ 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x12, 0x16, 0x0a, 0x06,+ 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65,+ 0x74, 0x61, 0x69, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01,+ 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x45, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74,+ 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53,+ 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52,+ 0x52, 0x4f, 0x52, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x57, 0x41, 0x52, 0x4e, 0x49, 0x4e, 0x47,+ 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x03, 0x42,+ 0x08, 0x0a, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x42, 0x14, 0x5a, 0x12, 0x67, 0x65, 0x6e,+ 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62,+ 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,}var (@@ -753,33 +620,29 @@ func file_store_plan_check_run_proto_rawDescGZIP() []byte {}var file_store_plan_check_run_proto_enumTypes = make([]protoimpl.EnumInfo, 2)-var file_store_plan_check_run_proto_msgTypes = make([]protoimpl.MessageInfo, 7)+var file_store_plan_check_run_proto_msgTypes = make([]protoimpl.MessageInfo, 5)var file_store_plan_check_run_proto_goTypes = []interface{}{(PlanCheckRunConfig_ChangeDatabaseType)(0), // 0: bytebase.store.PlanCheckRunConfig.ChangeDatabaseType(PlanCheckRunResult_Result_Status)(0), // 1: bytebase.store.PlanCheckRunResult.Result.Status(*PlanCheckRunConfig)(nil), // 2: bytebase.store.PlanCheckRunConfig(*PlanCheckRunResult)(nil), // 3: bytebase.store.PlanCheckRunResult- (*PlanCheckRunConfig_DatabaseTarget)(nil), // 4: bytebase.store.PlanCheckRunConfig.DatabaseTarget- (*PlanCheckRunConfig_DatabaseGroupTarget)(nil), // 5: bytebase.store.PlanCheckRunConfig.DatabaseGroupTarget- (*PlanCheckRunResult_Result)(nil), // 6: bytebase.store.PlanCheckRunResult.Result- (*PlanCheckRunResult_Result_SqlSummaryReport)(nil), // 7: bytebase.store.PlanCheckRunResult.Result.SqlSummaryReport- (*PlanCheckRunResult_Result_SqlReviewReport)(nil), // 8: bytebase.store.PlanCheckRunResult.Result.SqlReviewReport- (*ChangedResources)(nil), // 9: bytebase.store.ChangedResources+ (*PlanCheckRunResult_Result)(nil), // 4: bytebase.store.PlanCheckRunResult.Result+ (*PlanCheckRunResult_Result_SqlSummaryReport)(nil), // 5: bytebase.store.PlanCheckRunResult.Result.SqlSummaryReport+ (*PlanCheckRunResult_Result_SqlReviewReport)(nil), // 6: bytebase.store.PlanCheckRunResult.Result.SqlReviewReport+ (*ChangedResources)(nil), // 7: bytebase.store.ChangedResources}var file_store_plan_check_run_proto_depIdxs = []int32{0, // 0: bytebase.store.PlanCheckRunConfig.change_database_type:type_name -> bytebase.store.PlanCheckRunConfig.ChangeDatabaseType- 4, // 1: bytebase.store.PlanCheckRunConfig.database_target:type_name -> bytebase.store.PlanCheckRunConfig.DatabaseTarget- 5, // 2: bytebase.store.PlanCheckRunConfig.database_group_target:type_name -> bytebase.store.PlanCheckRunConfig.DatabaseGroupTarget- 6, // 3: bytebase.store.PlanCheckRunResult.results:type_name -> bytebase.store.PlanCheckRunResult.Result- 1, // 4: bytebase.store.PlanCheckRunResult.Result.status:type_name -> bytebase.store.PlanCheckRunResult.Result.Status- 7, // 5: bytebase.store.PlanCheckRunResult.Result.sql_summary_report:type_name -> bytebase.store.PlanCheckRunResult.Result.SqlSummaryReport- 8, // 6: bytebase.store.PlanCheckRunResult.Result.sql_review_report:type_name -> bytebase.store.PlanCheckRunResult.Result.SqlReviewReport- 9, // 7: bytebase.store.PlanCheckRunResult.Result.SqlSummaryReport.changed_resources:type_name -> bytebase.store.ChangedResources- 8, // [8:8] is the sub-list for method output_type- 8, // [8:8] is the sub-list for method input_type- 8, // [8:8] is the sub-list for extension type_name- 8, // [8:8] is the sub-list for extension extendee- 0, // [0:8] is the sub-list for field type_name+ 4, // 1: bytebase.store.PlanCheckRunResult.results:type_name -> bytebase.store.PlanCheckRunResult.Result+ 1, // 2: bytebase.store.PlanCheckRunResult.Result.status:type_name -> bytebase.store.PlanCheckRunResult.Result.Status+ 5, // 3: bytebase.store.PlanCheckRunResult.Result.sql_summary_report:type_name -> bytebase.store.PlanCheckRunResult.Result.SqlSummaryReport+ 6, // 4: bytebase.store.PlanCheckRunResult.Result.sql_review_report:type_name -> bytebase.store.PlanCheckRunResult.Result.SqlReviewReport+ 7, // 5: bytebase.store.PlanCheckRunResult.Result.SqlSummaryReport.changed_resources:type_name -> bytebase.store.ChangedResources+ 6, // [6:6] is the sub-list for method output_type+ 6, // [6:6] is the sub-list for method input_type+ 6, // [6:6] is the sub-list for extension type_name+ 6, // [6:6] is the sub-list for extension extendee+ 0, // [0:6] is the sub-list for field type_name}func init() { file_store_plan_check_run_proto_init() }@@ -814,30 +677,6 @@ func file_store_plan_check_run_proto_init() {}}file_store_plan_check_run_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {- switch v := v.(*PlanCheckRunConfig_DatabaseTarget); i {- case 0:- return &v.state- case 1:- return &v.sizeCache- case 2:- return &v.unknownFields- default:- return nil- }- }- file_store_plan_check_run_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {- switch v := v.(*PlanCheckRunConfig_DatabaseGroupTarget); i {- case 0:- return &v.state- case 1:- return &v.sizeCache- case 2:- return &v.unknownFields- default:- return nil- }- }- file_store_plan_check_run_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {switch v := v.(*PlanCheckRunResult_Result); i {case 0:return &v.state@@ -849,7 +688,7 @@ func file_store_plan_check_run_proto_init() {return nil}}- file_store_plan_check_run_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {+ file_store_plan_check_run_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {switch v := v.(*PlanCheckRunResult_Result_SqlSummaryReport); i {case 0:return &v.state@@ -861,7 +700,7 @@ func file_store_plan_check_run_proto_init() {return nil}}- file_store_plan_check_run_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {+ file_store_plan_check_run_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {switch v := v.(*PlanCheckRunResult_Result_SqlReviewReport); i {case 0:return &v.state@@ -874,11 +713,8 @@ func file_store_plan_check_run_proto_init() {}}}- file_store_plan_check_run_proto_msgTypes[0].OneofWrappers = []interface{}{- (*PlanCheckRunConfig_DatabaseTarget_)(nil),- (*PlanCheckRunConfig_DatabaseGroupTarget_)(nil),- }- file_store_plan_check_run_proto_msgTypes[4].OneofWrappers = []interface{}{+ file_store_plan_check_run_proto_msgTypes[0].OneofWrappers = []interface{}{}+ file_store_plan_check_run_proto_msgTypes[2].OneofWrappers = []interface{}{(*PlanCheckRunResult_Result_SqlSummaryReport_)(nil),(*PlanCheckRunResult_Result_SqlReviewReport_)(nil),}@@ -888,7 +724,7 @@ func file_store_plan_check_run_proto_init() {GoPackagePath: reflect.TypeOf(x{}).PkgPath(),RawDescriptor: file_store_plan_check_run_proto_rawDesc,NumEnums: 2,- NumMessages: 7,+ NumMessages: 5,NumExtensions: 0,NumServices: 0,},diff --git a/proto/generated-go/v1/rollout_service.pb.go b/proto/generated-go/v1/rollout_service.pb.goindex 825cc05aea..0aa5d3aa18 100644--- a/proto/generated-go/v1/rollout_service.pb.go+++ b/proto/generated-go/v1/rollout_service.pb.go@@ -1467,7 +1467,6 @@ type PlanCheckRun struct {Type PlanCheckRun_Type `protobuf:"varint,3,opt,name=type,proto3,enum=bytebase.v1.PlanCheckRun_Type" json:"type,omitempty"`Status PlanCheckRun_Status `protobuf:"varint,4,opt,name=status,proto3,enum=bytebase.v1.PlanCheckRun_Status" json:"status,omitempty"`// Format: instances/{instance}/databases/{database}- // Format: projects/{project}/databaseGroups/{databaseGroup}Target string `protobuf:"bytes,5,opt,name=target,proto3" json:"target,omitempty"`// Format: projects/{project}/sheets/{sheet}Sheet string `protobuf:"bytes,6,opt,name=sheet,proto3" json:"sheet,omitempty"`diff --git a/proto/store/plan.proto b/proto/store/plan.protoindex 913ee407be..e9e7fbe992 100644--- a/proto/store/plan.proto+++ b/proto/store/plan.proto@@ -53,7 +53,7 @@ message PlanConfig {message ChangeDatabaseConfig {// The resource name of the target.// Format: instances/{instance-id}/databases/{database-name}.- // Format: projects/{project}/deploymentConfig.+ // Format: projects/{project}/databaseGroups/{databaseGroup}string target = 1;// The resource name of the sheet.// Format: projects/{project}/sheets/{sheet}diff --git a/proto/store/plan_check_run.proto b/proto/store/plan_check_run.protoindex 302d6c3519..9d97d0d457 100644--- a/proto/store/plan_check_run.proto+++ b/proto/store/plan_check_run.proto@@ -9,19 +9,10 @@ option go_package = "generated-go/store";message PlanCheckRunConfig {int32 sheet_uid = 1;ChangeDatabaseType change_database_type = 2;-- oneof target {- DatabaseTarget database_target = 3;- DatabaseGroupTarget database_group_target = 4;- }-- message DatabaseTarget {- int32 instance_uid = 1;- string database_name = 2;- }- message DatabaseGroupTarget {- int64 database_group_uid = 1;- }+ int32 instance_uid = 3;+ string database_name = 4;+ // database_group_uid is optional. If it's set, it means the database is part of a database group.+ optional int64 database_group_uid = 5;enum ChangeDatabaseType {CHANGE_DATABASE_TYPE_UNSPECIFIED = 0;diff --git a/proto/v1/rollout_service.proto b/proto/v1/rollout_service.protoindex d03e610ddb..85ab45f4fa 100644--- a/proto/v1/rollout_service.proto+++ b/proto/v1/rollout_service.proto@@ -387,7 +387,6 @@ message PlanCheckRun {Status status = 4;// Format: instances/{instance}/databases/{database}- // Format: projects/{project}/databaseGroups/{databaseGroup}string target = 5;// Format: projects/{project}/sheets/{sheet}string sheet = 6;