Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

refactor: consolidate v1 API PlanCheckRun model (#18603)

p0nybbb2e7036fc6
diff --git a/backend/api/mcp/gen/openapi.yaml b/backend/api/mcp/gen/openapi.yaml
index 045cca2562..362f6f2986 100644
--- a/backend/api/mcp/gen/openapi.yaml
+++ b/backend/api/mcp/gen/openapi.yaml
@@ -12960,20 +12960,9 @@ components:
type: string
title: name
description: 'Format: projects/{project}/plans/{plan}/planCheckRuns/{planCheckRun}'
- type:
- title: type
- $ref: '#/components/schemas/bytebase.v1.PlanCheckRun.Type'
status:
title: status
$ref: '#/components/schemas/bytebase.v1.PlanCheckRun.Status'
- target:
- type: string
- title: target
- description: 'Format: instances/{instance}/databases/{database}'
- sheet:
- type: string
- title: sheet
- description: 'Format: project/{project}/sheets/{sheet}'
results:
type: array
items:
@@ -13005,6 +12994,15 @@ components:
type: integer
title: code
format: int32
+ target:
+ type: string
+ title: target
+ description: |-
+ Target identification for consolidated results.
+ Format: instances/{instance}/databases/{database}
+ type:
+ title: type
+ $ref: '#/components/schemas/bytebase.v1.PlanCheckRun.Result.Type'
- oneOf:
- properties:
sqlReviewReport:
@@ -13051,6 +13049,14 @@ components:
format: int64
title: SqlSummaryReport
additionalProperties: false
+ bytebase.v1.PlanCheckRun.Result.Type:
+ type: string
+ title: Type
+ enum:
+ - TYPE_UNSPECIFIED
+ - STATEMENT_ADVISE
+ - STATEMENT_SUMMARY_REPORT
+ - GHOST_SYNC
bytebase.v1.PlanCheckRun.Status:
type: string
title: Status
@@ -13060,14 +13066,6 @@ components:
- DONE
- FAILED
- CANCELED
- bytebase.v1.PlanCheckRun.Type:
- type: string
- title: Type
- enum:
- - TYPE_UNSPECIFIED
- - DATABASE_STATEMENT_ADVISE
- - DATABASE_STATEMENT_SUMMARY_REPORT
- - DATABASE_GHOST_SYNC
bytebase.v1.PlanConfig:
type: object
properties:
diff --git a/backend/api/v1/plan_service.go b/backend/api/v1/plan_service.go
index 44092b45ed..5d09e5ce2f 100644
--- a/backend/api/v1/plan_service.go
+++ b/backend/api/v1/plan_service.go
@@ -1058,9 +1058,13 @@ func convertPlan(plan *v1pb.Plan) *storepb.PlanConfig {
func convertToPlanCheckRuns(projectID string, planUID int64, runs []*store.PlanCheckRunMessage) []*v1pb.PlanCheckRun {
var planCheckRuns []*v1pb.PlanCheckRun
for _, run := range runs {
- // Expand consolidated run into virtual records for backward compatibility
- expanded := expandPlanCheckRun(projectID, planUID, run)
- planCheckRuns = append(planCheckRuns, expanded...)
+ planCheckRuns = append(planCheckRuns, &v1pb.PlanCheckRun{
+ Name: common.FormatPlanCheckRun(projectID, planUID, int64(run.UID)),
+ Status: convertToPlanCheckRunStatus(run.Status),
+ Results: convertToPlanCheckRunResults(run.Result.GetResults()),
+ Error: run.Result.Error,
+ CreateTime: timestamppb.New(run.CreatedAt),
+ })
}
return planCheckRuns
}
@@ -1248,66 +1252,6 @@ func convertPlanSpecExportDataConfig(config *v1pb.Plan_Spec_ExportDataConfig) *s
}
}
-// expandPlanCheckRun expands a consolidated plan check run into multiple virtual
-// records for API backward compatibility. Each target/type combination becomes
-// a separate API response record.
-func expandPlanCheckRun(projectID string, planUID int64, run *store.PlanCheckRunMessage) []*v1pb.PlanCheckRun {
- var runs []*v1pb.PlanCheckRun
-
- // Group results by target and type
- type key struct {
- target string
- checkType storepb.PlanCheckType
- }
- resultsByKey := make(map[key][]*storepb.PlanCheckRunResult_Result)
- for _, result := range run.Result.GetResults() {
- k := key{
- target: result.Target,
- checkType: result.Type,
- }
- resultsByKey[k] = append(resultsByKey[k], result)
- }
-
- // Build virtual records from targets
- virtualID := 0
- for _, target := range run.Config.GetTargets() {
- for _, checkType := range target.Types {
- virtualID++
- k := key{
- target: target.Target,
- checkType: checkType,
- }
- results := resultsByKey[k]
-
- runs = append(runs, &v1pb.PlanCheckRun{
- Name: common.FormatPlanCheckRun(projectID, planUID, int64(run.UID)*1000+int64(virtualID)),
- CreateTime: timestamppb.New(run.CreatedAt),
- Type: convertPlanCheckType(checkType),
- Status: convertToPlanCheckRunStatus(run.Status),
- Target: target.Target,
- Sheet: common.FormatSheet(projectID, target.SheetSha256),
- Results: convertToPlanCheckRunResults(results),
- Error: run.Result.Error,
- })
- }
- }
-
- return runs
-}
-
-func convertPlanCheckType(t storepb.PlanCheckType) v1pb.PlanCheckRun_Type {
- switch t {
- case storepb.PlanCheckType_PLAN_CHECK_TYPE_STATEMENT_ADVISE:
- return v1pb.PlanCheckRun_DATABASE_STATEMENT_ADVISE
- case storepb.PlanCheckType_PLAN_CHECK_TYPE_STATEMENT_SUMMARY_REPORT:
- return v1pb.PlanCheckRun_DATABASE_STATEMENT_SUMMARY_REPORT
- case storepb.PlanCheckType_PLAN_CHECK_TYPE_GHOST_SYNC:
- return v1pb.PlanCheckRun_DATABASE_GHOST_SYNC
- default:
- return v1pb.PlanCheckRun_TYPE_UNSPECIFIED
- }
-}
-
func convertToPlanCheckRunStatus(status store.PlanCheckRunStatus) v1pb.PlanCheckRun_Status {
switch status {
case store.PlanCheckRunStatusCanceled:
@@ -1337,6 +1281,8 @@ func convertToPlanCheckRunResult(result *storepb.PlanCheckRunResult_Result) *v1p
Title: result.Title,
Content: result.Content,
Code: result.Code,
+ Target: result.Target,
+ Type: convertToV1ResultType(result.Type),
Report: nil,
}
switch report := result.Report.(type) {
@@ -1358,6 +1304,19 @@ func convertToPlanCheckRunResult(result *storepb.PlanCheckRunResult_Result) *v1p
return resultV1
}
+func convertToV1ResultType(t storepb.PlanCheckType) v1pb.PlanCheckRun_Result_Type {
+ switch t {
+ case storepb.PlanCheckType_PLAN_CHECK_TYPE_STATEMENT_ADVISE:
+ return v1pb.PlanCheckRun_Result_STATEMENT_ADVISE
+ case storepb.PlanCheckType_PLAN_CHECK_TYPE_STATEMENT_SUMMARY_REPORT:
+ return v1pb.PlanCheckRun_Result_STATEMENT_SUMMARY_REPORT
+ case storepb.PlanCheckType_PLAN_CHECK_TYPE_GHOST_SYNC:
+ return v1pb.PlanCheckRun_Result_GHOST_SYNC
+ default:
+ return v1pb.PlanCheckRun_Result_TYPE_UNSPECIFIED
+ }
+}
+
func convertToPlanCheckRunResultStatus(status storepb.Advice_Status) v1pb.Advice_Level {
switch status {
case storepb.Advice_STATUS_UNSPECIFIED:
diff --git a/backend/generated-go/v1/plan_service.pb.go b/backend/generated-go/v1/plan_service.pb.go
index e2a0e70529..27f3c28cf9 100644
--- a/backend/generated-go/v1/plan_service.pb.go
+++ b/backend/generated-go/v1/plan_service.pb.go
@@ -25,115 +25,111 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
-type PlanCheckRun_Type int32
+type PlanCheckRun_Status int32
const (
- // Unspecified check type.
- PlanCheckRun_TYPE_UNSPECIFIED PlanCheckRun_Type = 0
- // SQL review check that analyzes statements against configured SQL review rules.
- PlanCheckRun_DATABASE_STATEMENT_ADVISE PlanCheckRun_Type = 2
- // Summary report check that generates impact analysis for the statements.
- PlanCheckRun_DATABASE_STATEMENT_SUMMARY_REPORT PlanCheckRun_Type = 3
- // Ghost sync check that validates gh-ost online schema change compatibility.
- PlanCheckRun_DATABASE_GHOST_SYNC PlanCheckRun_Type = 5
+ PlanCheckRun_STATUS_UNSPECIFIED PlanCheckRun_Status = 0
+ PlanCheckRun_RUNNING PlanCheckRun_Status = 1
+ PlanCheckRun_DONE PlanCheckRun_Status = 2
+ PlanCheckRun_FAILED PlanCheckRun_Status = 3
+ PlanCheckRun_CANCELED PlanCheckRun_Status = 4
)
-// Enum value maps for PlanCheckRun_Type.
+// Enum value maps for PlanCheckRun_Status.
var (
- PlanCheckRun_Type_name = map[int32]string{
- 0: "TYPE_UNSPECIFIED",
- 2: "DATABASE_STATEMENT_ADVISE",
- 3: "DATABASE_STATEMENT_SUMMARY_REPORT",
- 5: "DATABASE_GHOST_SYNC",
+ PlanCheckRun_Status_name = map[int32]string{
+ 0: "STATUS_UNSPECIFIED",
+ 1: "RUNNING",
+ 2: "DONE",
+ 3: "FAILED",
+ 4: "CANCELED",
}
- PlanCheckRun_Type_value = map[string]int32{
- "TYPE_UNSPECIFIED": 0,
- "DATABASE_STATEMENT_ADVISE": 2,
- "DATABASE_STATEMENT_SUMMARY_REPORT": 3,
- "DATABASE_GHOST_SYNC": 5,
+ PlanCheckRun_Status_value = map[string]int32{
+ "STATUS_UNSPECIFIED": 0,
+ "RUNNING": 1,
+ "DONE": 2,
+ "FAILED": 3,
+ "CANCELED": 4,
}
)
-func (x PlanCheckRun_Type) Enum() *PlanCheckRun_Type {
- p := new(PlanCheckRun_Type)
+func (x PlanCheckRun_Status) Enum() *PlanCheckRun_Status {
+ p := new(PlanCheckRun_Status)
*p = x
return p
}
-func (x PlanCheckRun_Type) String() string {
+func (x PlanCheckRun_Status) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
-func (PlanCheckRun_Type) Descriptor() protoreflect.EnumDescriptor {
+func (PlanCheckRun_Status) Descriptor() protoreflect.EnumDescriptor {
return file_v1_plan_service_proto_enumTypes[0].Descriptor()
}
-func (PlanCheckRun_Type) Type() protoreflect.EnumType {
+func (PlanCheckRun_Status) Type() protoreflect.EnumType {
return &file_v1_plan_service_proto_enumTypes[0]
}
-func (x PlanCheckRun_Type) Number() protoreflect.EnumNumber {
+func (x PlanCheckRun_Status) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
-// Deprecated: Use PlanCheckRun_Type.Descriptor instead.
-func (PlanCheckRun_Type) EnumDescriptor() ([]byte, []int) {
+// Deprecated: Use PlanCheckRun_Status.Descriptor instead.
+func (PlanCheckRun_Status) EnumDescriptor() ([]byte, []int) {
return file_v1_plan_service_proto_rawDescGZIP(), []int{14, 0}
}
-type PlanCheckRun_Status int32
+type PlanCheckRun_Result_Type int32
const (
- PlanCheckRun_STATUS_UNSPECIFIED PlanCheckRun_Status = 0
- PlanCheckRun_RUNNING PlanCheckRun_Status = 1
- PlanCheckRun_DONE PlanCheckRun_Status = 2
- PlanCheckRun_FAILED PlanCheckRun_Status = 3
- PlanCheckRun_CANCELED PlanCheckRun_Status = 4
+ PlanCheckRun_Result_TYPE_UNSPECIFIED PlanCheckRun_Result_Type = 0
+ PlanCheckRun_Result_STATEMENT_ADVISE PlanCheckRun_Result_Type = 1
+ PlanCheckRun_Result_STATEMENT_SUMMARY_REPORT PlanCheckRun_Result_Type = 2
+ PlanCheckRun_Result_GHOST_SYNC PlanCheckRun_Result_Type = 3
)
-// Enum value maps for PlanCheckRun_Status.
+// Enum value maps for PlanCheckRun_Result_Type.
var (
- PlanCheckRun_Status_name = map[int32]string{
- 0: "STATUS_UNSPECIFIED",
- 1: "RUNNING",
- 2: "DONE",
- 3: "FAILED",
- 4: "CANCELED",
+ PlanCheckRun_Result_Type_name = map[int32]string{
+ 0: "TYPE_UNSPECIFIED",
+ 1: "STATEMENT_ADVISE",
+ 2: "STATEMENT_SUMMARY_REPORT",
+ 3: "GHOST_SYNC",
}
- PlanCheckRun_Status_value = map[string]int32{
- "STATUS_UNSPECIFIED": 0,
- "RUNNING": 1,
- "DONE": 2,
- "FAILED": 3,
- "CANCELED": 4,
+ PlanCheckRun_Result_Type_value = map[string]int32{
+ "TYPE_UNSPECIFIED": 0,
+ "STATEMENT_ADVISE": 1,
+ "STATEMENT_SUMMARY_REPORT": 2,
+ "GHOST_SYNC": 3,
}
)
-func (x PlanCheckRun_Status) Enum() *PlanCheckRun_Status {
- p := new(PlanCheckRun_Status)
+func (x PlanCheckRun_Result_Type) Enum() *PlanCheckRun_Result_Type {
+ p := new(PlanCheckRun_Result_Type)
*p = x
return p
}
-func (x PlanCheckRun_Status) String() string {
+func (x PlanCheckRun_Result_Type) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
-func (PlanCheckRun_Status) Descriptor() protoreflect.EnumDescriptor {
+func (PlanCheckRun_Result_Type) Descriptor() protoreflect.EnumDescriptor {
return file_v1_plan_service_proto_enumTypes[1].Descriptor()
}
-func (PlanCheckRun_Status) Type() protoreflect.EnumType {
+func (PlanCheckRun_Result_Type) Type() protoreflect.EnumType {
return &file_v1_plan_service_proto_enumTypes[1]
}
-func (x PlanCheckRun_Status) Number() protoreflect.EnumNumber {
+func (x PlanCheckRun_Result_Type) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
-// Deprecated: Use PlanCheckRun_Status.Descriptor instead.
-func (PlanCheckRun_Status) EnumDescriptor() ([]byte, []int) {
- return file_v1_plan_service_proto_rawDescGZIP(), []int{14, 1}
+// Deprecated: Use PlanCheckRun_Result_Type.Descriptor instead.
+func (PlanCheckRun_Result_Type) EnumDescriptor() ([]byte, []int) {
+ return file_v1_plan_service_proto_rawDescGZIP(), []int{14, 0, 0}
}
type GetPlanRequest struct {
@@ -1038,13 +1034,8 @@ func (*BatchCancelPlanCheckRunsResponse) Descriptor() ([]byte, []int) {
type PlanCheckRun struct {
state protoimpl.MessageState `protogen:"open.v1"`
// Format: projects/{project}/plans/{plan}/planCheckRuns/{planCheckRun}
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- Type PlanCheckRun_Type `protobuf:"varint,2,opt,name=type,proto3,enum=bytebase.v1.PlanCheckRun_Type" json:"type,omitempty"`
- Status PlanCheckRun_Status `protobuf:"varint,3,opt,name=status,proto3,enum=bytebase.v1.PlanCheckRun_Status" json:"status,omitempty"`
- // Format: instances/{instance}/databases/{database}
- Target string `protobuf:"bytes,4,opt,name=target,proto3" json:"target,omitempty"`
- // Format: project/{project}/sheets/{sheet}
- Sheet string `protobuf:"bytes,5,opt,name=sheet,proto3" json:"sheet,omitempty"`
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ Status PlanCheckRun_Status `protobuf:"varint,3,opt,name=status,proto3,enum=bytebase.v1.PlanCheckRun_Status" json:"status,omitempty"`
Results []*PlanCheckRun_Result `protobuf:"bytes,6,rep,name=results,proto3" json:"results,omitempty"`
// error is set if the Status is FAILED.
Error string `protobuf:"bytes,7,opt,name=error,proto3" json:"error,omitempty"`
@@ -1090,13 +1081,6 @@ func (x *PlanCheckRun) GetName() string {
return ""
}
-func (x *PlanCheckRun) GetType() PlanCheckRun_Type {
- if x != nil {
- return x.Type
- }
- return PlanCheckRun_TYPE_UNSPECIFIED
-}
-
func (x *PlanCheckRun) GetStatus() PlanCheckRun_Status {
if x != nil {
return x.Status
@@ -1104,20 +1088,6 @@ func (x *PlanCheckRun) GetStatus() PlanCheckRun_Status {
return PlanCheckRun_STATUS_UNSPECIFIED
}
-func (x *PlanCheckRun) GetTarget() string {
- if x != nil {
- return x.Target
- }
- return ""
-}
-
-func (x *PlanCheckRun) GetSheet() string {
- if x != nil {
- return x.Sheet
- }
- return ""
-}
-
func (x *PlanCheckRun) GetResults() []*PlanCheckRun_Result {
if x != nil {
return x.Results
@@ -1541,6 +1511,10 @@ type PlanCheckRun_Result struct {
Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"`
Code int32 `protobuf:"varint,4,opt,name=code,proto3" json:"code,omitempty"`
+ // Target identification for consolidated results.
+ // Format: instances/{instance}/databases/{database}
+ Target string `protobuf:"bytes,7,opt,name=target,proto3" json:"target,omitempty"`
+ Type PlanCheckRun_Result_Type `protobuf:"varint,8,opt,name=type,proto3,enum=bytebase.v1.PlanCheckRun_Result_Type" json:"type,omitempty"`
// Types that are valid to be assigned to Report:
//
// *PlanCheckRun_Result_SqlSummaryReport_
@@ -1608,6 +1582,20 @@ func (x *PlanCheckRun_Result) GetCode() int32 {
return 0
}
+func (x *PlanCheckRun_Result) GetTarget() string {
+ if x != nil {
+ return x.Target
+ }
+ return ""
+}
+
+func (x *PlanCheckRun_Result) GetType() PlanCheckRun_Result_Type {
+ if x != nil {
+ return x.Type
+ }
+ return PlanCheckRun_Result_TYPE_UNSPECIFIED
+}
+
func (x *PlanCheckRun_Result) GetReport() isPlanCheckRun_Result_Report {
if x != nil {
return x.Report
@@ -1862,22 +1850,21 @@ const file_v1_plan_service_proto_rawDesc = "" +
"\x06parent\x18\x01 \x01(\tB\x19\xe0A\x02\xfaA\x13\n" +
"\x11bytebase.com/PlanR\x06parent\x12&\n" +
"\x0fplan_check_runs\x18\x02 \x03(\tR\rplanCheckRuns\"\"\n" +
- " BatchCancelPlanCheckRunsResponse\"\xdf\b\n" +
+ " BatchCancelPlanCheckRunsResponse\"\xb5\b\n" +
"\fPlanCheckRun\x12\x12\n" +
- "\x04name\x18\x01 \x01(\tR\x04name\x122\n" +
- "\x04type\x18\x02 \x01(\x0e2\x1e.bytebase.v1.PlanCheckRun.TypeR\x04type\x128\n" +
- "\x06status\x18\x03 \x01(\x0e2 .bytebase.v1.PlanCheckRun.StatusR\x06status\x12\x16\n" +
- "\x06target\x18\x04 \x01(\tR\x06target\x12\x14\n" +
- "\x05sheet\x18\x05 \x01(\tR\x05sheet\x12:\n" +
+ "\x04name\x18\x01 \x01(\tR\x04name\x128\n" +
+ "\x06status\x18\x03 \x01(\x0e2 .bytebase.v1.PlanCheckRun.StatusR\x06status\x12:\n" +
"\aresults\x18\x06 \x03(\v2 .bytebase.v1.PlanCheckRun.ResultR\aresults\x12\x14\n" +
"\x05error\x18\a \x01(\tR\x05error\x12@\n" +
"\vcreate_time\x18\b \x01(\v2\x1a.google.protobuf.TimestampB\x03\xe0A\x03R\n" +
- "createTime\x1a\xba\x04\n" +
+ "createTime\x1a\xef\x05\n" +
"\x06Result\x121\n" +
"\x06status\x18\x01 \x01(\x0e2\x19.bytebase.v1.Advice.LevelR\x06status\x12\x14\n" +
"\x05title\x18\x02 \x01(\tR\x05title\x12\x18\n" +
"\acontent\x18\x03 \x01(\tR\acontent\x12\x12\n" +
- "\x04code\x18\x04 \x01(\x05R\x04code\x12a\n" +
+ "\x04code\x18\x04 \x01(\x05R\x04code\x12\x16\n" +
+ "\x06target\x18\a \x01(\tR\x06target\x129\n" +
+ "\x04type\x18\b \x01(\x0e2%.bytebase.v1.PlanCheckRun.Result.TypeR\x04type\x12a\n" +
"\x12sql_summary_report\x18\x05 \x01(\v21.bytebase.v1.PlanCheckRun.Result.SqlSummaryReportH\x00R\x10sqlSummaryReport\x12^\n" +
"\x11sql_review_report\x18\x06 \x01(\v20.bytebase.v1.PlanCheckRun.Result.SqlReviewReportH\x00R\x0fsqlReviewReport\x1a`\n" +
"\x10SqlSummaryReport\x12'\n" +
@@ -1885,13 +1872,14 @@ const file_v1_plan_service_proto_rawDesc = "" +
"\raffected_rows\x18\x03 \x01(\x03R\faffectedRows\x1a\x89\x01\n" +
"\x0fSqlReviewReport\x12<\n" +
"\x0estart_position\x18\x05 \x01(\v2\x15.bytebase.v1.PositionR\rstartPosition\x128\n" +
- "\fend_position\x18\x06 \x01(\v2\x15.bytebase.v1.PositionR\vendPositionB\b\n" +
- "\x06report\"{\n" +
+ "\fend_position\x18\x06 \x01(\v2\x15.bytebase.v1.PositionR\vendPosition\"`\n" +
"\x04Type\x12\x14\n" +
- "\x10TYPE_UNSPECIFIED\x10\x00\x12\x1d\n" +
- "\x19DATABASE_STATEMENT_ADVISE\x10\x02\x12%\n" +
- "!DATABASE_STATEMENT_SUMMARY_REPORT\x10\x03\x12\x17\n" +
- "\x13DATABASE_GHOST_SYNC\x10\x05\"Q\n" +
+ "\x10TYPE_UNSPECIFIED\x10\x00\x12\x14\n" +
+ "\x10STATEMENT_ADVISE\x10\x01\x12\x1c\n" +
+ "\x18STATEMENT_SUMMARY_REPORT\x10\x02\x12\x0e\n" +
+ "\n" +
+ "GHOST_SYNC\x10\x03B\b\n" +
+ "\x06report\"Q\n" +
"\x06Status\x12\x16\n" +
"\x12STATUS_UNSPECIFIED\x10\x00\x12\v\n" +
"\aRUNNING\x10\x01\x12\b\n" +
@@ -1928,8 +1916,8 @@ func file_v1_plan_service_proto_rawDescGZIP() []byte {
var file_v1_plan_service_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
var file_v1_plan_service_proto_msgTypes = make([]protoimpl.MessageInfo, 24)
var file_v1_plan_service_proto_goTypes = []any{
- (PlanCheckRun_Type)(0), // 0: bytebase.v1.PlanCheckRun.Type
- (PlanCheckRun_Status)(0), // 1: bytebase.v1.PlanCheckRun.Status
+ (PlanCheckRun_Status)(0), // 0: bytebase.v1.PlanCheckRun.Status
+ (PlanCheckRun_Result_Type)(0), // 1: bytebase.v1.PlanCheckRun.Result.Type
(*GetPlanRequest)(nil), // 2: bytebase.v1.GetPlanRequest
(*ListPlansRequest)(nil), // 3: bytebase.v1.ListPlansRequest
(*ListPlansResponse)(nil), // 4: bytebase.v1.ListPlansResponse
@@ -1974,17 +1962,17 @@ var file_v1_plan_service_proto_depIdxs = []int32{
28, // 8: bytebase.v1.Plan.update_time:type_name -> google.protobuf.Timestamp
18, // 9: bytebase.v1.Plan.plan_check_run_status_count:type_name -> bytebase.v1.Plan.PlanCheckRunStatusCountEntry
16, // 10: bytebase.v1.ListPlanCheckRunsResponse.plan_check_runs:type_name -> bytebase.v1.PlanCheckRun
- 0, // 11: bytebase.v1.PlanCheckRun.type:type_name -> bytebase.v1.PlanCheckRun.Type
- 1, // 12: bytebase.v1.PlanCheckRun.status:type_name -> bytebase.v1.PlanCheckRun.Status
- 23, // 13: bytebase.v1.PlanCheckRun.results:type_name -> bytebase.v1.PlanCheckRun.Result
- 28, // 14: bytebase.v1.PlanCheckRun.create_time:type_name -> google.protobuf.Timestamp
- 19, // 15: bytebase.v1.Plan.Spec.create_database_config:type_name -> bytebase.v1.Plan.CreateDatabaseConfig
- 20, // 16: bytebase.v1.Plan.Spec.change_database_config:type_name -> bytebase.v1.Plan.ChangeDatabaseConfig
- 21, // 17: bytebase.v1.Plan.Spec.export_data_config:type_name -> bytebase.v1.Plan.ExportDataConfig
- 29, // 18: bytebase.v1.Plan.ChangeDatabaseConfig.type:type_name -> bytebase.v1.DatabaseChangeType
- 22, // 19: bytebase.v1.Plan.ChangeDatabaseConfig.ghost_flags:type_name -> bytebase.v1.Plan.ChangeDatabaseConfig.GhostFlagsEntry
- 30, // 20: bytebase.v1.Plan.ExportDataConfig.format:type_name -> bytebase.v1.ExportFormat
- 31, // 21: bytebase.v1.PlanCheckRun.Result.status:type_name -> bytebase.v1.Advice.Level
+ 0, // 11: bytebase.v1.PlanCheckRun.status:type_name -> bytebase.v1.PlanCheckRun.Status
+ 23, // 12: bytebase.v1.PlanCheckRun.results:type_name -> bytebase.v1.PlanCheckRun.Result
+ 28, // 13: bytebase.v1.PlanCheckRun.create_time:type_name -> google.protobuf.Timestamp
+ 19, // 14: bytebase.v1.Plan.Spec.create_database_config:type_name -> bytebase.v1.Plan.CreateDatabaseConfig
+ 20, // 15: bytebase.v1.Plan.Spec.change_database_config:type_name -> bytebase.v1.Plan.ChangeDatabaseConfig
+ 21, // 16: bytebase.v1.Plan.Spec.export_data_config:type_name -> bytebase.v1.Plan.ExportDataConfig
+ 29, // 17: bytebase.v1.Plan.ChangeDatabaseConfig.type:type_name -> bytebase.v1.DatabaseChangeType
+ 22, // 18: bytebase.v1.Plan.ChangeDatabaseConfig.ghost_flags:type_name -> bytebase.v1.Plan.ChangeDatabaseConfig.GhostFlagsEntry
+ 30, // 19: bytebase.v1.Plan.ExportDataConfig.format:type_name -> bytebase.v1.ExportFormat
+ 31, // 20: bytebase.v1.PlanCheckRun.Result.status:type_name -> bytebase.v1.Advice.Level
+ 1, // 21: bytebase.v1.PlanCheckRun.Result.type:type_name -> bytebase.v1.PlanCheckRun.Result.Type
24, // 22: bytebase.v1.PlanCheckRun.Result.sql_summary_report:type_name -> bytebase.v1.PlanCheckRun.Result.SqlSummaryReport
25, // 23: bytebase.v1.PlanCheckRun.Result.sql_review_report:type_name -> bytebase.v1.PlanCheckRun.Result.SqlReviewReport
32, // 24: bytebase.v1.PlanCheckRun.Result.SqlReviewReport.start_position:type_name -> bytebase.v1.Position
diff --git a/backend/generated-go/v1/plan_service_equal.pb.go b/backend/generated-go/v1/plan_service_equal.pb.go
index 713ba8b00a..e2f6daf005 100644
--- a/backend/generated-go/v1/plan_service_equal.pb.go
+++ b/backend/generated-go/v1/plan_service_equal.pb.go
@@ -478,6 +478,12 @@ func (x *PlanCheckRun_Result) Equal(y *PlanCheckRun_Result) bool {
if x.Code != y.Code {
return false
}
+ if x.Target != y.Target {
+ return false
+ }
+ if x.Type != y.Type {
+ return false
+ }
if !x.GetSqlSummaryReport().Equal(y.GetSqlSummaryReport()) {
return false
}
@@ -497,18 +503,9 @@ func (x *PlanCheckRun) Equal(y *PlanCheckRun) bool {
if x.Name != y.Name {
return false
}
- if x.Type != y.Type {
- return false
- }
if x.Status != y.Status {
return false
}
- if x.Target != y.Target {
- return false
- }
- if x.Sheet != y.Sheet {
- return false
- }
if len(x.Results) != len(y.Results) {
return false
}
diff --git a/backend/tests/sql.go b/backend/tests/sql.go
index e0c6f3acf9..51563b5aa4 100644
--- a/backend/tests/sql.go
+++ b/backend/tests/sql.go
@@ -40,7 +40,15 @@ func (ctl *controller) GetSQLReviewResult(ctx context.Context, plan *v1pb.Plan)
return nil, err
}
for _, check := range resp.Msg.PlanCheckRuns {
- if check.Type == v1pb.PlanCheckRun_DATABASE_STATEMENT_ADVISE {
+ // With consolidated model, check if any result has STATEMENT_ADVISE type
+ hasStatementAdvise := false
+ for _, result := range check.Results {
+ if result.Type == v1pb.PlanCheckRun_Result_STATEMENT_ADVISE {
+ hasStatementAdvise = true
+ break
+ }
+ }
+ if hasStatementAdvise {
if check.Status == v1pb.PlanCheckRun_DONE || check.Status == v1pb.PlanCheckRun_FAILED {
return check, nil
}
diff --git a/backend/tests/sql_review_test.go b/backend/tests/sql_review_test.go
index 8719d957a6..a90d4dbe5a 100644
--- a/backend/tests/sql_review_test.go
+++ b/backend/tests/sql_review_test.go
@@ -148,7 +148,7 @@ func TestSQLReviewForPostgreSQL(t *testing.T) {
if record {
tests[i].Result = result
} else {
- equalReviewResultProtos(a, t.Result, result, t.Statement)
+ equalReviewResultProtos(a, t.Result, result, database.Msg.Name, t.Statement)
}
}
@@ -168,7 +168,7 @@ func TestSQLReviewForPostgreSQL(t *testing.T) {
a.NoError(err)
result := createIssueAndReturnSQLReviewResult(ctx, a, ctl, ctl.project, database.Msg, statements[0], false)
- equalReviewResultProtos(a, noSQLReviewPolicy, result, "")
+ equalReviewResultProtos(a, noSQLReviewPolicy, result, database.Msg.Name, "")
// delete the SQL review policy
_, err = ctl.orgPolicyServiceClient.DeletePolicy(ctx, connect.NewRequest(&v1pb.DeletePolicyRequest{
@@ -177,7 +177,7 @@ func TestSQLReviewForPostgreSQL(t *testing.T) {
a.NoError(err)
result = createIssueAndReturnSQLReviewResult(ctx, a, ctl, ctl.project, database.Msg, statements[0], false)
- equalReviewResultProtos(a, noSQLReviewPolicy, result, "")
+ equalReviewResultProtos(a, noSQLReviewPolicy, result, database.Msg.Name, "")
}
func TestSQLReviewForMySQL(t *testing.T) {
@@ -315,7 +315,7 @@ func TestSQLReviewForMySQL(t *testing.T) {
if record {
tests[i].Result = result
} else {
- equalReviewResultProtos(a, t.Result, result, tests[i].Statement)
+ equalReviewResultProtos(a, t.Result, result, database.Msg.Name, tests[i].Statement)
}
}
@@ -383,7 +383,7 @@ func TestSQLReviewForMySQL(t *testing.T) {
a.NoError(err)
result := createIssueAndReturnSQLReviewResult(ctx, a, ctl, ctl.project, database.Msg, statements[0], false)
- equalReviewResultProtos(a, noSQLReviewPolicy, result, "")
+ equalReviewResultProtos(a, noSQLReviewPolicy, result, database.Msg.Name, "")
}
func readTestData(path string) ([]test, error) {
@@ -486,10 +486,18 @@ func createIssueAndReturnSQLReviewResult(ctx context.Context, a *require.Asserti
result, err := ctl.GetSQLReviewResult(ctx, plan.Msg)
a.NoError(err)
+ // With consolidated model, filter to only STATEMENT_ADVISE results
+ var statementAdviseResults []*v1pb.PlanCheckRun_Result
+ for _, r := range result.Results {
+ if r.Type == v1pb.PlanCheckRun_Result_STATEMENT_ADVISE {
+ statementAdviseResults = append(statementAdviseResults, r)
+ }
+ }
+
if wait {
a.NotNil(result)
- a.Len(result.Results, 1)
- a.Equal(v1pb.Advice_SUCCESS, result.Results[0].Status)
+ a.Len(statementAdviseResults, 1)
+ a.Equal(v1pb.Advice_SUCCESS, statementAdviseResults[0].Status)
issue, err := ctl.issueServiceClient.CreateIssue(ctx, connect.NewRequest(&v1pb.CreateIssueRequest{
Parent: project.Name,
Issue: &v1pb.Issue{
@@ -508,13 +516,19 @@ func createIssueAndReturnSQLReviewResult(ctx context.Context, a *require.Asserti
time.Sleep(5 * time.Second)
}
- return result.Results
+ return statementAdviseResults
}
-func equalReviewResultProtos(a *require.Assertions, want, got []*v1pb.PlanCheckRun_Result, message string) {
+func equalReviewResultProtos(a *require.Assertions, want, got []*v1pb.PlanCheckRun_Result, expectedTarget, message string) {
a.Equal(len(want), len(got), message)
for i := 0; i < len(want); i++ {
- diff := cmp.Diff(want[i], got[i], protocmp.Transform())
+ // Verify target matches expected database
+ a.Equal(expectedTarget, got[i].Target, message)
+ // Verify type is STATEMENT_ADVISE (we filter for this type)
+ a.Equal(v1pb.PlanCheckRun_Result_STATEMENT_ADVISE, got[i].Type, message)
+ // Compare other fields, ignoring target and type since we checked them above
+ diff := cmp.Diff(want[i], got[i], protocmp.Transform(),
+ protocmp.IgnoreFields(&v1pb.PlanCheckRun_Result{}, "target", "type"))
a.Empty(diff, message)
}
}
diff --git a/docs/plans/2025-12-24-v1-api-consolidated-plan-check-runs.md b/docs/plans/2025-12-24-v1-api-consolidated-plan-check-runs.md
new file mode 100644
index 0000000000..87f357c8a9
--- /dev/null
+++ b/docs/plans/2025-12-24-v1-api-consolidated-plan-check-runs.md
@@ -0,0 +1,391 @@
+# V1 API Migration: Consolidated Plan Check Runs
+
+> **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.
+
+**Goal:** Simplify v1 API to match consolidated store model - one `PlanCheckRun` per plan with results tagged by target + type.
+
+**Breaking Change:** Yes - removes `type`, `target`, `sheet` fields from `PlanCheckRun`, adds them to `Result`.
+
+---
+
+## Task 1: Update Proto - PlanCheckRun Message
+
+**Files:**
+- Modify: `proto/v1/v1/plan_service.proto`
+
+**Step 1: Remove fields from PlanCheckRun**
+
+Remove these fields from `PlanCheckRun` message (around line 412):
+- `Type` enum (lines 416-425)
+- `type` field (line 426)
+- `target` field (line 438)
+- `sheet` field (line 441)
+
+**Step 2: Add Type enum to Result message**
+
+Inside `PlanCheckRun.Result` message, add:
+
+```protobuf
+message Result {
+ Advice.Level status = 1;
+ string title = 2;
+ string content = 3;
+ int32 code = 4;
+
+ // Target identification for consolidated results
+ // Format: instances/{instance}/databases/{database}
+ string target = 7;
+ Type type = 8;
+
+ enum Type {
+ TYPE_UNSPECIFIED = 0;
+ STATEMENT_ADVISE = 1;
+ STATEMENT_SUMMARY_REPORT = 2;
+ GHOST_SYNC = 3;
+ }
+
+ oneof report {
+ SqlSummaryReport sql_summary_report = 5;
+ SqlReviewReport sql_review_report = 6;
+ }
+ // ... rest unchanged
+}
+```
+
+**Step 3: Generate proto**
+
+```bash
+buf format -w proto && buf lint proto && cd proto && buf generate
+```
+
+**Step 4: Commit**
+
+```bash
+but commit <branch> -m "proto(v1): consolidate PlanCheckRun - move type/target to Result"
+```
+
+---
+
+## Task 2: Update Go API Converters
+
+**Files:**
+- Modify: `backend/api/v1/plan_service.go`
+
+**Step 1: Simplify convertToPlanCheckRuns**
+
+Replace the function (around line 1058):
+
+```go
+func convertToPlanCheckRuns(projectID string, planUID int64, runs []*store.PlanCheckRunMessage) []*v1pb.PlanCheckRun {
+ var planCheckRuns []*v1pb.PlanCheckRun
+ for _, run := range runs {
+ planCheckRuns = append(planCheckRuns, &v1pb.PlanCheckRun{
+ Name: common.FormatPlanCheckRun(projectID, planUID, int64(run.UID)),
+ Status: convertToPlanCheckRunStatus(run.Status),
+ Results: convertToPlanCheckRunResults(run.Result.GetResults()),
+ Error: run.Result.Error,
+ CreateTime: timestamppb.New(run.CreatedAt),
+ })
+ }
+ return planCheckRuns
+}
+```
+
+**Step 2: Update convertToPlanCheckRunResult**
+
+Add target and type fields (around line 1334):
+
+```go
+func convertToPlanCheckRunResult(result *storepb.PlanCheckRunResult_Result) *v1pb.PlanCheckRun_Result {
+ resultV1 := &v1pb.PlanCheckRun_Result{
+ Status: convertToPlanCheckRunResultStatus(result.Status),
+ Title: result.Title,
+ Content: result.Content,
+ Code: result.Code,
+ Target: result.Target,
+ Type: convertToV1ResultType(result.Type),
+ }
+ // ... report conversion unchanged
+ return resultV1
+}
+
+func convertToV1ResultType(t storepb.PlanCheckType) v1pb.PlanCheckRun_Result_Type {
+ switch t {
+ case storepb.PlanCheckType_PLAN_CHECK_TYPE_STATEMENT_ADVISE:
+ return v1pb.PlanCheckRun_Result_STATEMENT_ADVISE
+ case storepb.PlanCheckType_PLAN_CHECK_TYPE_STATEMENT_SUMMARY_REPORT:
+ return v1pb.PlanCheckRun_Result_STATEMENT_SUMMARY_REPORT
+ case storepb.PlanCheckType_PLAN_CHECK_TYPE_GHOST_SYNC:
+ return v1pb.PlanCheckRun_Result_GHOST_SYNC
+ default:
+ return v1pb.PlanCheckRun_Result_TYPE_UNSPECIFIED
+ }
+}
+```
+
+**Step 3: Delete obsolete functions**
+
+Remove:
+- `expandPlanCheckRun` function
+- `convertPlanCheckType` function
+
+**Step 4: Run linter**
+
+```bash
+golangci-lint run --allow-parallel-runners backend/api/v1/plan_service.go
+```
+
+**Step 5: Commit**
+
+```bash
+but commit <branch> -m "api: update converters for consolidated PlanCheckRun"
+```
+
+---
+
+## Task 3: Update Frontend Types
+
+**Files:**
+- Verify: `frontend/src/types/proto-es/v1/plan_service_pb.ts` (auto-generated)
+
+After proto generation, verify the TypeScript types are updated:
+- `PlanCheckRun` no longer has `type`, `target`, `sheet`
+- `PlanCheckRun_Result` has `type` and `target`
+- `PlanCheckRun_Result_Type` enum exists
+
+---
+
+## Task 4: Update Frontend - common.ts
+
+**Files:**
+- Modify: `frontend/src/components/PlanCheckRun/common.ts`
+
+**Step 1: Update HiddenPlanCheckTypes**
+
+```typescript
+import {
+ type PlanCheckRun,
+ PlanCheckRun_Status,
+ PlanCheckRun_Result_Type,
+} from "@/types/proto-es/v1/plan_service_pb";
+
+export const HiddenPlanCheckTypes = new Set<PlanCheckRun_Result_Type>([
+ PlanCheckRun_Result_Type.STATEMENT_SUMMARY_REPORT,
+]);
+```
+
+**Step 2: Rewrite planCheckRunSummaryForCheckRunList**
+
+```typescript
+export const planCheckRunSummaryForCheckRunList = (
+ planCheckRuns: PlanCheckRun[]
+) => {
+ const summary: PlanCheckRunSummary = {
+ runningCount: 0,
+ successCount: 0,
+ warnCount: 0,
+ errorCount: 0,
+ };
+
+ for (const checkRun of planCheckRuns) {
+ // If still running, count as running
+ if (checkRun.status === PlanCheckRun_Status.RUNNING) {
+ summary.runningCount++;
+ continue;
+ }
+ if (checkRun.status === PlanCheckRun_Status.FAILED) {
+ summary.errorCount++;
+ continue;
+ }
+ if (checkRun.status === PlanCheckRun_Status.CANCELED) {
+ continue;
+ }
+
+ // For DONE status, analyze results by type
+ // Group results by type-target to count unique checks
+ const resultsByTypeTarget = new Map<string, Advice_Level>();
+ for (const result of checkRun.results) {
+ if (HiddenPlanCheckTypes.has(result.type)) {
+ continue;
+ }
+ const key = `${result.type}-${result.target}`;
+ const existing = resultsByTypeTarget.get(key);
+ // Keep worst status
+ if (!existing || result.status > existing) {
+ resultsByTypeTarget.set(key, result.status);
+ }
+ }
+
+ for (const status of resultsByTypeTarget.values()) {
+ switch (status) {
+ case Advice_Level.SUCCESS:
+ summary.successCount++;
+ break;
+ case Advice_Level.WARNING:
+ summary.warnCount++;
+ break;
+ case Advice_Level.ERROR:
+ summary.errorCount++;
+ break;
+ }
+ }
+ }
+
+ return summary;
+};
+```
+
+---
+
+## Task 5: Update Frontend - Plan plan-check.ts
+
+**Files:**
+- Modify: `frontend/src/components/Plan/logic/plan-check.ts`
+
+**Step 1: Rewrite planCheckRunListForSpec**
+
+```typescript
+export const planCheckRunListForSpec = (
+ planCheckRuns: PlanCheckRun[],
+ spec: Plan_Spec
+): PlanCheckRun[] => {
+ const targets = flattenTargetsOfSpec(spec);
+
+ // With consolidated model, filter runs that have results matching our targets
+ return planCheckRuns.filter((run) => {
+ return run.results.some((result) => targets.includes(result.target));
+ });
+};
+```
+
+---
+
+## Task 6: Update Frontend - IssueV1 plan-check.ts
+
+**Files:**
+- Modify: `frontend/src/components/IssueV1/logic/plan-check.ts`
+
+**Step 1: Rewrite planCheckRunListForTask**
+
+```typescript
+export const planCheckRunListForTask = (issue: ComposedIssue, task: Task) => {
+ const target = databaseForTask(projectOfIssue(issue), task).name;
+
+ // With consolidated model, return runs that have results for this target
+ return issue.planCheckRunList.filter((run) => {
+ return run.results.some((result) => result.target === target);
+ });
+};
+```
+
+**Step 2: Update planCheckRunSummaryForIssue**
+
+```typescript
+export const planCheckRunSummaryForIssue = (issue: ComposedIssue) => {
+ // With consolidated model, just use all plan check runs
+ return planCheckRunSummaryForCheckRunList(issue.planCheckRunList);
+};
+```
+
+---
+
+## Task 7: Update Frontend - PlanCheckRunBadgeBar.vue
+
+**Files:**
+- Modify: `frontend/src/components/PlanCheckRun/PlanCheckRunBadgeBar.vue`
+
+**Step 1: Group by result type instead of checkRun type**
+
+```typescript
+const groupedByType = computed(() => {
+ const typeMap = new Map<PlanCheckRun_Result_Type, {
+ type: PlanCheckRun_Result_Type;
+ results: PlanCheckRun_Result[];
+ status: PlanCheckRun_Status;
+ }>();
+
+ for (const run of props.planCheckRunList) {
+ for (const result of run.results) {
+ if (!typeMap.has(result.type)) {
+ typeMap.set(result.type, {
+ type: result.type,
+ results: [],
+ status: run.status,
+ });
+ }
+ typeMap.get(result.type)!.results.push(result);
+ }
+ }
+
+ return orderBy(
+ Array.from(typeMap.values()),
+ [(g) => PlanCheckTypeOrderDict.get(g.type) ?? 99999],
+ ["asc"]
+ );
+});
+```
+
+---
+
+## Task 8: Update Frontend - PlanCheckRunPanel.vue
+
+**Files:**
+- Modify: `frontend/src/components/PlanCheckRun/PlanCheckRunPanel.vue`
+
+Update to select by result type and filter results accordingly.
+
+---
+
+## Task 9: Update Frontend - Other Components
+
+**Files to check and update:**
+- `frontend/src/components/PlanCheckRun/PlanCheckRunDetail.vue`
+- `frontend/src/components/Plan/components/PlanCheckRunStatusIcon.vue`
+- `frontend/src/components/IssueV1/components/StatementSection/useSQLAdviceMarkers.ts`
+- `frontend/src/components/Plan/components/StatementSection/useSQLAdviceMarkers.ts`
+- Any other files using `PlanCheckRun.type`, `.target`, or `.sheet`
+
+---
+
+## Task 10: Build and Test
+
+**Step 1: Build backend**
+
+```bash
+go build -ldflags "-w -s" -p=16 -o ./bytebase-build/bytebase ./backend/bin/server/main.go
+```
+
+**Step 2: Run backend linter**
+
+```bash
+golangci-lint run --allow-parallel-runners
+```
+
+**Step 3: Build frontend**
+
+```bash
+pnpm --dir frontend type-check
+```
+
+**Step 4: Run frontend linter**
+
+```bash
+pnpm --dir frontend biome:check
+```
+
+---
+
+## Summary
+
+| Task | Description | Files |
+|------|-------------|-------|
+| 1 | Proto changes | `proto/v1/v1/plan_service.proto` |
+| 2 | Go API converters | `backend/api/v1/plan_service.go` |
+| 3 | Verify TS types | `frontend/src/types/proto-es/v1/plan_service_pb.ts` |
+| 4 | Frontend common.ts | `frontend/src/components/PlanCheckRun/common.ts` |
+| 5 | Plan plan-check.ts | `frontend/src/components/Plan/logic/plan-check.ts` |
+| 6 | IssueV1 plan-check.ts | `frontend/src/components/IssueV1/logic/plan-check.ts` |
+| 7 | PlanCheckRunBadgeBar | `frontend/src/components/PlanCheckRun/PlanCheckRunBadgeBar.vue` |
+| 8 | PlanCheckRunPanel | `frontend/src/components/PlanCheckRun/PlanCheckRunPanel.vue` |
+| 9 | Other components | Various |
+| 10 | Build & test | All |
diff --git a/frontend/src/components/IssueV1/components/Sidebar/TaskCheckSummarySection/TaskCheckSummarySection.vue b/frontend/src/components/IssueV1/components/Sidebar/TaskCheckSummarySection/TaskCheckSummarySection.vue
index b3fe2de3b6..1e12a820ef 100644
--- a/frontend/src/components/IssueV1/components/Sidebar/TaskCheckSummarySection/TaskCheckSummarySection.vue
+++ b/frontend/src/components/IssueV1/components/Sidebar/TaskCheckSummarySection/TaskCheckSummarySection.vue
@@ -19,17 +19,16 @@
</template>
<script setup lang="ts">
+import { create } from "@bufbuild/protobuf";
import { computed, ref } from "vue";
import { useIssueContext } from "@/components/IssueV1";
import {
type PlanCheckRun,
- PlanCheckRun_Type,
+ type PlanCheckRun_Result,
+ PlanCheckRun_Result_Type,
+ PlanCheckRunSchema,
} from "@/types/proto-es/v1/plan_service_pb";
-import {
- flattenTaskV1List,
- isDatabaseChangeRelatedIssue,
- sheetNameOfTaskV1,
-} from "@/utils";
+import { flattenTaskV1List, isDatabaseChangeRelatedIssue } from "@/utils";
import AffectedRowsView from "./AffectedRowsView.vue";
import FailedTasksView from "./FailedTasksView.vue";
@@ -54,23 +53,36 @@ const shouldShow = computed(() => {
const tasks = computed(() => flattenTaskV1List(issue.value.rolloutEntity));
+// With consolidated model, create synthetic PlanCheckRuns per task
+// containing only the summary report results for that task's target
const taskSummaryReportMap = computed(() => {
const { planCheckRunList } = issue.value;
- const summaryReports = planCheckRunList.filter(
- (report) =>
- report.type === PlanCheckRun_Type.DATABASE_STATEMENT_SUMMARY_REPORT
- );
const tempMap = new Map<string, PlanCheckRun>();
+
for (const task of tasks.value) {
- const summaryReport = summaryReports.find(
- (report) =>
- report.target === task.target &&
- report.sheet === sheetNameOfTaskV1(task)
- );
- if (summaryReport) {
- tempMap.set(task.name, summaryReport);
+ // Find all summary report results that match this task's target
+ const taskResults: PlanCheckRun_Result[] = [];
+
+ for (const run of planCheckRunList) {
+ const matchingResults = run.results.filter(
+ (result) =>
+ result.type === PlanCheckRun_Result_Type.STATEMENT_SUMMARY_REPORT &&
+ result.target === task.target
+ );
+ taskResults.push(...matchingResults);
+ }
+
+ if (taskResults.length > 0) {
+ // Create a synthetic PlanCheckRun with just the results for this task
+ tempMap.set(
+ task.name,
+ create(PlanCheckRunSchema, {
+ results: taskResults,
+ })
+ );
}
}
+
return tempMap;
});
</script>
diff --git a/frontend/src/components/IssueV1/components/StatementSection/useSQLAdviceMarkers.ts b/frontend/src/components/IssueV1/components/StatementSection/useSQLAdviceMarkers.ts
index 9665c8e3e9..b939e1681f 100644
--- a/frontend/src/components/IssueV1/components/StatementSection/useSQLAdviceMarkers.ts
+++ b/frontend/src/components/IssueV1/components/StatementSection/useSQLAdviceMarkers.ts
@@ -2,7 +2,7 @@ import { maxBy } from "lodash-es";
import { computed, type Ref } from "vue";
import type { AdviceOption } from "@/components/MonacoEditor";
import type { PlanCheckRun } from "@/types/proto-es/v1/plan_service_pb";
-import { PlanCheckRun_Type } from "@/types/proto-es/v1/plan_service_pb";
+import { PlanCheckRun_Result_Type } from "@/types/proto-es/v1/plan_service_pb";
import { type Advice, Advice_Level } from "@/types/proto-es/v1/sql_service_pb";
import { extractPlanCheckRunUID } from "@/utils";
import { type IssueContext } from "../../logic";
@@ -41,27 +41,30 @@ export const useSQLAdviceMarkers = (
const { selectedTask, getPlanCheckRunsForTask } = context;
const planCheckRunList = getPlanCheckRunsForTask(selectedTask.value);
- const types: PlanCheckRun_Type[] = [
- PlanCheckRun_Type.DATABASE_STATEMENT_ADVISE,
- ];
- return types.flatMap((type) => {
- return getLatestAdviceOptions(
- planCheckRunList.filter((checkRun) => checkRun.type === type)
- );
- });
+ // With consolidated model, filter results by type instead of checkRuns
+ return getLatestAdviceOptions(
+ planCheckRunList,
+ PlanCheckRun_Result_Type.STATEMENT_ADVISE
+ );
}
});
return { markers };
};
-const getLatestAdviceOptions = (planCheckRunList: PlanCheckRun[]) => {
+const getLatestAdviceOptions = (
+ planCheckRunList: PlanCheckRun[],
+ resultType: PlanCheckRun_Result_Type
+) => {
const latest = maxBy(planCheckRunList, (checkRun) =>
parseInt(extractPlanCheckRunUID(checkRun.name), 10)
);
if (!latest) {
return [];
}
- const resultList = latest.results;
+ // Filter results by type
+ const resultList = latest.results.filter(
+ (result) => result.type === resultType
+ );
return resultList
.filter(
(result) =>
diff --git a/frontend/src/components/IssueV1/logic/plan-check.ts b/frontend/src/components/IssueV1/logic/plan-check.ts
index c688130815..ac292d45f7 100644
--- a/frontend/src/components/IssueV1/logic/plan-check.ts
+++ b/frontend/src/components/IssueV1/logic/plan-check.ts
@@ -1,4 +1,3 @@
-import { sheetNameForSpec } from "@/components/Plan";
import { planCheckRunSummaryForCheckRunList } from "@/components/PlanCheckRun/common";
import type { ComposedIssue } from "@/types";
import type { Plan_Spec } from "@/types/proto-es/v1/plan_service_pb";
@@ -6,7 +5,7 @@ import type { Task } from "@/types/proto-es/v1/rollout_service_pb";
import { Task_Status } from "@/types/proto-es/v1/rollout_service_pb";
import { Advice_Level } from "@/types/proto-es/v1/sql_service_pb";
import { databaseForTask } from "@/utils";
-import { projectOfIssue, specForTask, useIssueContext } from ".";
+import { projectOfIssue, useIssueContext } from ".";
export const planSpecHasPlanChecks = (spec: Plan_Spec) => {
if (spec.config?.case === "createDatabaseConfig") {
@@ -23,10 +22,10 @@ export const planSpecHasPlanChecks = (spec: Plan_Spec) => {
export const planCheckRunListForTask = (issue: ComposedIssue, task: Task) => {
const target = databaseForTask(projectOfIssue(issue), task).name;
- const spec = specForTask(issue.planEntity, task);
- const sheet = spec ? sheetNameForSpec(spec) : "";
- return issue.planCheckRunList.filter((check) => {
- return check.sheet === sheet && check.target === target;
+
+ // With consolidated model, return runs that have results for this target
+ return issue.planCheckRunList.filter((run) => {
+ return run.results.some((result) => result.target === target);
});
};
@@ -46,18 +45,6 @@ export const planCheckStatusForTask = (task: Task) => {
};
export const planCheckRunSummaryForIssue = (issue: ComposedIssue) => {
- const sheets = issue.planEntity?.specs.reduce((acc, spec) => {
- if (
- spec.config?.case === "changeDatabaseConfig" &&
- spec.config.value.sheet
- ) {
- acc.add(spec.config.value.sheet);
- }
- return acc;
- }, new Set<string>());
- const planCheckRunList = issue.planCheckRunList.filter((check) => {
- return sheets?.has(check.sheet);
- });
-
- return planCheckRunSummaryForCheckRunList(planCheckRunList);
+ // With consolidated model, just use all plan check runs
+ return planCheckRunSummaryForCheckRunList(issue.planCheckRunList);
};
diff --git a/frontend/src/components/Plan/components/ChecksView/ChecksView.vue b/frontend/src/components/Plan/components/ChecksView/ChecksView.vue
index b47ab08646..42d32de0da 100644
--- a/frontend/src/components/Plan/components/ChecksView/ChecksView.vue
+++ b/frontend/src/components/Plan/components/ChecksView/ChecksView.vue
@@ -48,7 +48,7 @@
</div>
<!-- Empty state -->
<div
- v-else-if="filteredCheckRuns.length === 0"
+ v-else-if="filteredResultGroups.length === 0"
class="flex flex-col items-center justify-center py-12"
>
<CheckCircleIcon class="w-12 h-12 text-control-light opacity-50 mb-4" />
@@ -62,46 +62,46 @@
</div>
<div v-else>
<div class="divide-y">
- <!-- Group by check run -->
+ <!-- Group by result type/target -->
<div
- v-for="checkRun in filteredCheckRuns"
- :key="checkRun.name"
+ v-for="group in displayedResultGroups"
+ :key="group.key"
class="px-2 py-4"
>
<!-- Check Run Header -->
<div class="flex flex-wrap items-start justify-between gap-2 mb-2">
<div class="flex items-center gap-3 shrink-0">
<component
- :is="getCheckTypeIcon(checkRun.type)"
+ :is="getCheckTypeIcon(group.type)"
class="w-5 h-5 text-control-light"
/>
<div class="flex flex-row items-center gap-2">
<span class="text-sm font-medium">
- {{ getCheckTypeLabel(checkRun.type) }}
+ {{ getCheckTypeLabel(group.type) }}
</span>
- <NTooltip v-if="getCheckTypeDescription(checkRun.type)">
+ <NTooltip v-if="getCheckTypeDescription(group.type)">
<template #trigger>
<CircleQuestionMarkIcon
class="w-4 h-4 text-control-light"
/>
</template>
- {{ getCheckTypeDescription(checkRun.type) }}
+ {{ getCheckTypeDescription(group.type) }}
</NTooltip>
- <span class="text-sm text-control-light">
- {{ formatTime(checkRun.createTime) }}
+ <span v-if="group.createTime" class="text-sm text-control-light">
+ {{ formatTime(group.createTime) }}
</span>
</div>
</div>
<div class="flex items-center gap-2 min-w-0 max-w-[50%]">
- <DatabaseDisplay :database="checkRun.target" />
+ <DatabaseDisplay :database="group.target" />
</div>
</div>
- <!-- Results for this check run -->
+ <!-- Results for this group -->
<div class="flex flex-col gap-y-2 pl-8">
<CheckResultItem
- v-for="(result, idx) in filteredResultsMap.get(checkRun.name)"
+ v-for="(result, idx) in group.results"
:key="idx"
:status="getCheckResultStatus(result.status)"
:title="result.title"
@@ -156,15 +156,23 @@ import { BBSpin } from "@/bbkit";
import {
type PlanCheckRun,
type PlanCheckRun_Result,
+ PlanCheckRun_Result_Type,
PlanCheckRun_ResultSchema,
PlanCheckRun_Status,
- PlanCheckRun_Type,
} from "@/types/proto-es/v1/plan_service_pb";
import { Advice_Level } from "@/types/proto-es/v1/sql_service_pb";
import { humanizeTs } from "@/utils";
import CheckResultItem from "../common/CheckResultItem.vue";
import DatabaseDisplay from "../common/DatabaseDisplay.vue";
+interface ResultGroup {
+ key: string;
+ type: PlanCheckRun_Result_Type;
+ target: string;
+ createTime?: Timestamp;
+ results: PlanCheckRun_Result[];
+}
+
const props = defineProps<{
defaultStatus?: Advice_Level;
planCheckRuns: PlanCheckRun[];
@@ -235,103 +243,112 @@ const getItemClass = (status: Advice_Level) => {
: "px-2 py-1";
};
-const allFilteredCheckRuns = computed(() => {
- return props.planCheckRuns.filter((checkRun) => {
- // Filter by status - check if any result matches the selected status
- if (selectedStatus.value !== undefined) {
- // If filtering for errors, include failed check runs
+// Group results by type and target
+const filteredResultGroups = computed(() => {
+ const groups: ResultGroup[] = [];
+ const groupMap = new Map<string, ResultGroup>();
+
+ for (const checkRun of props.planCheckRuns) {
+ // Handle failed check runs
+ if (checkRun.status === PlanCheckRun_Status.FAILED) {
if (
- selectedStatus.value === Advice_Level.ERROR &&
- checkRun.status === PlanCheckRun_Status.FAILED
+ selectedStatus.value === undefined ||
+ selectedStatus.value === Advice_Level.ERROR
) {
- return true;
+ // Create a synthetic error result for the failed run
+ const syntheticResult = create(PlanCheckRun_ResultSchema, {
+ status: Advice_Level.ERROR,
+ title: "Check Failed",
+ content: checkRun.error || "Plan check run failed",
+ code: 0,
+ });
+ const key = `failed-${checkRun.name}`;
+ groups.push({
+ key,
+ type: PlanCheckRun_Result_Type.TYPE_UNSPECIFIED,
+ target: "",
+ createTime: checkRun.createTime,
+ results: [syntheticResult],
+ });
}
+ }
- const hasMatchingResult = checkRun.results.some(
- (result) => result.status === selectedStatus.value
- );
- if (!hasMatchingResult) {
- return false;
+ // Process results
+ for (const result of checkRun.results) {
+ // Filter by status
+ if (
+ selectedStatus.value !== undefined &&
+ result.status !== selectedStatus.value
+ ) {
+ continue;
}
+
+ const key = `${result.type}-${result.target}`;
+ let group = groupMap.get(key);
+ if (!group) {
+ group = {
+ key,
+ type: result.type,
+ target: result.target,
+ createTime: checkRun.createTime,
+ results: [],
+ };
+ groupMap.set(key, group);
+ groups.push(group);
+ }
+ group.results.push(result);
}
- return true;
- });
+ }
+
+ return groups;
});
-// Paginated check runs
-const filteredCheckRuns = computed(() => {
- return allFilteredCheckRuns.value.slice(0, displayCount.value);
+// Paginated groups
+const displayedResultGroups = computed(() => {
+ return filteredResultGroups.value.slice(0, displayCount.value);
});
const hasMore = computed(() => {
- return allFilteredCheckRuns.value.length > displayCount.value;
+ return filteredResultGroups.value.length > displayCount.value;
});
const remainingCount = computed(() => {
- return allFilteredCheckRuns.value.length - displayCount.value;
-});
-
-// Memoized filtered results for each check run
-const filteredResultsMap = computed(() => {
- const map = new Map<string, PlanCheckRun_Result[]>();
- for (const checkRun of filteredCheckRuns.value) {
- let results = checkRun.results.filter((result) => {
- return (
- selectedStatus.value === undefined ||
- result.status === selectedStatus.value
- );
- });
-
- // For failed check runs, add a synthetic error result if filtering for errors or no filter
- if (
- checkRun.status === PlanCheckRun_Status.FAILED &&
- (selectedStatus.value === undefined ||
- selectedStatus.value === Advice_Level.ERROR)
- ) {
- const syntheticResult = create(PlanCheckRun_ResultSchema, {
- status: Advice_Level.ERROR,
- title: "Check Failed",
- content: checkRun.error || "Plan check run failed",
- code: 0,
- });
- results = [syntheticResult, ...results];
- }
-
- map.set(checkRun.name, results);
- }
- return map;
+ return filteredResultGroups.value.length - displayCount.value;
});
// Check type configuration lookup
const checkTypeConfig: Partial<
- Record<PlanCheckRun_Type, { icon: typeof FileCodeIcon; labelKey: string }>
+ Record<
+ PlanCheckRun_Result_Type,
+ { icon: typeof FileCodeIcon; labelKey: string }
+ >
> = {
- [PlanCheckRun_Type.DATABASE_STATEMENT_ADVISE]: {
+ [PlanCheckRun_Result_Type.STATEMENT_ADVISE]: {
icon: SearchCodeIcon,
labelKey: "task.check-type.sql-review.self",
},
- [PlanCheckRun_Type.DATABASE_STATEMENT_SUMMARY_REPORT]: {
+ [PlanCheckRun_Result_Type.STATEMENT_SUMMARY_REPORT]: {
icon: FileCodeIcon,
labelKey: "task.check-type.summary-report",
},
- [PlanCheckRun_Type.DATABASE_GHOST_SYNC]: {
+ [PlanCheckRun_Result_Type.GHOST_SYNC]: {
icon: ShieldIcon,
labelKey: "task.check-type.ghost-sync",
},
};
-const getCheckTypeIcon = (type: PlanCheckRun_Type) => {
+const getCheckTypeIcon = (type: PlanCheckRun_Result_Type) => {
return checkTypeConfig[type]?.icon ?? FileCodeIcon;
};
-const getCheckTypeLabel = (type: PlanCheckRun_Type) => {
+const getCheckTypeLabel = (type: PlanCheckRun_Result_Type) => {
const key = checkTypeConfig[type]?.labelKey;
return key ? t(key) : type.toString();
};
-const getCheckTypeDescription = (type: PlanCheckRun_Type) => {
+const getCheckTypeDescription = (type: PlanCheckRun_Result_Type) => {
switch (type) {
- case PlanCheckRun_Type.DATABASE_STATEMENT_ADVISE:
+ case PlanCheckRun_Result_Type.STATEMENT_ADVISE:
return t("task.check-type.sql-review.description");
default:
return undefined;
diff --git a/frontend/src/components/Plan/components/PlanCheckStatusCount.vue b/frontend/src/components/Plan/components/PlanCheckStatusCount.vue
index 611f9fbf84..78637d7426 100644
--- a/frontend/src/components/Plan/components/PlanCheckStatusCount.vue
+++ b/frontend/src/components/Plan/components/PlanCheckStatusCount.vue
@@ -11,8 +11,7 @@
class="flex items-center gap-1 text-control"
>
<LoaderIcon :class="iconSizeClass" class="animate-spin" />
- <span v-if="showLabel">{{ $t("task.status.running") }}</span>
- <span>{{ statusSummary.running }}</span>
+ <span>{{ $t("task.status.running") }}</span>
</div>
<div
v-if="statusSummary.error > 0"
diff --git a/frontend/src/components/Plan/components/SQLCheckV1Section/SQLCheckV1Section.vue b/frontend/src/components/Plan/components/SQLCheckV1Section/SQLCheckV1Section.vue
index fb5817757f..a2b16105d0 100644
--- a/frontend/src/components/Plan/components/SQLCheckV1Section/SQLCheckV1Section.vue
+++ b/frontend/src/components/Plan/components/SQLCheckV1Section/SQLCheckV1Section.vue
@@ -106,9 +106,9 @@ import { DatabaseChangeType } from "@/types/proto-es/v1/common_pb";
import {
type PlanCheckRun,
type PlanCheckRun_Result,
+ PlanCheckRun_Result_Type,
PlanCheckRun_ResultSchema,
PlanCheckRun_Status,
- PlanCheckRun_Type,
PlanCheckRunSchema,
} from "@/types/proto-es/v1/plan_service_pb";
import {
@@ -275,13 +275,16 @@ watch(
);
// Transform CheckReleaseResponse_CheckResult[] to PlanCheckRun[] format
+// With consolidated model, we create a single PlanCheckRun with all results
const transformToFormattedCheckRuns = (
results: CheckReleaseResponse_CheckResult[]
): PlanCheckRun[] => {
- return results.map((result, index) => {
- const planCheckRunResults: PlanCheckRun_Result[] = result.advices.map(
- (advice) => {
- return create(PlanCheckRun_ResultSchema, {
+ const allResults: PlanCheckRun_Result[] = [];
+
+ for (const result of results) {
+ for (const advice of result.advices) {
+ allResults.push(
+ create(PlanCheckRun_ResultSchema, {
status:
advice.status === Advice_Level.ERROR
? Advice_Level.ERROR
@@ -291,25 +294,31 @@ const transformToFormattedCheckRuns = (
title: advice.title,
content: advice.content,
code: advice.code,
+ target: result.target,
+ type: PlanCheckRun_Result_Type.STATEMENT_ADVISE,
report: {
case: "sqlReviewReport",
value: {
startPosition: advice.startPosition,
},
},
- });
- }
- );
+ })
+ );
+ }
+ }
- return create(PlanCheckRunSchema, {
- name: `check-run-${index}`,
- type: PlanCheckRun_Type.DATABASE_STATEMENT_ADVISE,
+ if (allResults.length === 0) {
+ return [];
+ }
+
+ return [
+ create(PlanCheckRunSchema, {
+ name: "check-run-0",
status: PlanCheckRun_Status.DONE,
- target: result.target,
- results: planCheckRunResults,
+ results: allResults,
createTime: { seconds: BigInt(Math.floor(Date.now() / 1000)), nanos: 0 },
- });
- });
+ }),
+ ];
};
// Format check runs for ChecksView component
diff --git a/frontend/src/components/Plan/components/StatementSection/useSQLAdviceMarkers.ts b/frontend/src/components/Plan/components/StatementSection/useSQLAdviceMarkers.ts
index e4b32f0cea..fb989dbffd 100644
--- a/frontend/src/components/Plan/components/StatementSection/useSQLAdviceMarkers.ts
+++ b/frontend/src/components/Plan/components/StatementSection/useSQLAdviceMarkers.ts
@@ -2,7 +2,7 @@ import { maxBy } from "lodash-es";
import { computed, type Ref } from "vue";
import type { AdviceOption } from "@/components/MonacoEditor";
import type { PlanCheckRun } from "@/types/proto-es/v1/plan_service_pb";
-import { PlanCheckRun_Type } from "@/types/proto-es/v1/plan_service_pb";
+import { PlanCheckRun_Result_Type } from "@/types/proto-es/v1/plan_service_pb";
import { type Advice, Advice_Level } from "@/types/proto-es/v1/sql_service_pb";
import { extractPlanCheckRunUID } from "@/utils";
@@ -39,27 +39,30 @@ export const useSQLAdviceMarkers = (
} else {
if (!planCheckRuns) return [];
if (!planCheckRuns.value) return [];
- const types: PlanCheckRun_Type[] = [
- PlanCheckRun_Type.DATABASE_STATEMENT_ADVISE,
- ];
- return types.flatMap((type) => {
- return getLatestAdviceOptions(
- planCheckRuns.value.filter((checkRun) => checkRun.type === type)
- );
- });
+ // With consolidated model, filter results by type instead of checkRuns
+ return getLatestAdviceOptions(
+ planCheckRuns.value,
+ PlanCheckRun_Result_Type.STATEMENT_ADVISE
+ );
}
});
return { markers };
};
-const getLatestAdviceOptions = (planCheckRuns: PlanCheckRun[]) => {
+const getLatestAdviceOptions = (
+ planCheckRuns: PlanCheckRun[],
+ resultType: PlanCheckRun_Result_Type
+) => {
const latest = maxBy(planCheckRuns, (checkRun) =>
parseInt(extractPlanCheckRunUID(checkRun.name), 10)
);
if (!latest) {
return [];
}
- const resultList = latest.results;
+ // Filter results by type
+ const resultList = latest.results.filter(
+ (result) => result.type === resultType
+ );
return resultList
.filter(
(result) =>
diff --git a/frontend/src/components/Plan/logic/plan-check.ts b/frontend/src/components/Plan/logic/plan-check.ts
index 44f5614451..92f61ee63d 100644
--- a/frontend/src/components/Plan/logic/plan-check.ts
+++ b/frontend/src/components/Plan/logic/plan-check.ts
@@ -6,7 +6,6 @@ import type {
Plan_Spec,
PlanCheckRun,
} from "@/types/proto-es/v1/plan_service_pb";
-import { sheetNameForSpec } from "./plan";
export const planSpecHasPlanChecks = (spec: Plan_Spec) => {
if (spec.config?.case === "changeDatabaseConfig") {
@@ -45,15 +44,11 @@ export const flattenTargetsOfSpec = (spec: Plan_Spec): string[] => {
export const planCheckRunListForSpec = (
planCheckRunList: PlanCheckRun[],
spec: Plan_Spec
-) => {
+): PlanCheckRun[] => {
const targets = flattenTargetsOfSpec(spec);
- const sheet = sheetNameForSpec(spec);
- return planCheckRunList.filter((check) => {
- if (!targets.includes(check.target)) {
- return false;
- }
- if (sheet && check.sheet) {
- return check.sheet === sheet;
- }
+
+ // With consolidated model, filter runs that have results matching our targets
+ return planCheckRunList.filter((run) => {
+ return run.results.some((result) => targets.includes(result.target));
});
};
diff --git a/frontend/src/components/PlanCheckRun/PlanCheckRunBadge.vue b/frontend/src/components/PlanCheckRun/PlanCheckRunBadge.vue
index eb98360960..7568f0fa9f 100644
--- a/frontend/src/components/PlanCheckRun/PlanCheckRunBadge.vue
+++ b/frontend/src/components/PlanCheckRun/PlanCheckRunBadge.vue
@@ -45,8 +45,8 @@ import { useI18n } from "vue-i18n";
import { TaskSpinner } from "@/components/IssueV1/components/common";
import type { PlanCheckRun } from "@/types/proto-es/v1/plan_service_pb";
import {
+ PlanCheckRun_Result_Type,
PlanCheckRun_Status,
- PlanCheckRun_Type,
} from "@/types/proto-es/v1/plan_service_pb";
import { Advice_Level } from "@/types/proto-es/v1/sql_service_pb";
import { extractPlanCheckRunUID } from "@/utils";
@@ -54,7 +54,7 @@ import { planCheckRunResultStatus } from "./common";
const props = defineProps<{
planCheckRuns: PlanCheckRun[];
- type: PlanCheckRun_Type;
+ type: PlanCheckRun_Result_Type;
clickable?: boolean;
selected?: boolean;
}>();
@@ -108,17 +108,17 @@ const resultStatus = computed(() => {
});
const title = computed(() => {
- const { type } = latestPlanCheckRun.value;
- switch (type) {
- case PlanCheckRun_Type.DATABASE_STATEMENT_ADVISE:
+ // Use the type prop directly instead of getting from checkRun
+ switch (props.type) {
+ case PlanCheckRun_Result_Type.STATEMENT_ADVISE:
return t("task.check-type.sql-review.self");
- case PlanCheckRun_Type.DATABASE_GHOST_SYNC:
+ case PlanCheckRun_Result_Type.GHOST_SYNC:
return t("task.check-type.ghost-sync");
- case PlanCheckRun_Type.DATABASE_STATEMENT_SUMMARY_REPORT:
+ case PlanCheckRun_Result_Type.STATEMENT_SUMMARY_REPORT:
return t("task.check-type.summary-report");
default:
- console.assert(false, `Missing PlanCheckType name of "${type}"`);
- return type;
+ console.assert(false, `Missing PlanCheckType name of "${props.type}"`);
+ return String(props.type);
}
});
</script>
diff --git a/frontend/src/components/PlanCheckRun/PlanCheckRunBadgeBar.vue b/frontend/src/components/PlanCheckRun/PlanCheckRunBadgeBar.vue
index 8f598d1810..16e85af4ce 100644
--- a/frontend/src/components/PlanCheckRun/PlanCheckRunBadgeBar.vue
+++ b/frontend/src/components/PlanCheckRun/PlanCheckRunBadgeBar.vue
@@ -17,28 +17,46 @@ import { orderBy } from "lodash-es";
import { computed } from "vue";
import {
type PlanCheckRun,
- PlanCheckRun_Type,
+ PlanCheckRun_Result_Type,
} from "@/types/proto-es/v1/plan_service_pb";
-import { groupBy } from "@/utils/collections";
+import { HiddenPlanCheckTypes } from "./common";
import PlanCheckRunBadge from "./PlanCheckRunBadge.vue";
const props = defineProps<{
planCheckRunList: PlanCheckRun[];
- selectedType?: PlanCheckRun_Type;
+ selectedType?: PlanCheckRun_Result_Type;
}>();
defineEmits<{
- (event: "select-type", type: PlanCheckRun_Type): void;
+ (event: "select-type", type: PlanCheckRun_Result_Type): void;
}>();
const planCheckRunsGroupByType = computed(() => {
- const groups = groupBy(props.planCheckRunList, (checkRun) => checkRun.type);
- const list = Array.from(groups.entries()).map(([type, list]) => ({
+ // With consolidated model, group by result type across all runs
+ const typeToRuns = new Map<PlanCheckRun_Result_Type, PlanCheckRun[]>();
+
+ for (const run of props.planCheckRunList) {
+ for (const result of run.results) {
+ if (HiddenPlanCheckTypes.has(result.type)) {
+ continue;
+ }
+ if (!typeToRuns.has(result.type)) {
+ typeToRuns.set(result.type, []);
+ }
+ // Add the run if not already added for this type
+ const runs = typeToRuns.get(result.type)!;
+ if (!runs.includes(run)) {
+ runs.push(run);
+ }
+ }
+ }
+
+ const list = Array.from(typeToRuns.entries()).map(([type, list]) => ({
type,
list,
}));
+
// Sort by pre-defined orders
- // If an item's order is not defined, put it behind
return orderBy(
list,
[(group) => PlanCheckTypeOrderDict.get(group.type) ?? 99999],
@@ -46,11 +64,11 @@ const planCheckRunsGroupByType = computed(() => {
);
});
-const PlanCheckTypeOrderList: PlanCheckRun_Type[] = [
- PlanCheckRun_Type.DATABASE_GHOST_SYNC,
- PlanCheckRun_Type.DATABASE_STATEMENT_ADVISE,
+const PlanCheckTypeOrderList: PlanCheckRun_Result_Type[] = [
+ PlanCheckRun_Result_Type.GHOST_SYNC,
+ PlanCheckRun_Result_Type.STATEMENT_ADVISE,
];
-const PlanCheckTypeOrderDict = new Map<PlanCheckRun_Type, number>(
+const PlanCheckTypeOrderDict = new Map<PlanCheckRun_Result_Type, number>(
PlanCheckTypeOrderList.map((type, order) => [type, order])
);
</script>
diff --git a/frontend/src/components/PlanCheckRun/PlanCheckRunBar.vue b/frontend/src/components/PlanCheckRun/PlanCheckRunBar.vue
index 5cc7a28f57..d4db255994 100644
--- a/frontend/src/components/PlanCheckRun/PlanCheckRunBar.vue
+++ b/frontend/src/components/PlanCheckRun/PlanCheckRunBar.vue
@@ -37,11 +37,11 @@ import { create } from "@bufbuild/protobuf";
import { ref } from "vue";
import { planServiceClientConnect } from "@/grpcweb";
import type { ComposedDatabase } from "@/types";
-import type {
- PlanCheckRun,
- PlanCheckRun_Type,
+import type { PlanCheckRun } from "@/types/proto-es/v1/plan_service_pb";
+import {
+ PlanCheckRun_Result_Type,
+ RunPlanChecksRequestSchema,
} from "@/types/proto-es/v1/plan_service_pb";
-import { RunPlanChecksRequestSchema } from "@/types/proto-es/v1/plan_service_pb";
import type { VueClass } from "@/utils";
import { usePlanCheckRunContext } from "./context";
import PlanCheckRunBadgeBar from "./PlanCheckRunBadgeBar.vue";
@@ -65,7 +65,7 @@ const props = withDefaults(
const { events } = usePlanCheckRunContext();
-const selectedType = ref<PlanCheckRun_Type>();
+const selectedType = ref<PlanCheckRun_Result_Type>();
const runChecks = async () => {
const request = create(RunPlanChecksRequestSchema, {
diff --git a/frontend/src/components/PlanCheckRun/PlanCheckRunModal.vue b/frontend/src/components/PlanCheckRun/PlanCheckRunModal.vue
index f2a7bf2bed..61f06c25b9 100644
--- a/frontend/src/components/PlanCheckRun/PlanCheckRunModal.vue
+++ b/frontend/src/components/PlanCheckRun/PlanCheckRunModal.vue
@@ -18,15 +18,13 @@
<script setup lang="ts">
import { BBModal } from "@/bbkit";
import type { ComposedDatabase } from "@/types";
-import type {
- PlanCheckRun,
- PlanCheckRun_Type,
-} from "@/types/proto-es/v1/plan_service_pb";
+import type { PlanCheckRun } from "@/types/proto-es/v1/plan_service_pb";
+import { PlanCheckRun_Result_Type } from "@/types/proto-es/v1/plan_service_pb";
import PlanCheckRunPanel from "./PlanCheckRunPanel.vue";
defineProps<{
planCheckRunList: PlanCheckRun[];
- selectedType: PlanCheckRun_Type;
+ selectedType: PlanCheckRun_Result_Type;
database: ComposedDatabase;
}>();
diff --git a/frontend/src/components/PlanCheckRun/PlanCheckRunPanel.vue b/frontend/src/components/PlanCheckRun/PlanCheckRunPanel.vue
index 5a405c3881..b5bab57798 100644
--- a/frontend/src/components/PlanCheckRun/PlanCheckRunPanel.vue
+++ b/frontend/src/components/PlanCheckRun/PlanCheckRunPanel.vue
@@ -15,6 +15,7 @@
<PlanCheckRunDetail
v-if="selectedPlanCheckRun"
:plan-check-run="selectedPlanCheckRun"
+ :selected-type="selectedTypeRef"
:database="database"
:show-code-location="isLatestPlanCheckRun"
/>
@@ -30,17 +31,18 @@ import { TabFilter } from "@/components/v2";
import { type ComposedDatabase, getDateForPbTimestampProtoEs } from "@/types";
import {
type PlanCheckRun,
- PlanCheckRun_Type,
+ PlanCheckRun_Result_Type,
} from "@/types/proto-es/v1/plan_service_pb";
import { Advice_Level } from "@/types/proto-es/v1/sql_service_pb";
import { extractPlanCheckRunUID, humanizeDate } from "@/utils";
+import { HiddenPlanCheckTypes } from "./common";
import PlanCheckRunBadgeBar from "./PlanCheckRunBadgeBar.vue";
import PlanCheckRunDetail from "./PlanCheckRunDetail.vue";
const props = defineProps<{
planCheckRunList: PlanCheckRun[];
database: ComposedDatabase;
- selectedType?: PlanCheckRun_Type;
+ selectedType?: PlanCheckRun_Result_Type;
}>();
const getInitialSelectedType = () => {
@@ -48,27 +50,41 @@ const getInitialSelectedType = () => {
return props.selectedType;
}
- // Find the first plan check run with error or warning.
- const planCheck = props.planCheckRunList.find((checkRun) =>
- [Advice_Level.ERROR, Advice_Level.WARNING].some((status) =>
- checkRun.results.map((result) => result.status).includes(status)
- )
- );
- if (planCheck) {
- return planCheck.type;
+ // Find the first result type with error or warning
+ for (const run of props.planCheckRunList) {
+ for (const result of run.results) {
+ if (HiddenPlanCheckTypes.has(result.type)) {
+ continue;
+ }
+ if (
+ result.status === Advice_Level.ERROR ||
+ result.status === Advice_Level.WARNING
+ ) {
+ return result.type;
+ }
+ }
}
- return (
- first(props.planCheckRunList)?.type ?? PlanCheckRun_Type.TYPE_UNSPECIFIED
- );
+
+ // Fall back to first non-hidden result type
+ for (const run of props.planCheckRunList) {
+ for (const result of run.results) {
+ if (!HiddenPlanCheckTypes.has(result.type)) {
+ return result.type;
+ }
+ }
+ }
+
+ return PlanCheckRun_Result_Type.TYPE_UNSPECIFIED;
};
const { t } = useI18n();
-const selectedTypeRef = ref<PlanCheckRun_Type>(getInitialSelectedType());
+const selectedTypeRef = ref<PlanCheckRun_Result_Type>(getInitialSelectedType());
const selectedPlanCheckRunList = computed(() => {
+ // With consolidated model, return runs that have results of the selected type
return orderBy(
- props.planCheckRunList.filter(
- (checkRun) => checkRun.type === selectedTypeRef.value
+ props.planCheckRunList.filter((run) =>
+ run.results.some((result) => result.type === selectedTypeRef.value)
),
(checkRun) => parseInt(extractPlanCheckRunUID(checkRun.name), 10),
"desc"
@@ -113,7 +129,7 @@ const tabItemList = computed(() => {
);
});
-const handlePlanCheckRunTypeChange = (type: PlanCheckRun_Type) => {
+const handlePlanCheckRunTypeChange = (type: PlanCheckRun_Result_Type) => {
selectedTypeRef.value = type;
selectedPlanCheckRunName.value = first(selectedPlanCheckRunList.value)?.name;
};
diff --git a/frontend/src/components/PlanCheckRun/common.ts b/frontend/src/components/PlanCheckRun/common.ts
index 82fe42f4b3..a1fc2d4946 100644
--- a/frontend/src/components/PlanCheckRun/common.ts
+++ b/frontend/src/components/PlanCheckRun/common.ts
@@ -1,11 +1,9 @@
-import { maxBy } from "lodash-es";
import {
type PlanCheckRun,
+ PlanCheckRun_Result_Type,
PlanCheckRun_Status,
- PlanCheckRun_Type,
} from "@/types/proto-es/v1/plan_service_pb";
import { Advice_Level } from "@/types/proto-es/v1/sql_service_pb";
-import { extractPlanCheckRunUID } from "@/utils";
export const planCheckRunResultStatus = (checkRun: PlanCheckRun) => {
let status = Advice_Level.SUCCESS;
@@ -21,8 +19,8 @@ export const planCheckRunResultStatus = (checkRun: PlanCheckRun) => {
return status;
};
-export const HiddenPlanCheckTypes = new Set<PlanCheckRun_Type>([
- PlanCheckRun_Type.DATABASE_STATEMENT_SUMMARY_REPORT,
+export const HiddenPlanCheckTypes = new Set<PlanCheckRun_Result_Type>([
+ PlanCheckRun_Result_Type.STATEMENT_SUMMARY_REPORT,
]);
export type PlanCheckRunSummary = {
@@ -42,54 +40,46 @@ export const planCheckRunSummaryForCheckRunList = (
errorCount: 0,
};
- planCheckRuns = planCheckRuns.filter(
- (check) => !HiddenPlanCheckTypes.has(check.type)
- );
+ for (const checkRun of planCheckRuns) {
+ if (checkRun.status === PlanCheckRun_Status.RUNNING) {
+ summary.runningCount++;
+ continue;
+ }
+ if (checkRun.status === PlanCheckRun_Status.FAILED) {
+ summary.errorCount++;
+ continue;
+ }
+ if (checkRun.status === PlanCheckRun_Status.CANCELED) {
+ continue;
+ }
- const listGroupByTypeTargetSheet = planCheckRuns.reduce(
- (acc, checkRun) => {
- const key = `${checkRun.type}-${checkRun.target}-${checkRun.sheet}`;
- if (!acc[key]) {
- acc[key] = [];
+ // For DONE status, analyze results by type-target
+ // Group results by type-target to count unique checks
+ const resultsByTypeTarget = new Map<string, Advice_Level>();
+ for (const result of checkRun.results) {
+ if (HiddenPlanCheckTypes.has(result.type)) {
+ continue;
}
- acc[key].push(checkRun);
- return acc;
- },
- {} as { [key: string]: PlanCheckRun[] }
- );
-
- const latestCheckRunOfEachTypeTargetSheet = Object.keys(
- listGroupByTypeTargetSheet
- ).map((k) => {
- const listOfTypeTargetSheet = listGroupByTypeTargetSheet[k];
- const latest = maxBy(listOfTypeTargetSheet, (checkRun) =>
- Number(extractPlanCheckRunUID(checkRun.name))
- )!;
- return latest;
- });
+ const key = `${result.type}-${result.target}`;
+ const existing = resultsByTypeTarget.get(key);
+ // Keep worst status (ERROR > WARNING > SUCCESS)
+ if (!existing || result.status > existing) {
+ resultsByTypeTarget.set(key, result.status);
+ }
+ }
- for (const checkRun of latestCheckRunOfEachTypeTargetSheet) {
- switch (checkRun.status) {
- case PlanCheckRun_Status.CANCELED:
- // nothing todo
- break;
- case PlanCheckRun_Status.FAILED:
- summary.errorCount++;
- break;
- case PlanCheckRun_Status.RUNNING:
- summary.runningCount++;
- break;
- case PlanCheckRun_Status.DONE:
- switch (planCheckRunResultStatus(checkRun)) {
- case Advice_Level.SUCCESS:
- summary.successCount++;
- break;
- case Advice_Level.WARNING:
- summary.warnCount++;
- break;
- case Advice_Level.ERROR:
- summary.errorCount++;
- }
+ for (const status of resultsByTypeTarget.values()) {
+ switch (status) {
+ case Advice_Level.SUCCESS:
+ summary.successCount++;
+ break;
+ case Advice_Level.WARNING:
+ summary.warnCount++;
+ break;
+ case Advice_Level.ERROR:
+ summary.errorCount++;
+ break;
+ }
}
}
diff --git a/frontend/src/types/proto-es/v1/plan_service_pb.d.ts b/frontend/src/types/proto-es/v1/plan_service_pb.d.ts
index f14a9acd62..6bf0bbce09 100644
--- a/frontend/src/types/proto-es/v1/plan_service_pb.d.ts
+++ b/frontend/src/types/proto-es/v1/plan_service_pb.d.ts
@@ -717,30 +717,11 @@ export declare type PlanCheckRun = Message<"bytebase.v1.PlanCheckRun"> & {
*/
name: string;
- /**
- * @generated from field: bytebase.v1.PlanCheckRun.Type type = 2;
- */
- type: PlanCheckRun_Type;
-
/**
* @generated from field: bytebase.v1.PlanCheckRun.Status status = 3;
*/
status: PlanCheckRun_Status;
- /**
- * Format: instances/{instance}/databases/{database}
- *
- * @generated from field: string target = 4;
- */
- target: string;
-
- /**
- * Format: project/{project}/sheets/{sheet}
- *
- * @generated from field: string sheet = 5;
- */
- sheet: string;
-
/**
* @generated from field: repeated bytebase.v1.PlanCheckRun.Result results = 6;
*/
@@ -789,6 +770,19 @@ export declare type PlanCheckRun_Result = Message<"bytebase.v1.PlanCheckRun.Resu
*/
code: number;
+ /**
+ * Target identification for consolidated results.
+ * Format: instances/{instance}/databases/{database}
+ *
+ * @generated from field: string target = 7;
+ */
+ target: string;
+
+ /**
+ * @generated from field: bytebase.v1.PlanCheckRun.Result.Type type = 8;
+ */
+ type: PlanCheckRun_Result_Type;
+
/**
* @generated from oneof bytebase.v1.PlanCheckRun.Result.report
*/
@@ -860,42 +854,34 @@ export declare type PlanCheckRun_Result_SqlReviewReport = Message<"bytebase.v1.P
export declare const PlanCheckRun_Result_SqlReviewReportSchema: GenMessage<PlanCheckRun_Result_SqlReviewReport>;
/**
- * @generated from enum bytebase.v1.PlanCheckRun.Type
+ * @generated from enum bytebase.v1.PlanCheckRun.Result.Type
*/
-export enum PlanCheckRun_Type {
+export enum PlanCheckRun_Result_Type {
/**
- * Unspecified check type.
- *
* @generated from enum value: TYPE_UNSPECIFIED = 0;
*/
TYPE_UNSPECIFIED = 0,
/**
- * SQL review check that analyzes statements against configured SQL review rules.
- *
- * @generated from enum value: DATABASE_STATEMENT_ADVISE = 2;
+ * @generated from enum value: STATEMENT_ADVISE = 1;
*/
- DATABASE_STATEMENT_ADVISE = 2,
+ STATEMENT_ADVISE = 1,
/**
- * Summary report check that generates impact analysis for the statements.
- *
- * @generated from enum value: DATABASE_STATEMENT_SUMMARY_REPORT = 3;
+ * @generated from enum value: STATEMENT_SUMMARY_REPORT = 2;
*/
- DATABASE_STATEMENT_SUMMARY_REPORT = 3,
+ STATEMENT_SUMMARY_REPORT = 2,
/**
- * Ghost sync check that validates gh-ost online schema change compatibility.
- *
- * @generated from enum value: DATABASE_GHOST_SYNC = 5;
+ * @generated from enum value: GHOST_SYNC = 3;
*/
- DATABASE_GHOST_SYNC = 5,
+ GHOST_SYNC = 3,
}
/**
- * Describes the enum bytebase.v1.PlanCheckRun.Type.
+ * Describes the enum bytebase.v1.PlanCheckRun.Result.Type.
*/
-export declare const PlanCheckRun_TypeSchema: GenEnum<PlanCheckRun_Type>;
+export declare const PlanCheckRun_Result_TypeSchema: GenEnum<PlanCheckRun_Result_Type>;
/**
* @generated from enum bytebase.v1.PlanCheckRun.Status
diff --git a/frontend/src/types/proto-es/v1/plan_service_pb.js b/frontend/src/types/proto-es/v1/plan_service_pb.js
index b71933b863..e00793d637 100644
--- a/frontend/src/types/proto-es/v1/plan_service_pb.js
+++ b/frontend/src/types/proto-es/v1/plan_service_pb.js
@@ -17,7 +17,7 @@ import { file_v1_sql_service } from "./sql_service_pb";
* Describes the file v1/plan_service.proto.
*/
export const file_v1_plan_service = /*@__PURE__*/
- fileDesc("ChV2MS9wbGFuX3NlcnZpY2UucHJvdG8SC2J5dGViYXNlLnYxIjkKDkdldFBsYW5SZXF1ZXN0EicKBG5hbWUYASABKAlCGeBBAvpBEwoRYnl0ZWJhc2UuY29tL1BsYW4iZwoQTGlzdFBsYW5zUmVxdWVzdBIsCgZwYXJlbnQYASABKAlCHOBBAvpBFgoUYnl0ZWJhc2UuY29tL1Byb2plY3QSEQoJcGFnZV9zaXplGAIgASgFEhIKCnBhZ2VfdG9rZW4YAyABKAkiTgoRTGlzdFBsYW5zUmVzcG9uc2USIAoFcGxhbnMYASADKAsyES5ieXRlYmFzZS52MS5QbGFuEhcKD25leHRfcGFnZV90b2tlbhgCIAEoCSJgChJTZWFyY2hQbGFuc1JlcXVlc3QSEwoGcGFyZW50GAEgASgJQgPgQQISEQoJcGFnZV9zaXplGAIgASgFEhIKCnBhZ2VfdG9rZW4YAyABKAkSDgoGZmlsdGVyGAQgASgJIlAKE1NlYXJjaFBsYW5zUmVzcG9uc2USIAoFcGxhbnMYASADKAsyES5ieXRlYmFzZS52MS5QbGFuEhcKD25leHRfcGFnZV90b2tlbhgCIAEoCSJnChFDcmVhdGVQbGFuUmVxdWVzdBIsCgZwYXJlbnQYASABKAlCHOBBAvpBFgoUYnl0ZWJhc2UuY29tL1Byb2plY3QSJAoEcGxhbhgCIAEoCzIRLmJ5dGViYXNlLnYxLlBsYW5CA+BBAiKGAQoRVXBkYXRlUGxhblJlcXVlc3QSJAoEcGxhbhgBIAEoCzIRLmJ5dGViYXNlLnYxLlBsYW5CA+BBAhI0Cgt1cGRhdGVfbWFzaxgCIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5GaWVsZE1hc2tCA+BBAhIVCg1hbGxvd19taXNzaW5nGAMgASgIIqYLCgRQbGFuEgwKBG5hbWUYASABKAkSIQoFc3RhdGUYAiABKA4yEi5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bFBsYW5DaGVja1J1bnNSZXF1ZXN0Gi0uYnl0ZWJhc2UudjEuQmF0Y2hDYW5jZWxQbGFuQ2hlY2tSdW5zUmVzcG9uc2UiadpBBnBhcmVudIrqMBRiYi5wbGFuQ2hlY2tSdW5zLnJ1bpDqMAGC0+STAj46ASoiOS92MS97cGFyZW50PXByb2plY3RzLyovcGxhbnMvKn0vcGxhbkNoZWNrUnVuczpiYXRjaENhbmNlbEKmAQoPY29tLmJ5dGViYXNlLnYxQhBQbGFuU2VydmljZVByb3RvUAFaNGdpdGh1Yi5jb20vYnl0ZWJhc2UvYnl0ZWJhc2UvYmFja2VuZC9nZW5lcmF0ZWQtZ28vdjGiAgNCWFiqAgtCeXRlYmFzZS5WMcoCC0J5dGViYXNlXFYx4gIXQnl0ZWJhc2VcVjFcR1BCTWV0YWRhdGHqAgxCeXRlYmFzZTo6VjFiBnByb3RvMw", [file_buf_validate_validate, file_google_api_annotations, file_google_api_client, file_google_api_field_behavior, file_google_api_resource, file_google_protobuf_field_mask, file_google_protobuf_timestamp, file_v1_annotation, file_v1_common, file_v1_sql_service]);
+ fileDesc("ChV2MS9wbGFuX3NlcnZpY2UucHJvdG8SC2J5dGViYXNlLnYxIjkKDkdldFBsYW5SZXF1ZXN0EicKBG5hbWUYASABKAlCGeBBAvpBEwoRYnl0ZWJhc2UuY29tL1BsYW4iZwoQTGlzdFBsYW5zUmVxdWVzdBIsCgZwYXJlbnQYASABKAlCHOBBAvpBFgoUYnl0ZWJhc2UuY29tL1Byb2plY3QSEQoJcGFnZV9zaXplGAIgASgFEhIKCnBhZ2VfdG9rZW4YAyABKAkiTgoRTGlzdFBsYW5zUmVzcG9uc2USIAoFcGxhbnMYASADKAsyES5ieXRlYmFzZS52MS5QbGFuEhcKD25leHRfcGFnZV90b2tlbhgCIAEoCSJgChJTZWFyY2hQbGFuc1JlcXVlc3QSEwoGcGFyZW50GAEgASgJQgPgQQISEQoJcGFnZV9zaXplGAIgASgFEhIKCnBhZ2VfdG9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YW5DaGVja1J1bnNSZXNwb25zZSJb2kEGcGFyZW50iuowFWJiLnBsYW5DaGVja1J1bnMubGlzdJDqMAGC0+STAi8SLS92MS97cGFyZW50PXByb2plY3RzLyovcGxhbnMvKn0vcGxhbkNoZWNrUnVucxKxAQoNUnVuUGxhbkNoZWNrcxIhLmJ5dGViYXNlLnYxLlJ1blBsYW5DaGVja3NSZXF1ZXN0GiIuYnl0ZWJhc2UudjEuUnVuUGxhbkNoZWNrc1Jlc3BvbnNlIlnaQQRuYW1liuowFGJiLnBsYW5DaGVja1J1bnMucnVukOowAYLT5JMCMDoBKiIrL3YxL3tuYW1lPXByb2plY3RzLyovcGxhbnMvKn06cnVuUGxhbkNoZWNrcxLiAQoYQmF0Y2hDYW5jZWxQbGFuQ2hlY2tSdW5zEiwuYnl0ZWJhc2UudjEuQmF0Y2hDYW5jZWxQbGFuQ2hlY2tSdW5zUmVxdWVzdBotLmJ5dGViYXNlLnYxLkJhdGNoQ2FuY2VsUGxhbkNoZWNrUnVuc1Jlc3BvbnNlImnaQQZwYXJlbnSK6jAUYmIucGxhbkNoZWNrUnVucy5ydW6Q6jABgtPkkwI+OgEqIjkvdjEve3BhcmVudD1wcm9qZWN0cy8qL3BsYW5zLyp9L3BsYW5DaGVja1J1bnM6YmF0Y2hDYW5jZWxCpgEKD2NvbS5ieXRlYmFzZS52MUIQUGxhblNlcnZpY2VQcm90b1ABWjRnaXRodWIuY29tL2J5dGViYXNlL2J5dGViYXNlL2JhY2tlbmQvZ2VuZXJhdGVkLWdvL3YxogIDQlhYqgILQnl0ZWJhc2UuVjHKAgtCeXRlYmFzZVxWMeICF0J5dGViYXNlXFYxXEdQQk1ldGFkYXRh6gIMQnl0ZWJhc2U6OlYxYgZwcm90bzM", [file_buf_validate_validate, file_google_api_annotations, file_google_api_client, file_google_api_field_behavior, file_google_api_resource, file_google_protobuf_field_mask, file_google_protobuf_timestamp, file_v1_annotation, file_v1_common, file_v1_sql_service]);
/**
* Describes the message bytebase.v1.GetPlanRequest.
@@ -174,22 +174,22 @@ export const PlanCheckRun_Result_SqlReviewReportSchema = /*@__PURE__*/
messageDesc(file_v1_plan_service, 14, 0, 1);
/**
- * Describes the enum bytebase.v1.PlanCheckRun.Type.
+ * Describes the enum bytebase.v1.PlanCheckRun.Result.Type.
*/
-export const PlanCheckRun_TypeSchema = /*@__PURE__*/
- enumDesc(file_v1_plan_service, 14, 0);
+export const PlanCheckRun_Result_TypeSchema = /*@__PURE__*/
+ enumDesc(file_v1_plan_service, 14, 0, 0);
/**
- * @generated from enum bytebase.v1.PlanCheckRun.Type
+ * @generated from enum bytebase.v1.PlanCheckRun.Result.Type
*/
-export const PlanCheckRun_Type = /*@__PURE__*/
- tsEnum(PlanCheckRun_TypeSchema);
+export const PlanCheckRun_Result_Type = /*@__PURE__*/
+ tsEnum(PlanCheckRun_Result_TypeSchema);
/**
* Describes the enum bytebase.v1.PlanCheckRun.Status.
*/
export const PlanCheckRun_StatusSchema = /*@__PURE__*/
- enumDesc(file_v1_plan_service, 14, 1);
+ enumDesc(file_v1_plan_service, 14, 0);
/**
* @generated from enum bytebase.v1.PlanCheckRun.Status
diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yaml
index 32963f4af8..4effbc1ed6 100644
--- a/proto/gen/grpc-doc/openapi.yaml
+++ b/proto/gen/grpc-doc/openapi.yaml
@@ -11858,14 +11858,6 @@ components:
name:
type: string
description: 'Format: projects/{project}/plans/{plan}/planCheckRuns/{planCheckRun}'
- type:
- enum:
- - TYPE_UNSPECIFIED
- - DATABASE_STATEMENT_ADVISE
- - DATABASE_STATEMENT_SUMMARY_REPORT
- - DATABASE_GHOST_SYNC
- type: string
- format: enum
status:
enum:
- STATUS_UNSPECIFIED
@@ -11875,12 +11867,6 @@ components:
- CANCELED
type: string
format: enum
- target:
- type: string
- description: 'Format: instances/{instance}/databases/{database}'
- sheet:
- type: string
- description: 'Format: project/{project}/sheets/{sheet}'
results:
type: array
items:
@@ -11910,6 +11896,19 @@ components:
code:
type: integer
format: int32
+ target:
+ type: string
+ description: |-
+ Target identification for consolidated results.
+ Format: instances/{instance}/databases/{database}
+ type:
+ enum:
+ - TYPE_UNSPECIFIED
+ - STATEMENT_ADVISE
+ - STATEMENT_SUMMARY_REPORT
+ - GHOST_SYNC
+ type: string
+ format: enum
sqlSummaryReport:
$ref: '#/components/schemas/Result_SqlSummaryReport'
sqlReviewReport:
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index f2552e8748..220b8ea841 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -471,8 +471,8 @@
- [SearchPlansResponse](#bytebase-v1-SearchPlansResponse)
- [UpdatePlanRequest](#bytebase-v1-UpdatePlanRequest)
+ - [PlanCheckRun.Result.Type](#bytebase-v1-PlanCheckRun-Result-Type)
- [PlanCheckRun.Status](#bytebase-v1-PlanCheckRun-Status)
- - [PlanCheckRun.Type](#bytebase-v1-PlanCheckRun-Type)
- [PlanService](#bytebase-v1-PlanService)
@@ -7691,10 +7691,7 @@ When paginating, all other parameters provided to `ListPlans` must match the cal
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| name | [string](#string) | | Format: projects/{project}/plans/{plan}/planCheckRuns/{planCheckRun} |
-| type | [PlanCheckRun.Type](#bytebase-v1-PlanCheckRun-Type) | | |
| status | [PlanCheckRun.Status](#bytebase-v1-PlanCheckRun-Status) | | |
-| target | [string](#string) | | Format: instances/{instance}/databases/{database} |
-| sheet | [string](#string) | | Format: project/{project}/sheets/{sheet} |
| results | [PlanCheckRun.Result](#bytebase-v1-PlanCheckRun-Result) | repeated | |
| error | [string](#string) | | error is set if the Status is FAILED. |
| create_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
@@ -7716,6 +7713,8 @@ When paginating, all other parameters provided to `ListPlans` must match the cal
| title | [string](#string) | | |
| content | [string](#string) | | |
| code | [int32](#int32) | | |
+| target | [string](#string) | | Target identification for consolidated results. Format: instances/{instance}/databases/{database} |
+| type | [PlanCheckRun.Result.Type](#bytebase-v1-PlanCheckRun-Result-Type) | | |
| sql_summary_report | [PlanCheckRun.Result.SqlSummaryReport](#bytebase-v1-PlanCheckRun-Result-SqlSummaryReport) | | |
| sql_review_report | [PlanCheckRun.Result.SqlReviewReport](#bytebase-v1-PlanCheckRun-Result-SqlReviewReport) | | |
@@ -7843,32 +7842,32 @@ The plan&#39;s `name` field is used to identify the plan to update. Format: proj
-<a name="bytebase-v1-PlanCheckRun-Status"></a>
+<a name="bytebase-v1-PlanCheckRun-Result-Type"></a>
-### PlanCheckRun.Status
+### PlanCheckRun.Result.Type
| Name | Number | Description |
| ---- | ------ | ----------- |
-| STATUS_UNSPECIFIED | 0 | |
-| RUNNING | 1 | |
-| DONE | 2 | |
-| FAILED | 3 | |
-| CANCELED | 4 | |
+| TYPE_UNSPECIFIED | 0 | |
+| STATEMENT_ADVISE | 1 | |
+| STATEMENT_SUMMARY_REPORT | 2 | |
+| GHOST_SYNC | 3 | |
-<a name="bytebase-v1-PlanCheckRun-Type"></a>
+<a name="bytebase-v1-PlanCheckRun-Status"></a>
-### PlanCheckRun.Type
+### PlanCheckRun.Status
| Name | Number | Description |
| ---- | ------ | ----------- |
-| TYPE_UNSPECIFIED | 0 | Unspecified check type. |
-| DATABASE_STATEMENT_ADVISE | 2 | SQL review check that analyzes statements against configured SQL review rules. |
-| DATABASE_STATEMENT_SUMMARY_REPORT | 3 | Summary report check that generates impact analysis for the statements. |
-| DATABASE_GHOST_SYNC | 5 | Ghost sync check that validates gh-ost online schema change compatibility. |
+| STATUS_UNSPECIFIED | 0 | |
+| RUNNING | 1 | |
+| DONE | 2 | |
+| FAILED | 3 | |
+| CANCELED | 4 | |
diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.html
index c0856bfef0..c4812e5209 100644
--- a/proto/gen/grpc-doc/v1/index.html
+++ b/proto/gen/grpc-doc/v1/index.html
@@ -1977,11 +1977,11 @@
<li>
- <a href="#bytebase.v1.PlanCheckRun.Status"><span class="badge">E</span>PlanCheckRun.Status</a>
+ <a href="#bytebase.v1.PlanCheckRun.Result.Type"><span class="badge">E</span>PlanCheckRun.Result.Type</a>
</li>
<li>
- <a href="#bytebase.v1.PlanCheckRun.Type"><span class="badge">E</span>PlanCheckRun.Type</a>
+ <a href="#bytebase.v1.PlanCheckRun.Status"><span class="badge">E</span>PlanCheckRun.Status</a>
</li>
@@ -21702,13 +21702,6 @@ Leave it empty if no needs to encrypt the zip file. </p></td>
<td><p>Format: projects/{project}/plans/{plan}/planCheckRuns/{planCheckRun} </p></td>
</tr>
- <tr>
- <td>type</td>
- <td><a href="#bytebase.v1.PlanCheckRun.Type">PlanCheckRun.Type</a></td>
- <td></td>
- <td><p> </p></td>
- </tr>
-
<tr>
<td>status</td>
<td><a href="#bytebase.v1.PlanCheckRun.Status">PlanCheckRun.Status</a></td>
@@ -21716,20 +21709,6 @@ Leave it empty if no needs to encrypt the zip file. </p></td>
<td><p> </p></td>
</tr>
- <tr>
- <td>target</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>Format: instances/{instance}/databases/{database} </p></td>
- </tr>
-
- <tr>
- <td>sheet</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>Format: project/{project}/sheets/{sheet} </p></td>
- </tr>
-
<tr>
<td>results</td>
<td><a href="#bytebase.v1.PlanCheckRun.Result">PlanCheckRun.Result</a></td>
@@ -21796,6 +21775,21 @@ Leave it empty if no needs to encrypt the zip file. </p></td>
<td><p> </p></td>
</tr>
+ <tr>
+ <td>target</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>Target identification for consolidated results.
+Format: instances/{instance}/databases/{database} </p></td>
+ </tr>
+
+ <tr>
+ <td>type</td>
+ <td><a href="#bytebase.v1.PlanCheckRun.Result.Type">PlanCheckRun.Result.Type</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
<tr>
<td>sql_summary_report</td>
<td><a href="#bytebase.v1.PlanCheckRun.Result.SqlSummaryReport">PlanCheckRun.Result.SqlSummaryReport</a></td>
@@ -22068,7 +22062,7 @@ In this situation, `update_mask` is ignored. </p></td>
- <h3 id="bytebase.v1.PlanCheckRun.Status">PlanCheckRun.Status</h3>
+ <h3 id="bytebase.v1.PlanCheckRun.Result.Type">PlanCheckRun.Result.Type</h3>
<p></p>
<table class="enum-table">
<thead>
@@ -22077,39 +22071,33 @@ In this situation, `update_mask` is ignored. </p></td>
<tbody>
<tr>
- <td>STATUS_UNSPECIFIED</td>
+ <td>TYPE_UNSPECIFIED</td>
<td>0</td>
<td><p></p></td>
</tr>
<tr>
- <td>RUNNING</td>
+ <td>STATEMENT_ADVISE</td>
<td>1</td>
<td><p></p></td>
</tr>
<tr>
- <td>DONE</td>
+ <td>STATEMENT_SUMMARY_REPORT</td>
<td>2</td>
<td><p></p></td>
</tr>
<tr>
- <td>FAILED</td>
+ <td>GHOST_SYNC</td>
<td>3</td>
<td><p></p></td>
</tr>
- <tr>
- <td>CANCELED</td>
- <td>4</td>
- <td><p></p></td>
- </tr>
-
</tbody>
</table>
- <h3 id="bytebase.v1.PlanCheckRun.Type">PlanCheckRun.Type</h3>
+ <h3 id="bytebase.v1.PlanCheckRun.Status">PlanCheckRun.Status</h3>
<p></p>
<table class="enum-table">
<thead>
@@ -22118,27 +22106,33 @@ In this situation, `update_mask` is ignored. </p></td>
<tbody>
<tr>
- <td>TYPE_UNSPECIFIED</td>
+ <td>STATUS_UNSPECIFIED</td>
<td>0</td>
- <td><p>Unspecified check type.</p></td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>RUNNING</td>
+ <td>1</td>
+ <td><p></p></td>
</tr>
<tr>
- <td>DATABASE_STATEMENT_ADVISE</td>
+ <td>DONE</td>
<td>2</td>
- <td><p>SQL review check that analyzes statements against configured SQL review rules.</p></td>
+ <td><p></p></td>
</tr>
<tr>
- <td>DATABASE_STATEMENT_SUMMARY_REPORT</td>
+ <td>FAILED</td>
<td>3</td>
- <td><p>Summary report check that generates impact analysis for the statements.</p></td>
+ <td><p></p></td>
</tr>
<tr>
- <td>DATABASE_GHOST_SYNC</td>
- <td>5</td>
- <td><p>Ghost sync check that validates gh-ost online schema change compatibility.</p></td>
+ <td>CANCELED</td>
+ <td>4</td>
+ <td><p></p></td>
</tr>
</tbody>
diff --git a/proto/v1/v1/plan_service.proto b/proto/v1/v1/plan_service.proto
index 9944bef8a1..75e98322e5 100644
--- a/proto/v1/v1/plan_service.proto
+++ b/proto/v1/v1/plan_service.proto
@@ -413,18 +413,6 @@ message PlanCheckRun {
// Format: projects/{project}/plans/{plan}/planCheckRuns/{planCheckRun}
string name = 1;
- enum Type {
- // Unspecified check type.
- TYPE_UNSPECIFIED = 0;
- // SQL review check that analyzes statements against configured SQL review rules.
- DATABASE_STATEMENT_ADVISE = 2;
- // Summary report check that generates impact analysis for the statements.
- DATABASE_STATEMENT_SUMMARY_REPORT = 3;
- // Ghost sync check that validates gh-ost online schema change compatibility.
- DATABASE_GHOST_SYNC = 5;
- }
- Type type = 2;
-
enum Status {
STATUS_UNSPECIFIED = 0;
RUNNING = 1;
@@ -434,12 +422,6 @@ message PlanCheckRun {
}
Status status = 3;
- // Format: instances/{instance}/databases/{database}
- string target = 4;
-
- // Format: project/{project}/sheets/{sheet}
- string sheet = 5;
-
repeated Result results = 6;
// error is set if the Status is FAILED.
string error = 7;
@@ -452,6 +434,18 @@ message PlanCheckRun {
string content = 3;
int32 code = 4;
+ // Target identification for consolidated results.
+ // Format: instances/{instance}/databases/{database}
+ string target = 7;
+ Type type = 8;
+
+ enum Type {
+ TYPE_UNSPECIFIED = 0;
+ STATEMENT_ADVISE = 1;
+ STATEMENT_SUMMARY_REPORT = 2;
+ GHOST_SYNC = 3;
+ }
+
oneof report {
SqlSummaryReport sql_summary_report = 5;
SqlReviewReport sql_review_report = 6;