Skip to content

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

chore: convert plan check run to singleton resource API (#18611)

p0ny480c57ff4a20
diff --git a/backend/api/mcp/gen/openapi.yaml b/backend/api/mcp/gen/openapi.yaml
index b2231a622b..01cfc3c5cc 100644
--- a/backend/api/mcp/gen/openapi.yaml
+++ b/backend/api/mcp/gen/openapi.yaml
@@ -2931,15 +2931,15 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/bytebase.v1.Policy'
- /bytebase.v1.PlanService/BatchCancelPlanCheckRuns:
+ /bytebase.v1.PlanService/CancelPlanCheckRun:
post:
tags:
- bytebase.v1.PlanService
- summary: 'Cancels multiple plan check runs. Permissions required: bb.planCheckRuns.run'
+ summary: 'Cancels the plan check run for a deployment plan. Permissions required: bb.planCheckRuns.run'
description: |-
- Cancels multiple plan check runs.
+ Cancels the plan check run for a deployment plan.
Permissions required: bb.planCheckRuns.run
- operationId: bytebase.v1.PlanService.BatchCancelPlanCheckRuns
+ operationId: bytebase.v1.PlanService.CancelPlanCheckRun
parameters:
- name: Connect-Protocol-Version
in: header
@@ -2954,7 +2954,7 @@ paths:
content:
application/json:
schema:
- $ref: '#/components/schemas/bytebase.v1.BatchCancelPlanCheckRunsRequest'
+ $ref: '#/components/schemas/bytebase.v1.CancelPlanCheckRunRequest'
required: true
responses:
default:
@@ -2968,7 +2968,7 @@ paths:
content:
application/json:
schema:
- $ref: '#/components/schemas/bytebase.v1.BatchCancelPlanCheckRunsResponse'
+ $ref: '#/components/schemas/bytebase.v1.CancelPlanCheckRunResponse'
/bytebase.v1.PlanService/CreatePlan:
post:
tags:
@@ -3045,15 +3045,15 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/bytebase.v1.Plan'
- /bytebase.v1.PlanService/ListPlanCheckRuns:
+ /bytebase.v1.PlanService/GetPlanCheckRun:
post:
tags:
- bytebase.v1.PlanService
- summary: 'Lists plan check runs for a deployment plan. Permissions required: bb.planCheckRuns.list'
+ summary: 'Gets the plan check run for a deployment plan. Permissions required: bb.planCheckRuns.get'
description: |-
- Lists plan check runs for a deployment plan.
- Permissions required: bb.planCheckRuns.list
- operationId: bytebase.v1.PlanService.ListPlanCheckRuns
+ Gets the plan check run for a deployment plan.
+ Permissions required: bb.planCheckRuns.get
+ operationId: bytebase.v1.PlanService.GetPlanCheckRun
parameters:
- name: Connect-Protocol-Version
in: header
@@ -3068,7 +3068,7 @@ paths:
content:
application/json:
schema:
- $ref: '#/components/schemas/bytebase.v1.ListPlanCheckRunsRequest'
+ $ref: '#/components/schemas/bytebase.v1.GetPlanCheckRunRequest'
required: true
responses:
default:
@@ -3082,7 +3082,7 @@ paths:
content:
application/json:
schema:
- $ref: '#/components/schemas/bytebase.v1.ListPlanCheckRunsResponse'
+ $ref: '#/components/schemas/bytebase.v1.PlanCheckRun'
/bytebase.v1.PlanService/ListPlans:
post:
tags:
@@ -7053,30 +7053,6 @@ components:
- IAM
- CUSTOM
description: Authorization method for RPC calls.
- bytebase.v1.BatchCancelPlanCheckRunsRequest:
- type: object
- properties:
- parent:
- type: string
- title: parent
- description: |-
- The name of the parent of the planChecks.
- Format: projects/{project}/plans/{plan}
- planCheckRuns:
- type: array
- items:
- type: string
- title: plan_check_runs
- description: |-
- TODO(d): update this API.
- The planCheckRuns to cancel.
- Format: projects/{project}/plans/{plan}/planCheckRuns/{planCheckRun}
- title: BatchCancelPlanCheckRunsRequest
- additionalProperties: false
- bytebase.v1.BatchCancelPlanCheckRunsResponse:
- type: object
- title: BatchCancelPlanCheckRunsResponse
- additionalProperties: false
bytebase.v1.BatchCancelTaskRunsRequest:
type: object
properties:
@@ -7633,6 +7609,21 @@ components:
title: BoundingBox
additionalProperties: false
description: BoundingBox defines the spatial bounds for GEOMETRY spatial indexes.
+ bytebase.v1.CancelPlanCheckRunRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the plan check run to cancel.
+ Format: projects/{project}/plans/{plan}/planCheckRun
+ title: CancelPlanCheckRunRequest
+ additionalProperties: false
+ bytebase.v1.CancelPlanCheckRunResponse:
+ type: object
+ title: CancelPlanCheckRunResponse
+ additionalProperties: false
bytebase.v1.Changelog:
type: object
properties:
@@ -10023,6 +10014,17 @@ components:
description: If set to true, bypass cache and fetch the latest data.
title: GetIssueRequest
additionalProperties: false
+ bytebase.v1.GetPlanCheckRunRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the plan check run to retrieve.
+ Format: projects/{project}/plans/{plan}/planCheckRun
+ title: GetPlanCheckRunRequest
+ additionalProperties: false
bytebase.v1.GetPlanRequest:
type: object
properties:
@@ -11699,48 +11701,6 @@ components:
If this field is omitted, there are no subsequent pages.
title: ListIssuesResponse
additionalProperties: false
- bytebase.v1.ListPlanCheckRunsRequest:
- type: object
- properties:
- parent:
- type: string
- title: parent
- description: |-
- The parent, which owns this collection of plan check runs.
- Format: projects/{project}/plans/{plan}
- latestOnly:
- type: boolean
- title: latest_only
- description: If set to true, only the latest plan check run will be returned.
- filter:
- type: string
- title: filter
- description: |-
- Filter is used to filter plan check runs returned in the list.
- The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
-
- Supported filters:
- - status: the plan check run status, support "==" and "in" operator, check the Status enum in the PlanCheckRun message for the values.
- - result_status: the plan check run result status, support "==" and "in" operator, check the Result.Status enum in the PlanCheckRun message for the values.
-
- For example:
- status in ["DONE", "FAILED"]
- status == "RUNNING"
- result_status in ["SUCCESS", "ERROR"]
- result_status == "WARNING"
- title: ListPlanCheckRunsRequest
- additionalProperties: false
- bytebase.v1.ListPlanCheckRunsResponse:
- type: object
- properties:
- planCheckRuns:
- type: array
- items:
- $ref: '#/components/schemas/bytebase.v1.PlanCheckRun'
- title: plan_check_runs
- description: The plan check runs from the specified request.
- title: ListPlanCheckRunsResponse
- additionalProperties: false
bytebase.v1.ListPlansRequest:
type: object
properties:
@@ -12882,7 +12842,7 @@ components:
name:
type: string
title: name
- description: 'Format: projects/{project}/plans/{plan}/planCheckRuns/{planCheckRun}'
+ description: 'Format: projects/{project}/plans/{plan}/planCheckRun'
status:
title: status
$ref: '#/components/schemas/bytebase.v1.PlanCheckRun.Status'
diff --git a/backend/api/v1/acl_test.go b/backend/api/v1/acl_test.go
index 7fec39f4d2..228142fd39 100644
--- a/backend/api/v1/acl_test.go
+++ b/backend/api/v1/acl_test.go
@@ -174,12 +174,12 @@ func TestGetResourceFromRequest(t *testing.T) {
},
},
{
- request: &v1pb.BatchCancelPlanCheckRunsRequest{
- Parent: "projects/hello/plans/world",
+ request: &v1pb.CancelPlanCheckRunRequest{
+ Name: "projects/hello/plans/world/planCheckRun",
},
- method: "/bytebase.v1.PlanService/BatchCancelPlanCheckRuns",
+ method: "/bytebase.v1.PlanService/CancelPlanCheckRun",
want: []*common.Resource{
- {Name: "projects/hello/plans/world"},
+ {Name: "projects/hello/plans/world/planCheckRun"},
},
},
}
diff --git a/backend/api/v1/plan_service.go b/backend/api/v1/plan_service.go
index 5d09e5ce2f..89560fdaf1 100644
--- a/backend/api/v1/plan_service.go
+++ b/backend/api/v1/plan_service.go
@@ -6,9 +6,6 @@ import (
"slices"
"connectrpc.com/connect"
- "github.com/google/cel-go/cel"
- celast "github.com/google/cel-go/common/ast"
- celoperators "github.com/google/cel-go/common/operators"
"github.com/pkg/errors"
"google.golang.org/protobuf/types/known/timestamppb"
@@ -434,162 +431,24 @@ func (s *PlanService) UpdatePlan(ctx context.Context, request *connect.Request[v
return connect.NewResponse(convertedPlan), nil
}
-// ListPlanCheckRuns lists plan check runs for the plan.
-func (s *PlanService) ListPlanCheckRuns(ctx context.Context, request *connect.Request[v1pb.ListPlanCheckRunsRequest]) (*connect.Response[v1pb.ListPlanCheckRunsResponse], error) {
+// GetPlanCheckRun gets the plan check run for the plan.
+func (s *PlanService) GetPlanCheckRun(ctx context.Context, request *connect.Request[v1pb.GetPlanCheckRunRequest]) (*connect.Response[v1pb.PlanCheckRun], error) {
req := request.Msg
- projectID, planUID, err := common.GetProjectIDPlanID(req.Parent)
+ projectID, planUID, err := common.GetProjectIDPlanIDFromPlanCheckRun(req.Name)
if err != nil {
return nil, connect.NewError(connect.CodeInvalidArgument, err)
}
- find := &store.FindPlanCheckRunMessage{
- PlanUID: &planUID,
- }
- // Parse filter if provided
- if req.Filter != "" {
- if err := s.parsePlanCheckRunFilter(req.Filter, find); err != nil {
- return nil, err
- }
- }
- planCheckRuns, err := s.store.ListPlanCheckRuns(ctx, find)
+ planCheckRun, err := s.store.GetPlanCheckRun(ctx, planUID)
if err != nil {
- return nil, connect.NewError(connect.CodeInternal, errors.Errorf("failed to list plan check runs, error: %v", err))
+ return nil, connect.NewError(connect.CodeInternal, errors.Errorf("failed to get plan check run, error: %v", err))
}
- converted := convertToPlanCheckRuns(projectID, planUID, planCheckRuns)
-
- return connect.NewResponse(&v1pb.ListPlanCheckRunsResponse{
- PlanCheckRuns: converted,
- }), nil
-}
-
-// parsePlanCheckRunFilter parses the filter for plan check runs.
-func (*PlanService) parsePlanCheckRunFilter(filter string, find *store.FindPlanCheckRunMessage) error {
- if filter == "" {
- return nil
+ if planCheckRun == nil {
+ return nil, connect.NewError(connect.CodeNotFound, errors.Errorf("plan check run not found for plan %d", planUID))
}
- e, err := cel.NewEnv()
- if err != nil {
- return connect.NewError(connect.CodeInternal, errors.Errorf("failed to create cel env"))
- }
- ast, iss := e.Parse(filter)
- if iss != nil {
- return connect.NewError(connect.CodeInvalidArgument, errors.Errorf("failed to parse filter %v, error: %v", filter, iss.String()))
- }
-
- var parseFilter func(expr celast.Expr) error
- parseFilter = func(expr celast.Expr) error {
- switch expr.Kind() {
- case celast.CallKind:
- functionName := expr.AsCall().FunctionName()
- switch functionName {
- case celoperators.LogicalAnd:
- // Handle AND operator by recursively parsing left and right expressions
- for _, arg := range expr.AsCall().Args() {
- if err := parseFilter(arg); err != nil {
- return err
- }
- }
- case celoperators.Equals:
- variable, value := getVariableAndValueFromExpr(expr)
- switch variable {
- case "status":
- statusStr, ok := value.(string)
- if !ok {
- return connect.NewError(connect.CodeInvalidArgument, errors.Errorf("status value must be a string"))
- }
- // Convert v1pb status to store status
- v1Status := v1pb.PlanCheckRun_Status_value[statusStr]
- if v1Status == 0 && statusStr != "STATUS_UNSPECIFIED" {
- return connect.NewError(connect.CodeInvalidArgument, errors.Errorf("invalid status value: %s", statusStr))
- }
- storeStatus := convertToStorePlanCheckRunStatus(v1pb.PlanCheckRun_Status(v1Status))
- if find.Status == nil {
- find.Status = &[]store.PlanCheckRunStatus{}
- }
- *find.Status = append(*find.Status, storeStatus)
- case "result_status":
- resultStatusStr, ok := value.(string)
- if !ok {
- return connect.NewError(connect.CodeInvalidArgument, errors.Errorf("result_status value must be a string"))
- }
- // Convert v1pb result status to store result status
- v1ResultStatus := v1pb.Advice_Level_value[resultStatusStr]
- if v1ResultStatus == 0 && resultStatusStr != "STATUS_UNSPECIFIED" {
- return connect.NewError(connect.CodeInvalidArgument, errors.Errorf("invalid result_status value: %s", resultStatusStr))
- }
- storeResultStatus := convertToStoreResultStatus(v1pb.Advice_Level(v1ResultStatus))
- if find.ResultStatus == nil {
- find.ResultStatus = &[]storepb.Advice_Status{}
- }
- *find.ResultStatus = append(*find.ResultStatus, storeResultStatus)
- default:
- return connect.NewError(connect.CodeInvalidArgument, errors.Errorf("unsupported filter variable: %s", variable))
- }
- case celoperators.In:
- variable, value := getVariableAndValueFromExpr(expr)
- switch variable {
- case "status":
- rawList, ok := value.([]any)
- if !ok {
- return connect.NewError(connect.CodeInvalidArgument, errors.Errorf("invalid list value %q for %v", value, variable))
- }
- if len(rawList) == 0 {
- return connect.NewError(connect.CodeInvalidArgument, errors.Errorf("empty list value for filter %v", variable))
- }
- if find.Status == nil {
- find.Status = &[]store.PlanCheckRunStatus{}
- }
- for _, raw := range rawList {
- statusStr, ok := raw.(string)
- if !ok {
- return connect.NewError(connect.CodeInvalidArgument, errors.Errorf("status value must be a string"))
- }
- // Convert v1pb status to store status
- v1Status := v1pb.PlanCheckRun_Status_value[statusStr]
- if v1Status == 0 && statusStr != "STATUS_UNSPECIFIED" {
- return connect.NewError(connect.CodeInvalidArgument, errors.Errorf("invalid status value: %s", statusStr))
- }
- storeStatus := convertToStorePlanCheckRunStatus(v1pb.PlanCheckRun_Status(v1Status))
- *find.Status = append(*find.Status, storeStatus)
- }
- case "result_status":
- rawList, ok := value.([]any)
- if !ok {
- return connect.NewError(connect.CodeInvalidArgument, errors.Errorf("invalid list value %q for %v", value, variable))
- }
- if len(rawList) == 0 {
- return connect.NewError(connect.CodeInvalidArgument, errors.Errorf("empty list value for filter %v", variable))
- }
- if find.ResultStatus == nil {
- find.ResultStatus = &[]storepb.Advice_Status{}
- }
- for _, raw := range rawList {
- resultStatusStr, ok := raw.(string)
- if !ok {
- return connect.NewError(connect.CodeInvalidArgument, errors.Errorf("result_status value must be a string"))
- }
- // Convert v1pb result status to store result status
- v1ResultStatus := v1pb.Advice_Level_value[resultStatusStr]
- if v1ResultStatus == 0 && resultStatusStr != "STATUS_UNSPECIFIED" {
- return connect.NewError(connect.CodeInvalidArgument, errors.Errorf("invalid result_status value: %s", resultStatusStr))
- }
- storeResultStatus := convertToStoreResultStatus(v1pb.Advice_Level(v1ResultStatus))
- *find.ResultStatus = append(*find.ResultStatus, storeResultStatus)
- }
- default:
- return connect.NewError(connect.CodeInvalidArgument, errors.Errorf("unsupported filter variable: %s", variable))
- }
- default:
- return connect.NewError(connect.CodeInvalidArgument, errors.Errorf("unsupported operator: %s", functionName))
- }
- default:
- return connect.NewError(connect.CodeInvalidArgument, errors.Errorf("invalid filter expression"))
- }
- return nil
- }
-
- return parseFilter(ast.NativeRep().Expr())
+ converted := convertToPlanCheckRun(projectID, planUID, planCheckRun)
+ return connect.NewResponse(converted), nil
}
// RunPlanChecks runs plan checks for a plan.
@@ -655,17 +514,14 @@ func (s *PlanService) RunPlanChecks(ctx context.Context, request *connect.Reques
return connect.NewResponse(&v1pb.RunPlanChecksResponse{}), nil
}
-// BatchCancelPlanCheckRuns cancels a list of plan check runs.
-func (s *PlanService) BatchCancelPlanCheckRuns(ctx context.Context, request *connect.Request[v1pb.BatchCancelPlanCheckRunsRequest]) (*connect.Response[v1pb.BatchCancelPlanCheckRunsResponse], error) {
+// CancelPlanCheckRun cancels the plan check run for a plan.
+func (s *PlanService) CancelPlanCheckRun(ctx context.Context, request *connect.Request[v1pb.CancelPlanCheckRunRequest]) (*connect.Response[v1pb.CancelPlanCheckRunResponse], error) {
req := request.Msg
- if len(req.PlanCheckRuns) == 0 {
- return nil, connect.NewError(connect.CodeInvalidArgument, errors.Errorf("plan check runs cannot be empty"))
- }
-
- projectID, planID, err := common.GetProjectIDPlanID(req.Parent)
+ projectID, planUID, err := common.GetProjectIDPlanIDFromPlanCheckRun(req.Name)
if err != nil {
return nil, connect.NewError(connect.CodeInvalidArgument, err)
}
+
project, err := s.store.GetProject(ctx, &store.FindProjectMessage{
ResourceID: &projectID,
})
@@ -676,49 +532,29 @@ func (s *PlanService) BatchCancelPlanCheckRuns(ctx context.Context, request *con
return nil, connect.NewError(connect.CodeNotFound, errors.Errorf("project %v not found", projectID))
}
- var planCheckRunIDs []int
- for _, planCheckRun := range req.PlanCheckRuns {
- _, _, planCheckRunID, err := common.GetProjectIDPlanIDPlanCheckRunID(planCheckRun)
- if err != nil {
- return nil, connect.NewError(connect.CodeInvalidArgument, err)
- }
- planCheckRunIDs = append(planCheckRunIDs, planCheckRunID)
- }
-
- planCheckRuns, err := s.store.ListPlanCheckRuns(ctx, &store.FindPlanCheckRunMessage{
- UIDs: &planCheckRunIDs,
- })
+ planCheckRun, err := s.store.GetPlanCheckRun(ctx, planUID)
if err != nil {
- return nil, connect.NewError(connect.CodeInternal, errors.Errorf("failed to list plan check runs, error: %v", err))
+ return nil, connect.NewError(connect.CodeInternal, errors.Errorf("failed to get plan check run, error: %v", err))
}
-
- // Validate that all plan check runs belong to the plan specified in the parent.
- for _, planCheckRun := range planCheckRuns {
- if planCheckRun.PlanUID != planID {
- return nil, connect.NewError(connect.CodeNotFound, errors.Errorf("plan check run %d not found in plan %d", planCheckRun.UID, planID))
- }
+ if planCheckRun == nil {
+ return nil, connect.NewError(connect.CodeNotFound, errors.Errorf("plan check run not found for plan %d", planUID))
}
- // Check if any of the given plan check runs are not running.
- for _, planCheckRun := range planCheckRuns {
- switch planCheckRun.Status {
- case store.PlanCheckRunStatusRunning:
- default:
- return nil, connect.NewError(connect.CodeInvalidArgument, errors.Errorf("planCheckRun %v is not running", planCheckRun.UID))
- }
+ if planCheckRun.Status != store.PlanCheckRunStatusRunning {
+ return nil, connect.NewError(connect.CodeInvalidArgument, errors.Errorf("plan check run is not running"))
}
- // Cancel the plan check runs.
- for _, planCheckRun := range planCheckRuns {
- if cancelFunc, ok := s.stateCfg.RunningPlanCheckRunsCancelFunc.Load(planCheckRun.UID); ok {
- cancelFunc.(context.CancelFunc)()
- }
+
+ // Cancel the plan check run.
+ if cancelFunc, ok := s.stateCfg.RunningPlanCheckRunsCancelFunc.Load(planCheckRun.UID); ok {
+ cancelFunc.(context.CancelFunc)()
}
- // Update the status of the plan check runs to canceled.
- if err := s.store.BatchCancelPlanCheckRuns(ctx, planCheckRunIDs); err != nil {
- return nil, connect.NewError(connect.CodeInternal, errors.Errorf("failed to batch patch task run status to canceled, error: %v", err))
+
+ // Update the status to canceled.
+ if err := s.store.BatchCancelPlanCheckRuns(ctx, []int{planCheckRun.UID}); err != nil {
+ return nil, connect.NewError(connect.CodeInternal, errors.Errorf("failed to cancel plan check run, error: %v", err))
}
- return connect.NewResponse(&v1pb.BatchCancelPlanCheckRunsResponse{}), nil
+ return connect.NewResponse(&v1pb.CancelPlanCheckRunResponse{}), nil
}
func validateSpecs(ctx context.Context, s *store.Store, projectID string, specs []*v1pb.Plan_Spec) (*v1pb.DatabaseGroup, error) {
@@ -1028,15 +864,13 @@ func convertToPlan(ctx context.Context, s *store.Store, plan *store.PlanMessage)
if plan.PipelineUID != nil {
p.Rollout = common.FormatRollout(plan.ProjectID, *plan.PipelineUID)
}
- planCheckRuns, err := s.ListPlanCheckRuns(ctx, &store.FindPlanCheckRunMessage{
- PlanUID: &plan.UID,
- })
+ planCheckRun, err := s.GetPlanCheckRun(ctx, int64(plan.UID))
if err != nil {
- return nil, errors.Wrapf(err, "failed to list plan check runs for plan uid %d", plan.UID)
+ return nil, errors.Wrapf(err, "failed to get plan check run for plan uid %d", plan.UID)
}
- for _, run := range planCheckRuns {
- p.PlanCheckRunStatusCount[string(run.Status)]++
- for _, result := range run.Result.Results {
+ if planCheckRun != nil {
+ p.PlanCheckRunStatusCount[string(planCheckRun.Status)]++
+ for _, result := range planCheckRun.Result.Results {
p.PlanCheckRunStatusCount[storepb.Advice_Status_name[int32(result.Status)]]++
}
}
@@ -1055,18 +889,14 @@ 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 {
- 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),
- })
+func convertToPlanCheckRun(projectID string, planUID int64, run *store.PlanCheckRunMessage) *v1pb.PlanCheckRun {
+ return &v1pb.PlanCheckRun{
+ Name: common.FormatPlanCheckRun(projectID, planUID),
+ Status: convertToPlanCheckRunStatus(run.Status),
+ Results: convertToPlanCheckRunResults(run.Result.GetResults()),
+ Error: run.Result.Error,
+ CreateTime: timestamppb.New(run.CreatedAt),
}
- return planCheckRuns
}
func convertToPlanSpecs(projectID string, specs []*storepb.PlanConfig_Spec) []*v1pb.Plan_Spec {
@@ -1331,33 +1161,3 @@ func convertToPlanCheckRunResultStatus(status storepb.Advice_Status) v1pb.Advice
return v1pb.Advice_ADVICE_LEVEL_UNSPECIFIED
}
}
-
-// convertToStorePlanCheckRunStatus converts v1pb.PlanCheckRun_Status to store.PlanCheckRunStatus.
-func convertToStorePlanCheckRunStatus(status v1pb.PlanCheckRun_Status) store.PlanCheckRunStatus {
- switch status {
- case v1pb.PlanCheckRun_CANCELED:
- return store.PlanCheckRunStatusCanceled
- case v1pb.PlanCheckRun_DONE:
- return store.PlanCheckRunStatusDone
- case v1pb.PlanCheckRun_FAILED:
- return store.PlanCheckRunStatusFailed
- case v1pb.PlanCheckRun_RUNNING:
- return store.PlanCheckRunStatusRunning
- default:
- return store.PlanCheckRunStatusRunning
- }
-}
-
-// convertToStoreResultStatus converts v1pb.Advice_Status to storepb.Advice_Status.
-func convertToStoreResultStatus(status v1pb.Advice_Level) storepb.Advice_Status {
- switch status {
- case v1pb.Advice_ERROR:
- return storepb.Advice_ERROR
- case v1pb.Advice_WARNING:
- return storepb.Advice_WARNING
- case v1pb.Advice_SUCCESS:
- return storepb.Advice_SUCCESS
- default:
- return storepb.Advice_STATUS_UNSPECIFIED
- }
-}
diff --git a/backend/api/v1/plan_service_test.go b/backend/api/v1/plan_service_test.go
deleted file mode 100644
index ae949743c1..0000000000
--- a/backend/api/v1/plan_service_test.go
+++ /dev/null
@@ -1,230 +0,0 @@
-package v1
-
-import (
- "testing"
-
- "github.com/stretchr/testify/require"
-
- storepb "github.com/bytebase/bytebase/backend/generated-go/store"
- "github.com/bytebase/bytebase/backend/store"
-)
-
-func TestParsePlanCheckRunFilter(t *testing.T) {
- tests := []struct {
- name string
- filter string
- want *store.FindPlanCheckRunMessage
- wantErr bool
- errContains string
- }{
- {
- name: "empty filter",
- filter: "",
- want: &store.FindPlanCheckRunMessage{},
- },
- {
- name: "status equals DONE",
- filter: `status == "DONE"`,
- want: &store.FindPlanCheckRunMessage{
- Status: &[]store.PlanCheckRunStatus{store.PlanCheckRunStatusDone},
- },
- },
- {
- name: "status equals RUNNING",
- filter: `status == "RUNNING"`,
- want: &store.FindPlanCheckRunMessage{
- Status: &[]store.PlanCheckRunStatus{store.PlanCheckRunStatusRunning},
- },
- },
- {
- name: "status equals FAILED",
- filter: `status == "FAILED"`,
- want: &store.FindPlanCheckRunMessage{
- Status: &[]store.PlanCheckRunStatus{store.PlanCheckRunStatusFailed},
- },
- },
- {
- name: "status equals CANCELED",
- filter: `status == "CANCELED"`,
- want: &store.FindPlanCheckRunMessage{
- Status: &[]store.PlanCheckRunStatus{store.PlanCheckRunStatusCanceled},
- },
- },
- {
- name: "status in list",
- filter: `status in ["DONE", "FAILED"]`,
- want: &store.FindPlanCheckRunMessage{
- Status: &[]store.PlanCheckRunStatus{
- store.PlanCheckRunStatusDone,
- store.PlanCheckRunStatusFailed,
- },
- },
- },
- {
- name: "result_status equals SUCCESS",
- filter: `result_status == "SUCCESS"`,
- want: &store.FindPlanCheckRunMessage{
- ResultStatus: &[]storepb.Advice_Status{
- storepb.Advice_SUCCESS,
- },
- },
- },
- {
- name: "result_status equals ERROR",
- filter: `result_status == "ERROR"`,
- want: &store.FindPlanCheckRunMessage{
- ResultStatus: &[]storepb.Advice_Status{
- storepb.Advice_ERROR,
- },
- },
- },
- {
- name: "result_status equals WARNING",
- filter: `result_status == "WARNING"`,
- want: &store.FindPlanCheckRunMessage{
- ResultStatus: &[]storepb.Advice_Status{
- storepb.Advice_WARNING,
- },
- },
- },
- {
- name: "result_status in list",
- filter: `result_status in ["SUCCESS", "WARNING"]`,
- want: &store.FindPlanCheckRunMessage{
- ResultStatus: &[]storepb.Advice_Status{
- storepb.Advice_SUCCESS,
- storepb.Advice_WARNING,
- },
- },
- },
- {
- name: "combined status and result_status",
- filter: `status == "DONE" && result_status == "SUCCESS"`,
- want: &store.FindPlanCheckRunMessage{
- Status: &[]store.PlanCheckRunStatus{store.PlanCheckRunStatusDone},
- ResultStatus: &[]storepb.Advice_Status{
- storepb.Advice_SUCCESS,
- },
- },
- },
- {
- name: "combined status in list and result_status",
- filter: `status in ["DONE", "FAILED"] && result_status == "ERROR"`,
- want: &store.FindPlanCheckRunMessage{
- Status: &[]store.PlanCheckRunStatus{
- store.PlanCheckRunStatusDone,
- store.PlanCheckRunStatusFailed,
- },
- ResultStatus: &[]storepb.Advice_Status{
- storepb.Advice_ERROR,
- },
- },
- },
- {
- name: "invalid status value",
- filter: `status == "INVALID_STATUS"`,
- wantErr: true,
- errContains: "invalid status value",
- },
- {
- name: "invalid result_status value",
- filter: `result_status == "INVALID_RESULT_STATUS"`,
- wantErr: true,
- errContains: "invalid result_status value",
- },
- {
- name: "non-string status value",
- filter: `status == 123`,
- wantErr: true,
- errContains: "status value must be a string",
- },
- {
- name: "non-string result_status value",
- filter: `result_status == 123`,
- wantErr: true,
- errContains: "result_status value must be a string",
- },
- {
- name: "empty status list",
- filter: `status in []`,
- wantErr: true,
- errContains: "empty list value for filter",
- },
- {
- name: "empty result_status list",
- filter: `result_status in []`,
- wantErr: true,
- errContains: "empty list value for filter",
- },
- {
- name: "unsupported variable",
- filter: `unknown_field == "value"`,
- wantErr: true,
- errContains: "unsupported filter variable",
- },
- {
- name: "unsupported operator",
- filter: `status > "DONE"`,
- wantErr: true,
- errContains: "unsupported operator",
- },
- {
- name: "invalid CEL syntax",
- filter: `status == "DONE" &&`,
- wantErr: true,
- errContains: "failed to parse filter",
- },
- {
- name: "non-string in status list",
- filter: `status in ["DONE", 123]`,
- wantErr: true,
- errContains: "status value must be a string",
- },
- {
- name: "non-string in result_status list",
- filter: `result_status in ["SUCCESS", 123]`,
- wantErr: true,
- errContains: "result_status value must be a string",
- },
- }
-
- service := &PlanService{}
- a := require.New(t)
-
- for _, test := range tests {
- t.Run(test.name, func(*testing.T) {
- find := &store.FindPlanCheckRunMessage{}
- err := service.parsePlanCheckRunFilter(test.filter, find)
-
- if test.wantErr {
- a.Error(err, "expected error for test case: %s", test.name)
- if test.errContains != "" {
- a.Contains(err.Error(), test.errContains, "error message should contain expected text")
- }
- return
- }
-
- a.NoError(err, "unexpected error for test case: %s", test.name)
-
- // Compare Status slices
- if test.want.Status == nil {
- a.Nil(find.Status, "Status should be nil")
- } else {
- a.NotNil(find.Status, "Status should not be nil")
- a.ElementsMatch(*test.want.Status, *find.Status, "Status slices should match")
- }
-
- // Compare ResultStatus slices
- if test.want.ResultStatus == nil {
- a.Nil(find.ResultStatus, "ResultStatus should be nil")
- } else {
- a.NotNil(find.ResultStatus, "ResultStatus should not be nil")
- a.ElementsMatch(*test.want.ResultStatus, *find.ResultStatus, "ResultStatus slices should match")
- }
-
- // Compare other fields that should remain unchanged
- a.Equal(test.want.PlanUID, find.PlanUID, "PlanUID should match")
- a.Equal(test.want.UIDs, find.UIDs, "UIDs should match")
- })
- }
-}
diff --git a/backend/common/resource_name.go b/backend/common/resource_name.go
index 274e9980a7..e5d1927f1b 100644
--- a/backend/common/resource_name.go
+++ b/backend/common/resource_name.go
@@ -240,6 +240,21 @@ func GetProjectIDPlanIDPlanCheckRunID(name string) (string, int, int, error) {
return tokens[0], planID, planCheckRunID, nil
}
+// GetProjectIDPlanIDFromPlanCheckRun returns the project ID and plan ID from a plan check run singleton resource name.
+// Format: projects/{project}/plans/{plan}/planCheckRun
+func GetProjectIDPlanIDFromPlanCheckRun(name string) (string, int64, error) {
+ // Remove the trailing "/planCheckRun" suffix
+ if !strings.HasSuffix(name, "/planCheckRun") {
+ return "", 0, errors.Errorf("invalid plan check run name %q, expected suffix /planCheckRun", name)
+ }
+ planName := strings.TrimSuffix(name, "/planCheckRun")
+ projectID, planID, err := GetProjectIDPlanID(planName)
+ if err != nil {
+ return "", 0, err
+ }
+ return projectID, int64(planID), nil
+}
+
// GetProjectIDRolloutID returns the project ID and rollout ID from a resource name.
func GetProjectIDRolloutID(name string) (string, int, error) {
tokens, err := GetNameParentTokens(name, ProjectNamePrefix, RolloutPrefix)
@@ -562,8 +577,10 @@ func FormatPlan(projectID string, planUID int64) string {
return fmt.Sprintf("%s/%s%d", FormatProject(projectID), PlanPrefix, planUID)
}
-func FormatPlanCheckRun(projectID string, planUID, runUID int64) string {
- return fmt.Sprintf("%s/%s%d", FormatPlan(projectID, planUID), PlanCheckRunPrefix, runUID)
+// FormatPlanCheckRun formats a plan check run singleton resource name.
+// Format: projects/{project}/plans/{plan}/planCheckRun
+func FormatPlanCheckRun(projectID string, planUID int64) string {
+ return fmt.Sprintf("%s/planCheckRun", FormatPlan(projectID, planUID))
}
func FormatSpec(projectID string, planUID int64, specID string) string {
diff --git a/backend/component/iam/acl.yaml b/backend/component/iam/acl.yaml
index ab4bcafe20..3162771a3e 100644
--- a/backend/component/iam/acl.yaml
+++ b/backend/component/iam/acl.yaml
@@ -39,7 +39,7 @@ roles:
- bb.issues.get
- bb.issues.list
- bb.issues.update
- - bb.planCheckRuns.list
+ - bb.planCheckRuns.get
- bb.planCheckRuns.run
- bb.plans.create
- bb.plans.get
@@ -152,7 +152,7 @@ roles:
- bb.issues.get
- bb.issues.list
- bb.issues.update
- - bb.planCheckRuns.list
+ - bb.planCheckRuns.get
- bb.planCheckRuns.run
- bb.plans.create
- bb.plans.get
@@ -267,7 +267,7 @@ roles:
- bb.issues.get
- bb.issues.list
- bb.issues.update
- - bb.planCheckRuns.list
+ - bb.planCheckRuns.get
- bb.planCheckRuns.run
- bb.plans.create
- bb.plans.get
@@ -327,7 +327,7 @@ roles:
- bb.issues.get
- bb.issues.list
- bb.issues.update
- - bb.planCheckRuns.list
+ - bb.planCheckRuns.get
- bb.planCheckRuns.run
- bb.plans.create
- bb.plans.get
@@ -381,7 +381,7 @@ roles:
- bb.issueComments.update
- bb.issues.get
- bb.issues.list
- - bb.planCheckRuns.list
+ - bb.planCheckRuns.get
- bb.planCheckRuns.run
- bb.plans.get
- bb.plans.list
diff --git a/backend/component/iam/permission.go b/backend/component/iam/permission.go
index dabbfca86f..79b9a719b9 100644
--- a/backend/component/iam/permission.go
+++ b/backend/component/iam/permission.go
@@ -40,7 +40,7 @@ const (
PermissionIssuesGet Permission = "bb.issues.get"
PermissionIssuesList Permission = "bb.issues.list"
PermissionIssuesUpdate Permission = "bb.issues.update"
- PermissionPlanCheckRunsList Permission = "bb.planCheckRuns.list"
+ PermissionPlanCheckRunsGet Permission = "bb.planCheckRuns.get"
PermissionPlanCheckRunsRun Permission = "bb.planCheckRuns.run"
PermissionPlansCreate Permission = "bb.plans.create"
PermissionPlansGet Permission = "bb.plans.get"
@@ -157,7 +157,7 @@ var allPermissions = []Permission{
PermissionIssuesGet,
PermissionIssuesList,
PermissionIssuesUpdate,
- PermissionPlanCheckRunsList,
+ PermissionPlanCheckRunsGet,
PermissionPlanCheckRunsRun,
PermissionPlansCreate,
PermissionPlansGet,
diff --git a/backend/component/iam/permission.yaml b/backend/component/iam/permission.yaml
index 1d6ee82bff..9369f2580c 100644
--- a/backend/component/iam/permission.yaml
+++ b/backend/component/iam/permission.yaml
@@ -41,7 +41,7 @@ permissions:
- bb.issues.get
- bb.issues.list
- bb.issues.update
- - bb.planCheckRuns.list
+ - bb.planCheckRuns.get
- bb.planCheckRuns.run
- bb.plans.create
- bb.plans.get
diff --git a/backend/generated-go/v1/plan_service.pb.go b/backend/generated-go/v1/plan_service.pb.go
index 27f3c28cf9..5ba240072d 100644
--- a/backend/generated-go/v1/plan_service.pb.go
+++ b/backend/generated-go/v1/plan_service.pb.go
@@ -77,7 +77,7 @@ func (x PlanCheckRun_Status) Number() protoreflect.EnumNumber {
// Deprecated: Use PlanCheckRun_Status.Descriptor instead.
func (PlanCheckRun_Status) EnumDescriptor() ([]byte, []int) {
- return file_v1_plan_service_proto_rawDescGZIP(), []int{14, 0}
+ return file_v1_plan_service_proto_rawDescGZIP(), []int{13, 0}
}
type PlanCheckRun_Result_Type int32
@@ -129,7 +129,7 @@ func (x PlanCheckRun_Result_Type) Number() protoreflect.EnumNumber {
// 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}
+ return file_v1_plan_service_proto_rawDescGZIP(), []int{13, 0, 0}
}
type GetPlanRequest struct {
@@ -725,44 +725,29 @@ func (x *Plan) GetPlanCheckRunStatusCount() map[string]int32 {
return nil
}
-type ListPlanCheckRunsRequest struct {
+type GetPlanCheckRunRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
- // The parent, which owns this collection of plan check runs.
- // Format: projects/{project}/plans/{plan}
- Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
- // If set to true, only the latest plan check run will be returned.
- LatestOnly bool `protobuf:"varint,2,opt,name=latest_only,json=latestOnly,proto3" json:"latest_only,omitempty"`
- // Filter is used to filter plan check runs returned in the list.
- // The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
- //
- // Supported filters:
- // - status: the plan check run status, support "==" and "in" operator, check the Status enum in the PlanCheckRun message for the values.
- // - result_status: the plan check run result status, support "==" and "in" operator, check the Result.Status enum in the PlanCheckRun message for the values.
- //
- // For example:
- // status in ["DONE", "FAILED"]
- // status == "RUNNING"
- // result_status in ["SUCCESS", "ERROR"]
- // result_status == "WARNING"
- Filter string `protobuf:"bytes,3,opt,name=filter,proto3" json:"filter,omitempty"`
+ // The name of the plan check run to retrieve.
+ // Format: projects/{project}/plans/{plan}/planCheckRun
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
-func (x *ListPlanCheckRunsRequest) Reset() {
- *x = ListPlanCheckRunsRequest{}
+func (x *GetPlanCheckRunRequest) Reset() {
+ *x = GetPlanCheckRunRequest{}
mi := &file_v1_plan_service_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
-func (x *ListPlanCheckRunsRequest) String() string {
+func (x *GetPlanCheckRunRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
-func (*ListPlanCheckRunsRequest) ProtoMessage() {}
+func (*GetPlanCheckRunRequest) ProtoMessage() {}
-func (x *ListPlanCheckRunsRequest) ProtoReflect() protoreflect.Message {
+func (x *GetPlanCheckRunRequest) ProtoReflect() protoreflect.Message {
mi := &file_v1_plan_service_proto_msgTypes[8]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -774,77 +759,18 @@ func (x *ListPlanCheckRunsRequest) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
-// Deprecated: Use ListPlanCheckRunsRequest.ProtoReflect.Descriptor instead.
-func (*ListPlanCheckRunsRequest) Descriptor() ([]byte, []int) {
+// Deprecated: Use GetPlanCheckRunRequest.ProtoReflect.Descriptor instead.
+func (*GetPlanCheckRunRequest) Descriptor() ([]byte, []int) {
return file_v1_plan_service_proto_rawDescGZIP(), []int{8}
}
-func (x *ListPlanCheckRunsRequest) GetParent() string {
- if x != nil {
- return x.Parent
- }
- return ""
-}
-
-func (x *ListPlanCheckRunsRequest) GetLatestOnly() bool {
+func (x *GetPlanCheckRunRequest) GetName() string {
if x != nil {
- return x.LatestOnly
- }
- return false
-}
-
-func (x *ListPlanCheckRunsRequest) GetFilter() string {
- if x != nil {
- return x.Filter
+ return x.Name
}
return ""
}
-type ListPlanCheckRunsResponse struct {
- state protoimpl.MessageState `protogen:"open.v1"`
- // The plan check runs from the specified request.
- PlanCheckRuns []*PlanCheckRun `protobuf:"bytes,1,rep,name=plan_check_runs,json=planCheckRuns,proto3" json:"plan_check_runs,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
-}
-
-func (x *ListPlanCheckRunsResponse) Reset() {
- *x = ListPlanCheckRunsResponse{}
- mi := &file_v1_plan_service_proto_msgTypes[9]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
-}
-
-func (x *ListPlanCheckRunsResponse) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*ListPlanCheckRunsResponse) ProtoMessage() {}
-
-func (x *ListPlanCheckRunsResponse) ProtoReflect() protoreflect.Message {
- mi := &file_v1_plan_service_proto_msgTypes[9]
- if x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use ListPlanCheckRunsResponse.ProtoReflect.Descriptor instead.
-func (*ListPlanCheckRunsResponse) Descriptor() ([]byte, []int) {
- return file_v1_plan_service_proto_rawDescGZIP(), []int{9}
-}
-
-func (x *ListPlanCheckRunsResponse) GetPlanCheckRuns() []*PlanCheckRun {
- if x != nil {
- return x.PlanCheckRuns
- }
- return nil
-}
-
type RunPlanChecksRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
// The plan to run plan checks.
@@ -860,7 +786,7 @@ type RunPlanChecksRequest struct {
func (x *RunPlanChecksRequest) Reset() {
*x = RunPlanChecksRequest{}
- mi := &file_v1_plan_service_proto_msgTypes[10]
+ mi := &file_v1_plan_service_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -872,7 +798,7 @@ func (x *RunPlanChecksRequest) String() string {
func (*RunPlanChecksRequest) ProtoMessage() {}
func (x *RunPlanChecksRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_plan_service_proto_msgTypes[10]
+ mi := &file_v1_plan_service_proto_msgTypes[9]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -885,7 +811,7 @@ func (x *RunPlanChecksRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use RunPlanChecksRequest.ProtoReflect.Descriptor instead.
func (*RunPlanChecksRequest) Descriptor() ([]byte, []int) {
- return file_v1_plan_service_proto_rawDescGZIP(), []int{10}
+ return file_v1_plan_service_proto_rawDescGZIP(), []int{9}
}
func (x *RunPlanChecksRequest) GetName() string {
@@ -910,7 +836,7 @@ type RunPlanChecksResponse struct {
func (x *RunPlanChecksResponse) Reset() {
*x = RunPlanChecksResponse{}
- mi := &file_v1_plan_service_proto_msgTypes[11]
+ mi := &file_v1_plan_service_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -922,7 +848,7 @@ func (x *RunPlanChecksResponse) String() string {
func (*RunPlanChecksResponse) ProtoMessage() {}
func (x *RunPlanChecksResponse) ProtoReflect() protoreflect.Message {
- mi := &file_v1_plan_service_proto_msgTypes[11]
+ mi := &file_v1_plan_service_proto_msgTypes[10]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -935,37 +861,33 @@ func (x *RunPlanChecksResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use RunPlanChecksResponse.ProtoReflect.Descriptor instead.
func (*RunPlanChecksResponse) Descriptor() ([]byte, []int) {
- return file_v1_plan_service_proto_rawDescGZIP(), []int{11}
+ return file_v1_plan_service_proto_rawDescGZIP(), []int{10}
}
-type BatchCancelPlanCheckRunsRequest struct {
+type CancelPlanCheckRunRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
- // The name of the parent of the planChecks.
- // Format: projects/{project}/plans/{plan}
- Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
- // TODO(d): update this API.
- // The planCheckRuns to cancel.
- // Format: projects/{project}/plans/{plan}/planCheckRuns/{planCheckRun}
- PlanCheckRuns []string `protobuf:"bytes,2,rep,name=plan_check_runs,json=planCheckRuns,proto3" json:"plan_check_runs,omitempty"`
+ // The name of the plan check run to cancel.
+ // Format: projects/{project}/plans/{plan}/planCheckRun
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
-func (x *BatchCancelPlanCheckRunsRequest) Reset() {
- *x = BatchCancelPlanCheckRunsRequest{}
- mi := &file_v1_plan_service_proto_msgTypes[12]
+func (x *CancelPlanCheckRunRequest) Reset() {
+ *x = CancelPlanCheckRunRequest{}
+ mi := &file_v1_plan_service_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
-func (x *BatchCancelPlanCheckRunsRequest) String() string {
+func (x *CancelPlanCheckRunRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
-func (*BatchCancelPlanCheckRunsRequest) ProtoMessage() {}
+func (*CancelPlanCheckRunRequest) ProtoMessage() {}
-func (x *BatchCancelPlanCheckRunsRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_plan_service_proto_msgTypes[12]
+func (x *CancelPlanCheckRunRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_plan_service_proto_msgTypes[11]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -976,46 +898,39 @@ func (x *BatchCancelPlanCheckRunsRequest) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
-// Deprecated: Use BatchCancelPlanCheckRunsRequest.ProtoReflect.Descriptor instead.
-func (*BatchCancelPlanCheckRunsRequest) Descriptor() ([]byte, []int) {
- return file_v1_plan_service_proto_rawDescGZIP(), []int{12}
+// Deprecated: Use CancelPlanCheckRunRequest.ProtoReflect.Descriptor instead.
+func (*CancelPlanCheckRunRequest) Descriptor() ([]byte, []int) {
+ return file_v1_plan_service_proto_rawDescGZIP(), []int{11}
}
-func (x *BatchCancelPlanCheckRunsRequest) GetParent() string {
+func (x *CancelPlanCheckRunRequest) GetName() string {
if x != nil {
- return x.Parent
+ return x.Name
}
return ""
}
-func (x *BatchCancelPlanCheckRunsRequest) GetPlanCheckRuns() []string {
- if x != nil {
- return x.PlanCheckRuns
- }
- return nil
-}
-
-type BatchCancelPlanCheckRunsResponse struct {
+type CancelPlanCheckRunResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
-func (x *BatchCancelPlanCheckRunsResponse) Reset() {
- *x = BatchCancelPlanCheckRunsResponse{}
- mi := &file_v1_plan_service_proto_msgTypes[13]
+func (x *CancelPlanCheckRunResponse) Reset() {
+ *x = CancelPlanCheckRunResponse{}
+ mi := &file_v1_plan_service_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
-func (x *BatchCancelPlanCheckRunsResponse) String() string {
+func (x *CancelPlanCheckRunResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
-func (*BatchCancelPlanCheckRunsResponse) ProtoMessage() {}
+func (*CancelPlanCheckRunResponse) ProtoMessage() {}
-func (x *BatchCancelPlanCheckRunsResponse) ProtoReflect() protoreflect.Message {
- mi := &file_v1_plan_service_proto_msgTypes[13]
+func (x *CancelPlanCheckRunResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_plan_service_proto_msgTypes[12]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1026,14 +941,14 @@ func (x *BatchCancelPlanCheckRunsResponse) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
-// Deprecated: Use BatchCancelPlanCheckRunsResponse.ProtoReflect.Descriptor instead.
-func (*BatchCancelPlanCheckRunsResponse) Descriptor() ([]byte, []int) {
- return file_v1_plan_service_proto_rawDescGZIP(), []int{13}
+// Deprecated: Use CancelPlanCheckRunResponse.ProtoReflect.Descriptor instead.
+func (*CancelPlanCheckRunResponse) Descriptor() ([]byte, []int) {
+ return file_v1_plan_service_proto_rawDescGZIP(), []int{12}
}
type PlanCheckRun struct {
state protoimpl.MessageState `protogen:"open.v1"`
- // Format: projects/{project}/plans/{plan}/planCheckRuns/{planCheckRun}
+ // Format: projects/{project}/plans/{plan}/planCheckRun
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"`
@@ -1046,7 +961,7 @@ type PlanCheckRun struct {
func (x *PlanCheckRun) Reset() {
*x = PlanCheckRun{}
- mi := &file_v1_plan_service_proto_msgTypes[14]
+ mi := &file_v1_plan_service_proto_msgTypes[13]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1058,7 +973,7 @@ func (x *PlanCheckRun) String() string {
func (*PlanCheckRun) ProtoMessage() {}
func (x *PlanCheckRun) ProtoReflect() protoreflect.Message {
- mi := &file_v1_plan_service_proto_msgTypes[14]
+ mi := &file_v1_plan_service_proto_msgTypes[13]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1071,7 +986,7 @@ func (x *PlanCheckRun) ProtoReflect() protoreflect.Message {
// Deprecated: Use PlanCheckRun.ProtoReflect.Descriptor instead.
func (*PlanCheckRun) Descriptor() ([]byte, []int) {
- return file_v1_plan_service_proto_rawDescGZIP(), []int{14}
+ return file_v1_plan_service_proto_rawDescGZIP(), []int{13}
}
func (x *PlanCheckRun) GetName() string {
@@ -1125,7 +1040,7 @@ type Plan_Spec struct {
func (x *Plan_Spec) Reset() {
*x = Plan_Spec{}
- mi := &file_v1_plan_service_proto_msgTypes[15]
+ mi := &file_v1_plan_service_proto_msgTypes[14]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1137,7 +1052,7 @@ func (x *Plan_Spec) String() string {
func (*Plan_Spec) ProtoMessage() {}
func (x *Plan_Spec) ProtoReflect() protoreflect.Message {
- mi := &file_v1_plan_service_proto_msgTypes[15]
+ mi := &file_v1_plan_service_proto_msgTypes[14]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1243,7 +1158,7 @@ type Plan_CreateDatabaseConfig struct {
func (x *Plan_CreateDatabaseConfig) Reset() {
*x = Plan_CreateDatabaseConfig{}
- mi := &file_v1_plan_service_proto_msgTypes[17]
+ mi := &file_v1_plan_service_proto_msgTypes[16]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1255,7 +1170,7 @@ func (x *Plan_CreateDatabaseConfig) String() string {
func (*Plan_CreateDatabaseConfig) ProtoMessage() {}
func (x *Plan_CreateDatabaseConfig) ProtoReflect() protoreflect.Message {
- mi := &file_v1_plan_service_proto_msgTypes[17]
+ mi := &file_v1_plan_service_proto_msgTypes[16]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1352,7 +1267,7 @@ type Plan_ChangeDatabaseConfig struct {
func (x *Plan_ChangeDatabaseConfig) Reset() {
*x = Plan_ChangeDatabaseConfig{}
- mi := &file_v1_plan_service_proto_msgTypes[18]
+ mi := &file_v1_plan_service_proto_msgTypes[17]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1364,7 +1279,7 @@ func (x *Plan_ChangeDatabaseConfig) String() string {
func (*Plan_ChangeDatabaseConfig) ProtoMessage() {}
func (x *Plan_ChangeDatabaseConfig) ProtoReflect() protoreflect.Message {
- mi := &file_v1_plan_service_proto_msgTypes[18]
+ mi := &file_v1_plan_service_proto_msgTypes[17]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1449,7 +1364,7 @@ type Plan_ExportDataConfig struct {
func (x *Plan_ExportDataConfig) Reset() {
*x = Plan_ExportDataConfig{}
- mi := &file_v1_plan_service_proto_msgTypes[19]
+ mi := &file_v1_plan_service_proto_msgTypes[18]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1461,7 +1376,7 @@ func (x *Plan_ExportDataConfig) String() string {
func (*Plan_ExportDataConfig) ProtoMessage() {}
func (x *Plan_ExportDataConfig) ProtoReflect() protoreflect.Message {
- mi := &file_v1_plan_service_proto_msgTypes[19]
+ mi := &file_v1_plan_service_proto_msgTypes[18]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1526,7 +1441,7 @@ type PlanCheckRun_Result struct {
func (x *PlanCheckRun_Result) Reset() {
*x = PlanCheckRun_Result{}
- mi := &file_v1_plan_service_proto_msgTypes[21]
+ mi := &file_v1_plan_service_proto_msgTypes[20]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1538,7 +1453,7 @@ func (x *PlanCheckRun_Result) String() string {
func (*PlanCheckRun_Result) ProtoMessage() {}
func (x *PlanCheckRun_Result) ProtoReflect() protoreflect.Message {
- mi := &file_v1_plan_service_proto_msgTypes[21]
+ mi := &file_v1_plan_service_proto_msgTypes[20]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1551,7 +1466,7 @@ func (x *PlanCheckRun_Result) ProtoReflect() protoreflect.Message {
// Deprecated: Use PlanCheckRun_Result.ProtoReflect.Descriptor instead.
func (*PlanCheckRun_Result) Descriptor() ([]byte, []int) {
- return file_v1_plan_service_proto_rawDescGZIP(), []int{14, 0}
+ return file_v1_plan_service_proto_rawDescGZIP(), []int{13, 0}
}
func (x *PlanCheckRun_Result) GetStatus() Advice_Level {
@@ -1648,7 +1563,7 @@ type PlanCheckRun_Result_SqlSummaryReport struct {
func (x *PlanCheckRun_Result_SqlSummaryReport) Reset() {
*x = PlanCheckRun_Result_SqlSummaryReport{}
- mi := &file_v1_plan_service_proto_msgTypes[22]
+ mi := &file_v1_plan_service_proto_msgTypes[21]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1660,7 +1575,7 @@ func (x *PlanCheckRun_Result_SqlSummaryReport) String() string {
func (*PlanCheckRun_Result_SqlSummaryReport) ProtoMessage() {}
func (x *PlanCheckRun_Result_SqlSummaryReport) ProtoReflect() protoreflect.Message {
- mi := &file_v1_plan_service_proto_msgTypes[22]
+ mi := &file_v1_plan_service_proto_msgTypes[21]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1673,7 +1588,7 @@ func (x *PlanCheckRun_Result_SqlSummaryReport) ProtoReflect() protoreflect.Messa
// Deprecated: Use PlanCheckRun_Result_SqlSummaryReport.ProtoReflect.Descriptor instead.
func (*PlanCheckRun_Result_SqlSummaryReport) Descriptor() ([]byte, []int) {
- return file_v1_plan_service_proto_rawDescGZIP(), []int{14, 0, 0}
+ return file_v1_plan_service_proto_rawDescGZIP(), []int{13, 0, 0}
}
func (x *PlanCheckRun_Result_SqlSummaryReport) GetStatementTypes() []string {
@@ -1701,7 +1616,7 @@ type PlanCheckRun_Result_SqlReviewReport struct {
func (x *PlanCheckRun_Result_SqlReviewReport) Reset() {
*x = PlanCheckRun_Result_SqlReviewReport{}
- mi := &file_v1_plan_service_proto_msgTypes[23]
+ mi := &file_v1_plan_service_proto_msgTypes[22]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1713,7 +1628,7 @@ func (x *PlanCheckRun_Result_SqlReviewReport) String() string {
func (*PlanCheckRun_Result_SqlReviewReport) ProtoMessage() {}
func (x *PlanCheckRun_Result_SqlReviewReport) ProtoReflect() protoreflect.Message {
- mi := &file_v1_plan_service_proto_msgTypes[23]
+ mi := &file_v1_plan_service_proto_msgTypes[22]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1726,7 +1641,7 @@ func (x *PlanCheckRun_Result_SqlReviewReport) ProtoReflect() protoreflect.Messag
// Deprecated: Use PlanCheckRun_Result_SqlReviewReport.ProtoReflect.Descriptor instead.
func (*PlanCheckRun_Result_SqlReviewReport) Descriptor() ([]byte, []int) {
- return file_v1_plan_service_proto_rawDescGZIP(), []int{14, 0, 1}
+ return file_v1_plan_service_proto_rawDescGZIP(), []int{13, 0, 1}
}
func (x *PlanCheckRun_Result_SqlReviewReport) GetStartPosition() *Position {
@@ -1830,27 +1745,21 @@ const file_v1_plan_service_proto_rawDesc = "" +
"\x06format\x18\x03 \x01(\x0e2\x19.bytebase.v1.ExportFormatR\x06format\x12\x1f\n" +
"\bpassword\x18\x04 \x01(\tH\x00R\bpassword\x88\x01\x01B\v\n" +
"\t_password:7\xeaA4\n" +
- "\x11bytebase.com/Plan\x12\x1fprojects/{project}/plans/{plan}\"\x86\x01\n" +
- "\x18ListPlanCheckRunsRequest\x121\n" +
- "\x06parent\x18\x01 \x01(\tB\x19\xe0A\x02\xfaA\x13\n" +
- "\x11bytebase.com/PlanR\x06parent\x12\x1f\n" +
- "\vlatest_only\x18\x02 \x01(\bR\n" +
- "latestOnly\x12\x16\n" +
- "\x06filter\x18\x03 \x01(\tR\x06filter\"^\n" +
- "\x19ListPlanCheckRunsResponse\x12A\n" +
- "\x0fplan_check_runs\x18\x01 \x03(\v2\x19.bytebase.v1.PlanCheckRunR\rplanCheckRuns\"o\n" +
+ "\x11bytebase.com/Plan\x12\x1fprojects/{project}/plans/{plan}\"O\n" +
+ "\x16GetPlanCheckRunRequest\x125\n" +
+ "\x04name\x18\x01 \x01(\tB!\xe0A\x02\xfaA\x1b\n" +
+ "\x19bytebase.com/PlanCheckRunR\x04name\"o\n" +
"\x14RunPlanChecksRequest\x12-\n" +
"\x04name\x18\x01 \x01(\tB\x19\xe0A\x02\xfaA\x13\n" +
"\x11bytebase.com/PlanR\x04name\x12\x1c\n" +
"\aspec_id\x18\x02 \x01(\tH\x00R\x06specId\x88\x01\x01B\n" +
"\n" +
"\b_spec_id\"\x17\n" +
- "\x15RunPlanChecksResponse\"|\n" +
- "\x1fBatchCancelPlanCheckRunsRequest\x121\n" +
- "\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\"\xb5\b\n" +
+ "\x15RunPlanChecksResponse\"R\n" +
+ "\x19CancelPlanCheckRunRequest\x125\n" +
+ "\x04name\x18\x01 \x01(\tB!\xe0A\x02\xfaA\x1b\n" +
+ "\x19bytebase.com/PlanCheckRunR\x04name\"\x1c\n" +
+ "\x1aCancelPlanCheckRunResponse\"\x83\t\n" +
"\fPlanCheckRun\x12\x12\n" +
"\x04name\x18\x01 \x01(\tR\x04name\x128\n" +
"\x06status\x18\x03 \x01(\x0e2 .bytebase.v1.PlanCheckRun.StatusR\x06status\x12:\n" +
@@ -1886,7 +1795,8 @@ const file_v1_plan_service_proto_rawDesc = "" +
"\x04DONE\x10\x02\x12\n" +
"\n" +
"\x06FAILED\x10\x03\x12\f\n" +
- "\bCANCELED\x10\x042\xd2\n" +
+ "\bCANCELED\x10\x04:L\xeaAI\n" +
+ "\x19bytebase.com/PlanCheckRun\x12,projects/{project}/plans/{plan}/planCheckRun2\x9f\n" +
"\n" +
"\vPlanService\x12{\n" +
"\aGetPlan\x12\x1b.bytebase.v1.GetPlanRequest\x1a\x11.bytebase.v1.Plan\"@\xdaA\x04name\x8a\xea0\fbb.plans.get\x90\xea0\x01\x82\xd3\xe4\x93\x02\x1f\x12\x1d/v1/{name=projects/*/plans/*}\x12\x8f\x01\n" +
@@ -1895,10 +1805,10 @@ const file_v1_plan_service_proto_rawDesc = "" +
"\n" +
"CreatePlan\x12\x1e.bytebase.v1.CreatePlanRequest\x1a\x11.bytebase.v1.Plan\"T\xdaA\vparent,plan\x8a\xea0\x0fbb.plans.create\x90\xea0\x01\x98\xea0\x01\x82\xd3\xe4\x93\x02%:\x04plan\"\x1d/v1/{parent=projects/*}/plans\x12\x9f\x01\n" +
"\n" +
- "UpdatePlan\x12\x1e.bytebase.v1.UpdatePlanRequest\x1a\x11.bytebase.v1.Plan\"^\xdaA\x10plan,update_mask\x8a\xea0\x0fbb.plans.update\x90\xea0\x02\x98\xea0\x01\x82\xd3\xe4\x93\x02*:\x04plan2\"/v1/{plan.name=projects/*/plans/*}\x12\xbf\x01\n" +
- "\x11ListPlanCheckRuns\x12%.bytebase.v1.ListPlanCheckRunsRequest\x1a&.bytebase.v1.ListPlanCheckRunsResponse\"[\xdaA\x06parent\x8a\xea0\x15bb.planCheckRuns.list\x90\xea0\x01\x82\xd3\xe4\x93\x02/\x12-/v1/{parent=projects/*/plans/*}/planCheckRuns\x12\xb1\x01\n" +
- "\rRunPlanChecks\x12!.bytebase.v1.RunPlanChecksRequest\x1a\".bytebase.v1.RunPlanChecksResponse\"Y\xdaA\x04name\x8a\xea0\x14bb.planCheckRuns.run\x90\xea0\x01\x82\xd3\xe4\x93\x020:\x01*\"+/v1/{name=projects/*/plans/*}:runPlanChecks\x12\xe2\x01\n" +
- "\x18BatchCancelPlanCheckRuns\x12,.bytebase.v1.BatchCancelPlanCheckRunsRequest\x1a-.bytebase.v1.BatchCancelPlanCheckRunsResponse\"i\xdaA\x06parent\x8a\xea0\x14bb.planCheckRuns.run\x90\xea0\x01\x82\xd3\xe4\x93\x02>:\x01*\"9/v1/{parent=projects/*/plans/*}/planCheckRuns:batchCancelB\xa6\x01\n" +
+ "UpdatePlan\x12\x1e.bytebase.v1.UpdatePlanRequest\x1a\x11.bytebase.v1.Plan\"^\xdaA\x10plan,update_mask\x8a\xea0\x0fbb.plans.update\x90\xea0\x02\x98\xea0\x01\x82\xd3\xe4\x93\x02*:\x04plan2\"/v1/{plan.name=projects/*/plans/*}\x12\xa8\x01\n" +
+ "\x0fGetPlanCheckRun\x12#.bytebase.v1.GetPlanCheckRunRequest\x1a\x19.bytebase.v1.PlanCheckRun\"U\xdaA\x04name\x8a\xea0\x14bb.planCheckRuns.get\x90\xea0\x01\x82\xd3\xe4\x93\x02,\x12*/v1/{name=projects/*/plans/*/planCheckRun}\x12\xb1\x01\n" +
+ "\rRunPlanChecks\x12!.bytebase.v1.RunPlanChecksRequest\x1a\".bytebase.v1.RunPlanChecksResponse\"Y\xdaA\x04name\x8a\xea0\x14bb.planCheckRuns.run\x90\xea0\x01\x82\xd3\xe4\x93\x020:\x01*\"+/v1/{name=projects/*/plans/*}:runPlanChecks\x12\xc6\x01\n" +
+ "\x12CancelPlanCheckRun\x12&.bytebase.v1.CancelPlanCheckRunRequest\x1a'.bytebase.v1.CancelPlanCheckRunResponse\"_\xdaA\x04name\x8a\xea0\x14bb.planCheckRuns.run\x90\xea0\x01\x82\xd3\xe4\x93\x026:\x01*\"1/v1/{name=projects/*/plans/*/planCheckRun}:cancelB\xa6\x01\n" +
"\x0fcom.bytebase.v1B\x10PlanServiceProtoP\x01Z4github.com/bytebase/bytebase/backend/generated-go/v1\xa2\x02\x03BXX\xaa\x02\vBytebase.V1\xca\x02\vBytebase\\V1\xe2\x02\x17Bytebase\\V1\\GPBMetadata\xea\x02\fBytebase::V1b\x06proto3"
var (
@@ -1914,7 +1824,7 @@ 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_msgTypes = make([]protoimpl.MessageInfo, 23)
var file_v1_plan_service_proto_goTypes = []any{
(PlanCheckRun_Status)(0), // 0: bytebase.v1.PlanCheckRun.Status
(PlanCheckRun_Result_Type)(0), // 1: bytebase.v1.PlanCheckRun.Result.Type
@@ -1926,78 +1836,76 @@ var file_v1_plan_service_proto_goTypes = []any{
(*CreatePlanRequest)(nil), // 7: bytebase.v1.CreatePlanRequest
(*UpdatePlanRequest)(nil), // 8: bytebase.v1.UpdatePlanRequest
(*Plan)(nil), // 9: bytebase.v1.Plan
- (*ListPlanCheckRunsRequest)(nil), // 10: bytebase.v1.ListPlanCheckRunsRequest
- (*ListPlanCheckRunsResponse)(nil), // 11: bytebase.v1.ListPlanCheckRunsResponse
- (*RunPlanChecksRequest)(nil), // 12: bytebase.v1.RunPlanChecksRequest
- (*RunPlanChecksResponse)(nil), // 13: bytebase.v1.RunPlanChecksResponse
- (*BatchCancelPlanCheckRunsRequest)(nil), // 14: bytebase.v1.BatchCancelPlanCheckRunsRequest
- (*BatchCancelPlanCheckRunsResponse)(nil), // 15: bytebase.v1.BatchCancelPlanCheckRunsResponse
- (*PlanCheckRun)(nil), // 16: bytebase.v1.PlanCheckRun
- (*Plan_Spec)(nil), // 17: bytebase.v1.Plan.Spec
- nil, // 18: bytebase.v1.Plan.PlanCheckRunStatusCountEntry
- (*Plan_CreateDatabaseConfig)(nil), // 19: bytebase.v1.Plan.CreateDatabaseConfig
- (*Plan_ChangeDatabaseConfig)(nil), // 20: bytebase.v1.Plan.ChangeDatabaseConfig
- (*Plan_ExportDataConfig)(nil), // 21: bytebase.v1.Plan.ExportDataConfig
- nil, // 22: bytebase.v1.Plan.ChangeDatabaseConfig.GhostFlagsEntry
- (*PlanCheckRun_Result)(nil), // 23: bytebase.v1.PlanCheckRun.Result
- (*PlanCheckRun_Result_SqlSummaryReport)(nil), // 24: bytebase.v1.PlanCheckRun.Result.SqlSummaryReport
- (*PlanCheckRun_Result_SqlReviewReport)(nil), // 25: bytebase.v1.PlanCheckRun.Result.SqlReviewReport
- (*fieldmaskpb.FieldMask)(nil), // 26: google.protobuf.FieldMask
- (State)(0), // 27: bytebase.v1.State
- (*timestamppb.Timestamp)(nil), // 28: google.protobuf.Timestamp
- (DatabaseChangeType)(0), // 29: bytebase.v1.DatabaseChangeType
- (ExportFormat)(0), // 30: bytebase.v1.ExportFormat
- (Advice_Level)(0), // 31: bytebase.v1.Advice.Level
- (*Position)(nil), // 32: bytebase.v1.Position
+ (*GetPlanCheckRunRequest)(nil), // 10: bytebase.v1.GetPlanCheckRunRequest
+ (*RunPlanChecksRequest)(nil), // 11: bytebase.v1.RunPlanChecksRequest
+ (*RunPlanChecksResponse)(nil), // 12: bytebase.v1.RunPlanChecksResponse
+ (*CancelPlanCheckRunRequest)(nil), // 13: bytebase.v1.CancelPlanCheckRunRequest
+ (*CancelPlanCheckRunResponse)(nil), // 14: bytebase.v1.CancelPlanCheckRunResponse
+ (*PlanCheckRun)(nil), // 15: bytebase.v1.PlanCheckRun
+ (*Plan_Spec)(nil), // 16: bytebase.v1.Plan.Spec
+ nil, // 17: bytebase.v1.Plan.PlanCheckRunStatusCountEntry
+ (*Plan_CreateDatabaseConfig)(nil), // 18: bytebase.v1.Plan.CreateDatabaseConfig
+ (*Plan_ChangeDatabaseConfig)(nil), // 19: bytebase.v1.Plan.ChangeDatabaseConfig
+ (*Plan_ExportDataConfig)(nil), // 20: bytebase.v1.Plan.ExportDataConfig
+ nil, // 21: bytebase.v1.Plan.ChangeDatabaseConfig.GhostFlagsEntry
+ (*PlanCheckRun_Result)(nil), // 22: bytebase.v1.PlanCheckRun.Result
+ (*PlanCheckRun_Result_SqlSummaryReport)(nil), // 23: bytebase.v1.PlanCheckRun.Result.SqlSummaryReport
+ (*PlanCheckRun_Result_SqlReviewReport)(nil), // 24: bytebase.v1.PlanCheckRun.Result.SqlReviewReport
+ (*fieldmaskpb.FieldMask)(nil), // 25: google.protobuf.FieldMask
+ (State)(0), // 26: bytebase.v1.State
+ (*timestamppb.Timestamp)(nil), // 27: google.protobuf.Timestamp
+ (DatabaseChangeType)(0), // 28: bytebase.v1.DatabaseChangeType
+ (ExportFormat)(0), // 29: bytebase.v1.ExportFormat
+ (Advice_Level)(0), // 30: bytebase.v1.Advice.Level
+ (*Position)(nil), // 31: bytebase.v1.Position
}
var file_v1_plan_service_proto_depIdxs = []int32{
9, // 0: bytebase.v1.ListPlansResponse.plans:type_name -> bytebase.v1.Plan
9, // 1: bytebase.v1.SearchPlansResponse.plans:type_name -> bytebase.v1.Plan
9, // 2: bytebase.v1.CreatePlanRequest.plan:type_name -> bytebase.v1.Plan
9, // 3: bytebase.v1.UpdatePlanRequest.plan:type_name -> bytebase.v1.Plan
- 26, // 4: bytebase.v1.UpdatePlanRequest.update_mask:type_name -> google.protobuf.FieldMask
- 27, // 5: bytebase.v1.Plan.state:type_name -> bytebase.v1.State
- 17, // 6: bytebase.v1.Plan.specs:type_name -> bytebase.v1.Plan.Spec
- 28, // 7: bytebase.v1.Plan.create_time:type_name -> google.protobuf.Timestamp
- 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.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
- 32, // 25: bytebase.v1.PlanCheckRun.Result.SqlReviewReport.end_position:type_name -> bytebase.v1.Position
- 2, // 26: bytebase.v1.PlanService.GetPlan:input_type -> bytebase.v1.GetPlanRequest
- 3, // 27: bytebase.v1.PlanService.ListPlans:input_type -> bytebase.v1.ListPlansRequest
- 5, // 28: bytebase.v1.PlanService.SearchPlans:input_type -> bytebase.v1.SearchPlansRequest
- 7, // 29: bytebase.v1.PlanService.CreatePlan:input_type -> bytebase.v1.CreatePlanRequest
- 8, // 30: bytebase.v1.PlanService.UpdatePlan:input_type -> bytebase.v1.UpdatePlanRequest
- 10, // 31: bytebase.v1.PlanService.ListPlanCheckRuns:input_type -> bytebase.v1.ListPlanCheckRunsRequest
- 12, // 32: bytebase.v1.PlanService.RunPlanChecks:input_type -> bytebase.v1.RunPlanChecksRequest
- 14, // 33: bytebase.v1.PlanService.BatchCancelPlanCheckRuns:input_type -> bytebase.v1.BatchCancelPlanCheckRunsRequest
- 9, // 34: bytebase.v1.PlanService.GetPlan:output_type -> bytebase.v1.Plan
- 4, // 35: bytebase.v1.PlanService.ListPlans:output_type -> bytebase.v1.ListPlansResponse
- 6, // 36: bytebase.v1.PlanService.SearchPlans:output_type -> bytebase.v1.SearchPlansResponse
- 9, // 37: bytebase.v1.PlanService.CreatePlan:output_type -> bytebase.v1.Plan
- 9, // 38: bytebase.v1.PlanService.UpdatePlan:output_type -> bytebase.v1.Plan
- 11, // 39: bytebase.v1.PlanService.ListPlanCheckRuns:output_type -> bytebase.v1.ListPlanCheckRunsResponse
- 13, // 40: bytebase.v1.PlanService.RunPlanChecks:output_type -> bytebase.v1.RunPlanChecksResponse
- 15, // 41: bytebase.v1.PlanService.BatchCancelPlanCheckRuns:output_type -> bytebase.v1.BatchCancelPlanCheckRunsResponse
- 34, // [34:42] is the sub-list for method output_type
- 26, // [26:34] is the sub-list for method input_type
- 26, // [26:26] is the sub-list for extension type_name
- 26, // [26:26] is the sub-list for extension extendee
- 0, // [0:26] is the sub-list for field type_name
+ 25, // 4: bytebase.v1.UpdatePlanRequest.update_mask:type_name -> google.protobuf.FieldMask
+ 26, // 5: bytebase.v1.Plan.state:type_name -> bytebase.v1.State
+ 16, // 6: bytebase.v1.Plan.specs:type_name -> bytebase.v1.Plan.Spec
+ 27, // 7: bytebase.v1.Plan.create_time:type_name -> google.protobuf.Timestamp
+ 27, // 8: bytebase.v1.Plan.update_time:type_name -> google.protobuf.Timestamp
+ 17, // 9: bytebase.v1.Plan.plan_check_run_status_count:type_name -> bytebase.v1.Plan.PlanCheckRunStatusCountEntry
+ 0, // 10: bytebase.v1.PlanCheckRun.status:type_name -> bytebase.v1.PlanCheckRun.Status
+ 22, // 11: bytebase.v1.PlanCheckRun.results:type_name -> bytebase.v1.PlanCheckRun.Result
+ 27, // 12: bytebase.v1.PlanCheckRun.create_time:type_name -> google.protobuf.Timestamp
+ 18, // 13: bytebase.v1.Plan.Spec.create_database_config:type_name -> bytebase.v1.Plan.CreateDatabaseConfig
+ 19, // 14: bytebase.v1.Plan.Spec.change_database_config:type_name -> bytebase.v1.Plan.ChangeDatabaseConfig
+ 20, // 15: bytebase.v1.Plan.Spec.export_data_config:type_name -> bytebase.v1.Plan.ExportDataConfig
+ 28, // 16: bytebase.v1.Plan.ChangeDatabaseConfig.type:type_name -> bytebase.v1.DatabaseChangeType
+ 21, // 17: bytebase.v1.Plan.ChangeDatabaseConfig.ghost_flags:type_name -> bytebase.v1.Plan.ChangeDatabaseConfig.GhostFlagsEntry
+ 29, // 18: bytebase.v1.Plan.ExportDataConfig.format:type_name -> bytebase.v1.ExportFormat
+ 30, // 19: bytebase.v1.PlanCheckRun.Result.status:type_name -> bytebase.v1.Advice.Level
+ 1, // 20: bytebase.v1.PlanCheckRun.Result.type:type_name -> bytebase.v1.PlanCheckRun.Result.Type
+ 23, // 21: bytebase.v1.PlanCheckRun.Result.sql_summary_report:type_name -> bytebase.v1.PlanCheckRun.Result.SqlSummaryReport
+ 24, // 22: bytebase.v1.PlanCheckRun.Result.sql_review_report:type_name -> bytebase.v1.PlanCheckRun.Result.SqlReviewReport
+ 31, // 23: bytebase.v1.PlanCheckRun.Result.SqlReviewReport.start_position:type_name -> bytebase.v1.Position
+ 31, // 24: bytebase.v1.PlanCheckRun.Result.SqlReviewReport.end_position:type_name -> bytebase.v1.Position
+ 2, // 25: bytebase.v1.PlanService.GetPlan:input_type -> bytebase.v1.GetPlanRequest
+ 3, // 26: bytebase.v1.PlanService.ListPlans:input_type -> bytebase.v1.ListPlansRequest
+ 5, // 27: bytebase.v1.PlanService.SearchPlans:input_type -> bytebase.v1.SearchPlansRequest
+ 7, // 28: bytebase.v1.PlanService.CreatePlan:input_type -> bytebase.v1.CreatePlanRequest
+ 8, // 29: bytebase.v1.PlanService.UpdatePlan:input_type -> bytebase.v1.UpdatePlanRequest
+ 10, // 30: bytebase.v1.PlanService.GetPlanCheckRun:input_type -> bytebase.v1.GetPlanCheckRunRequest
+ 11, // 31: bytebase.v1.PlanService.RunPlanChecks:input_type -> bytebase.v1.RunPlanChecksRequest
+ 13, // 32: bytebase.v1.PlanService.CancelPlanCheckRun:input_type -> bytebase.v1.CancelPlanCheckRunRequest
+ 9, // 33: bytebase.v1.PlanService.GetPlan:output_type -> bytebase.v1.Plan
+ 4, // 34: bytebase.v1.PlanService.ListPlans:output_type -> bytebase.v1.ListPlansResponse
+ 6, // 35: bytebase.v1.PlanService.SearchPlans:output_type -> bytebase.v1.SearchPlansResponse
+ 9, // 36: bytebase.v1.PlanService.CreatePlan:output_type -> bytebase.v1.Plan
+ 9, // 37: bytebase.v1.PlanService.UpdatePlan:output_type -> bytebase.v1.Plan
+ 15, // 38: bytebase.v1.PlanService.GetPlanCheckRun:output_type -> bytebase.v1.PlanCheckRun
+ 12, // 39: bytebase.v1.PlanService.RunPlanChecks:output_type -> bytebase.v1.RunPlanChecksResponse
+ 14, // 40: bytebase.v1.PlanService.CancelPlanCheckRun:output_type -> bytebase.v1.CancelPlanCheckRunResponse
+ 33, // [33:41] is the sub-list for method output_type
+ 25, // [25:33] is the sub-list for method input_type
+ 25, // [25:25] is the sub-list for extension type_name
+ 25, // [25:25] is the sub-list for extension extendee
+ 0, // [0:25] is the sub-list for field type_name
}
func init() { file_v1_plan_service_proto_init() }
@@ -2008,14 +1916,14 @@ func file_v1_plan_service_proto_init() {
file_v1_annotation_proto_init()
file_v1_common_proto_init()
file_v1_sql_service_proto_init()
- file_v1_plan_service_proto_msgTypes[10].OneofWrappers = []any{}
- file_v1_plan_service_proto_msgTypes[15].OneofWrappers = []any{
+ file_v1_plan_service_proto_msgTypes[9].OneofWrappers = []any{}
+ file_v1_plan_service_proto_msgTypes[14].OneofWrappers = []any{
(*Plan_Spec_CreateDatabaseConfig)(nil),
(*Plan_Spec_ChangeDatabaseConfig)(nil),
(*Plan_Spec_ExportDataConfig)(nil),
}
- file_v1_plan_service_proto_msgTypes[19].OneofWrappers = []any{}
- file_v1_plan_service_proto_msgTypes[21].OneofWrappers = []any{
+ file_v1_plan_service_proto_msgTypes[18].OneofWrappers = []any{}
+ file_v1_plan_service_proto_msgTypes[20].OneofWrappers = []any{
(*PlanCheckRun_Result_SqlSummaryReport_)(nil),
(*PlanCheckRun_Result_SqlReviewReport_)(nil),
}
@@ -2025,7 +1933,7 @@ func file_v1_plan_service_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_v1_plan_service_proto_rawDesc), len(file_v1_plan_service_proto_rawDesc)),
NumEnums: 2,
- NumMessages: 24,
+ NumMessages: 23,
NumExtensions: 0,
NumServices: 1,
},
diff --git a/backend/generated-go/v1/plan_service.pb.gw.go b/backend/generated-go/v1/plan_service.pb.gw.go
index 28c16e02bd..59531b57a0 100644
--- a/backend/generated-go/v1/plan_service.pb.gw.go
+++ b/backend/generated-go/v1/plan_service.pb.gw.go
@@ -298,56 +298,42 @@ func local_request_PlanService_UpdatePlan_0(ctx context.Context, marshaler runti
return msg, metadata, err
}
-var filter_PlanService_ListPlanCheckRuns_0 = &utilities.DoubleArray{Encoding: map[string]int{"parent": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
-
-func request_PlanService_ListPlanCheckRuns_0(ctx context.Context, marshaler runtime.Marshaler, client PlanServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+func request_PlanService_GetPlanCheckRun_0(ctx context.Context, marshaler runtime.Marshaler, client PlanServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
- protoReq ListPlanCheckRunsRequest
+ protoReq GetPlanCheckRunRequest
metadata runtime.ServerMetadata
err error
)
if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
- val, ok := pathParams["parent"]
+ val, ok := pathParams["name"]
if !ok {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
}
- protoReq.Parent, err = runtime.String(val)
+ protoReq.Name, err = runtime.String(val)
if err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
- }
- if err := req.ParseForm(); err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- }
- if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_PlanService_ListPlanCheckRuns_0); err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
}
- msg, err := client.ListPlanCheckRuns(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ msg, err := client.GetPlanCheckRun(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
-func local_request_PlanService_ListPlanCheckRuns_0(ctx context.Context, marshaler runtime.Marshaler, server PlanServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+func local_request_PlanService_GetPlanCheckRun_0(ctx context.Context, marshaler runtime.Marshaler, server PlanServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
- protoReq ListPlanCheckRunsRequest
+ protoReq GetPlanCheckRunRequest
metadata runtime.ServerMetadata
err error
)
- val, ok := pathParams["parent"]
+ val, ok := pathParams["name"]
if !ok {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
}
- protoReq.Parent, err = runtime.String(val)
+ protoReq.Name, err = runtime.String(val)
if err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
- }
- if err := req.ParseForm(); err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- }
- if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_PlanService_ListPlanCheckRuns_0); err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
}
- msg, err := server.ListPlanCheckRuns(ctx, &protoReq)
+ msg, err := server.GetPlanCheckRun(ctx, &protoReq)
return msg, metadata, err
}
@@ -396,9 +382,9 @@ func local_request_PlanService_RunPlanChecks_0(ctx context.Context, marshaler ru
return msg, metadata, err
}
-func request_PlanService_BatchCancelPlanCheckRuns_0(ctx context.Context, marshaler runtime.Marshaler, client PlanServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+func request_PlanService_CancelPlanCheckRun_0(ctx context.Context, marshaler runtime.Marshaler, client PlanServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
- protoReq BatchCancelPlanCheckRunsRequest
+ protoReq CancelPlanCheckRunRequest
metadata runtime.ServerMetadata
err error
)
@@ -408,36 +394,36 @@ func request_PlanService_BatchCancelPlanCheckRuns_0(ctx context.Context, marshal
if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
- val, ok := pathParams["parent"]
+ val, ok := pathParams["name"]
if !ok {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
}
- protoReq.Parent, err = runtime.String(val)
+ protoReq.Name, err = runtime.String(val)
if err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
}
- msg, err := client.BatchCancelPlanCheckRuns(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ msg, err := client.CancelPlanCheckRun(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
-func local_request_PlanService_BatchCancelPlanCheckRuns_0(ctx context.Context, marshaler runtime.Marshaler, server PlanServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+func local_request_PlanService_CancelPlanCheckRun_0(ctx context.Context, marshaler runtime.Marshaler, server PlanServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
- protoReq BatchCancelPlanCheckRunsRequest
+ protoReq CancelPlanCheckRunRequest
metadata runtime.ServerMetadata
err error
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
- val, ok := pathParams["parent"]
+ val, ok := pathParams["name"]
if !ok {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
}
- protoReq.Parent, err = runtime.String(val)
+ protoReq.Name, err = runtime.String(val)
if err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
}
- msg, err := server.BatchCancelPlanCheckRuns(ctx, &protoReq)
+ msg, err := server.CancelPlanCheckRun(ctx, &protoReq)
return msg, metadata, err
}
@@ -547,25 +533,25 @@ func RegisterPlanServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux
}
forward_PlanService_UpdatePlan_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
- mux.Handle(http.MethodGet, pattern_PlanService_ListPlanCheckRuns_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ mux.Handle(http.MethodGet, pattern_PlanService_GetPlanCheckRun_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
- annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.PlanService/ListPlanCheckRuns", runtime.WithHTTPPathPattern("/v1/{parent=projects/*/plans/*}/planCheckRuns"))
+ annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.PlanService/GetPlanCheckRun", runtime.WithHTTPPathPattern("/v1/{name=projects/*/plans/*/planCheckRun}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
- resp, md, err := local_request_PlanService_ListPlanCheckRuns_0(annotatedContext, inboundMarshaler, server, req, pathParams)
+ resp, md, err := local_request_PlanService_GetPlanCheckRun_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
- forward_PlanService_ListPlanCheckRuns_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+ forward_PlanService_GetPlanCheckRun_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_PlanService_RunPlanChecks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
@@ -587,25 +573,25 @@ func RegisterPlanServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux
}
forward_PlanService_RunPlanChecks_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
- mux.Handle(http.MethodPost, pattern_PlanService_BatchCancelPlanCheckRuns_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ mux.Handle(http.MethodPost, pattern_PlanService_CancelPlanCheckRun_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
- annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.PlanService/BatchCancelPlanCheckRuns", runtime.WithHTTPPathPattern("/v1/{parent=projects/*/plans/*}/planCheckRuns:batchCancel"))
+ annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.PlanService/CancelPlanCheckRun", runtime.WithHTTPPathPattern("/v1/{name=projects/*/plans/*/planCheckRun}:cancel"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
- resp, md, err := local_request_PlanService_BatchCancelPlanCheckRuns_0(annotatedContext, inboundMarshaler, server, req, pathParams)
+ resp, md, err := local_request_PlanService_CancelPlanCheckRun_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
- forward_PlanService_BatchCancelPlanCheckRuns_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+ forward_PlanService_CancelPlanCheckRun_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
@@ -732,22 +718,22 @@ func RegisterPlanServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux
}
forward_PlanService_UpdatePlan_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
- mux.Handle(http.MethodGet, pattern_PlanService_ListPlanCheckRuns_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ mux.Handle(http.MethodGet, pattern_PlanService_GetPlanCheckRun_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
- annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.PlanService/ListPlanCheckRuns", runtime.WithHTTPPathPattern("/v1/{parent=projects/*/plans/*}/planCheckRuns"))
+ annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.PlanService/GetPlanCheckRun", runtime.WithHTTPPathPattern("/v1/{name=projects/*/plans/*/planCheckRun}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
- resp, md, err := request_PlanService_ListPlanCheckRuns_0(annotatedContext, inboundMarshaler, client, req, pathParams)
+ resp, md, err := request_PlanService_GetPlanCheckRun_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
- forward_PlanService_ListPlanCheckRuns_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+ forward_PlanService_GetPlanCheckRun_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_PlanService_RunPlanChecks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
@@ -766,44 +752,44 @@ func RegisterPlanServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux
}
forward_PlanService_RunPlanChecks_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
- mux.Handle(http.MethodPost, pattern_PlanService_BatchCancelPlanCheckRuns_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ mux.Handle(http.MethodPost, pattern_PlanService_CancelPlanCheckRun_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
- annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.PlanService/BatchCancelPlanCheckRuns", runtime.WithHTTPPathPattern("/v1/{parent=projects/*/plans/*}/planCheckRuns:batchCancel"))
+ annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.PlanService/CancelPlanCheckRun", runtime.WithHTTPPathPattern("/v1/{name=projects/*/plans/*/planCheckRun}:cancel"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
- resp, md, err := request_PlanService_BatchCancelPlanCheckRuns_0(annotatedContext, inboundMarshaler, client, req, pathParams)
+ resp, md, err := request_PlanService_CancelPlanCheckRun_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
- forward_PlanService_BatchCancelPlanCheckRuns_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+ forward_PlanService_CancelPlanCheckRun_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
- pattern_PlanService_GetPlan_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3}, []string{"v1", "projects", "plans", "name"}, ""))
- pattern_PlanService_ListPlans_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2, 2, 3}, []string{"v1", "projects", "parent", "plans"}, ""))
- pattern_PlanService_SearchPlans_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2, 2, 3}, []string{"v1", "projects", "parent", "plans"}, "search"))
- pattern_PlanService_CreatePlan_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2, 2, 3}, []string{"v1", "projects", "parent", "plans"}, ""))
- pattern_PlanService_UpdatePlan_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3}, []string{"v1", "projects", "plans", "plan.name"}, ""))
- pattern_PlanService_ListPlanCheckRuns_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3, 2, 4}, []string{"v1", "projects", "plans", "parent", "planCheckRuns"}, ""))
- pattern_PlanService_RunPlanChecks_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3}, []string{"v1", "projects", "plans", "name"}, "runPlanChecks"))
- pattern_PlanService_BatchCancelPlanCheckRuns_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3, 2, 4}, []string{"v1", "projects", "plans", "parent", "planCheckRuns"}, "batchCancel"))
+ pattern_PlanService_GetPlan_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3}, []string{"v1", "projects", "plans", "name"}, ""))
+ pattern_PlanService_ListPlans_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2, 2, 3}, []string{"v1", "projects", "parent", "plans"}, ""))
+ pattern_PlanService_SearchPlans_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2, 2, 3}, []string{"v1", "projects", "parent", "plans"}, "search"))
+ pattern_PlanService_CreatePlan_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2, 2, 3}, []string{"v1", "projects", "parent", "plans"}, ""))
+ pattern_PlanService_UpdatePlan_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3}, []string{"v1", "projects", "plans", "plan.name"}, ""))
+ pattern_PlanService_GetPlanCheckRun_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 2, 3, 4, 5, 5, 4}, []string{"v1", "projects", "plans", "planCheckRun", "name"}, ""))
+ pattern_PlanService_RunPlanChecks_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3}, []string{"v1", "projects", "plans", "name"}, "runPlanChecks"))
+ pattern_PlanService_CancelPlanCheckRun_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 2, 3, 4, 5, 5, 4}, []string{"v1", "projects", "plans", "planCheckRun", "name"}, "cancel"))
)
var (
- forward_PlanService_GetPlan_0 = runtime.ForwardResponseMessage
- forward_PlanService_ListPlans_0 = runtime.ForwardResponseMessage
- forward_PlanService_SearchPlans_0 = runtime.ForwardResponseMessage
- forward_PlanService_CreatePlan_0 = runtime.ForwardResponseMessage
- forward_PlanService_UpdatePlan_0 = runtime.ForwardResponseMessage
- forward_PlanService_ListPlanCheckRuns_0 = runtime.ForwardResponseMessage
- forward_PlanService_RunPlanChecks_0 = runtime.ForwardResponseMessage
- forward_PlanService_BatchCancelPlanCheckRuns_0 = runtime.ForwardResponseMessage
+ forward_PlanService_GetPlan_0 = runtime.ForwardResponseMessage
+ forward_PlanService_ListPlans_0 = runtime.ForwardResponseMessage
+ forward_PlanService_SearchPlans_0 = runtime.ForwardResponseMessage
+ forward_PlanService_CreatePlan_0 = runtime.ForwardResponseMessage
+ forward_PlanService_UpdatePlan_0 = runtime.ForwardResponseMessage
+ forward_PlanService_GetPlanCheckRun_0 = runtime.ForwardResponseMessage
+ forward_PlanService_RunPlanChecks_0 = runtime.ForwardResponseMessage
+ forward_PlanService_CancelPlanCheckRun_0 = runtime.ForwardResponseMessage
)
diff --git a/backend/generated-go/v1/plan_service_equal.pb.go b/backend/generated-go/v1/plan_service_equal.pb.go
index e2f6daf005..fe00b528ef 100644
--- a/backend/generated-go/v1/plan_service_equal.pb.go
+++ b/backend/generated-go/v1/plan_service_equal.pb.go
@@ -328,40 +328,16 @@ func (x *Plan) Equal(y *Plan) bool {
return true
}
-func (x *ListPlanCheckRunsRequest) Equal(y *ListPlanCheckRunsRequest) bool {
+func (x *GetPlanCheckRunRequest) Equal(y *GetPlanCheckRunRequest) bool {
if x == y {
return true
}
if x == nil || y == nil {
return x == nil && y == nil
}
- if x.Parent != y.Parent {
- return false
- }
- if x.LatestOnly != y.LatestOnly {
- return false
- }
- if x.Filter != y.Filter {
- return false
- }
- return true
-}
-
-func (x *ListPlanCheckRunsResponse) Equal(y *ListPlanCheckRunsResponse) bool {
- if x == y {
- return true
- }
- if x == nil || y == nil {
- return x == nil && y == nil
- }
- if len(x.PlanCheckRuns) != len(y.PlanCheckRuns) {
+ if x.Name != y.Name {
return false
}
- for i := 0; i < len(x.PlanCheckRuns); i++ {
- if !x.PlanCheckRuns[i].Equal(y.PlanCheckRuns[i]) {
- return false
- }
- }
return true
}
@@ -391,28 +367,20 @@ func (x *RunPlanChecksResponse) Equal(y *RunPlanChecksResponse) bool {
return true
}
-func (x *BatchCancelPlanCheckRunsRequest) Equal(y *BatchCancelPlanCheckRunsRequest) bool {
+func (x *CancelPlanCheckRunRequest) Equal(y *CancelPlanCheckRunRequest) bool {
if x == y {
return true
}
if x == nil || y == nil {
return x == nil && y == nil
}
- if x.Parent != y.Parent {
- return false
- }
- if len(x.PlanCheckRuns) != len(y.PlanCheckRuns) {
+ if x.Name != y.Name {
return false
}
- for i := 0; i < len(x.PlanCheckRuns); i++ {
- if x.PlanCheckRuns[i] != y.PlanCheckRuns[i] {
- return false
- }
- }
return true
}
-func (x *BatchCancelPlanCheckRunsResponse) Equal(y *BatchCancelPlanCheckRunsResponse) bool {
+func (x *CancelPlanCheckRunResponse) Equal(y *CancelPlanCheckRunResponse) bool {
if x == y {
return true
}
diff --git a/backend/generated-go/v1/plan_service_grpc.pb.go b/backend/generated-go/v1/plan_service_grpc.pb.go
index 75fc2855d7..3a19329116 100644
--- a/backend/generated-go/v1/plan_service_grpc.pb.go
+++ b/backend/generated-go/v1/plan_service_grpc.pb.go
@@ -19,14 +19,14 @@ import (
const _ = grpc.SupportPackageIsVersion9
const (
- PlanService_GetPlan_FullMethodName = "/bytebase.v1.PlanService/GetPlan"
- PlanService_ListPlans_FullMethodName = "/bytebase.v1.PlanService/ListPlans"
- PlanService_SearchPlans_FullMethodName = "/bytebase.v1.PlanService/SearchPlans"
- PlanService_CreatePlan_FullMethodName = "/bytebase.v1.PlanService/CreatePlan"
- PlanService_UpdatePlan_FullMethodName = "/bytebase.v1.PlanService/UpdatePlan"
- PlanService_ListPlanCheckRuns_FullMethodName = "/bytebase.v1.PlanService/ListPlanCheckRuns"
- PlanService_RunPlanChecks_FullMethodName = "/bytebase.v1.PlanService/RunPlanChecks"
- PlanService_BatchCancelPlanCheckRuns_FullMethodName = "/bytebase.v1.PlanService/BatchCancelPlanCheckRuns"
+ PlanService_GetPlan_FullMethodName = "/bytebase.v1.PlanService/GetPlan"
+ PlanService_ListPlans_FullMethodName = "/bytebase.v1.PlanService/ListPlans"
+ PlanService_SearchPlans_FullMethodName = "/bytebase.v1.PlanService/SearchPlans"
+ PlanService_CreatePlan_FullMethodName = "/bytebase.v1.PlanService/CreatePlan"
+ PlanService_UpdatePlan_FullMethodName = "/bytebase.v1.PlanService/UpdatePlan"
+ PlanService_GetPlanCheckRun_FullMethodName = "/bytebase.v1.PlanService/GetPlanCheckRun"
+ PlanService_RunPlanChecks_FullMethodName = "/bytebase.v1.PlanService/RunPlanChecks"
+ PlanService_CancelPlanCheckRun_FullMethodName = "/bytebase.v1.PlanService/CancelPlanCheckRun"
)
// PlanServiceClient is the client API for PlanService service.
@@ -51,15 +51,15 @@ type PlanServiceClient interface {
// The plan creator and the user with bb.plans.update permission on the project can update the plan.
// Permissions required: bb.plans.update (or creator)
UpdatePlan(ctx context.Context, in *UpdatePlanRequest, opts ...grpc.CallOption) (*Plan, error)
- // Lists plan check runs for a deployment plan.
- // Permissions required: bb.planCheckRuns.list
- ListPlanCheckRuns(ctx context.Context, in *ListPlanCheckRunsRequest, opts ...grpc.CallOption) (*ListPlanCheckRunsResponse, error)
+ // Gets the plan check run for a deployment plan.
+ // Permissions required: bb.planCheckRuns.get
+ GetPlanCheckRun(ctx context.Context, in *GetPlanCheckRunRequest, opts ...grpc.CallOption) (*PlanCheckRun, error)
// Executes validation checks on a deployment plan.
// Permissions required: bb.planCheckRuns.run
RunPlanChecks(ctx context.Context, in *RunPlanChecksRequest, opts ...grpc.CallOption) (*RunPlanChecksResponse, error)
- // Cancels multiple plan check runs.
+ // Cancels the plan check run for a deployment plan.
// Permissions required: bb.planCheckRuns.run
- BatchCancelPlanCheckRuns(ctx context.Context, in *BatchCancelPlanCheckRunsRequest, opts ...grpc.CallOption) (*BatchCancelPlanCheckRunsResponse, error)
+ CancelPlanCheckRun(ctx context.Context, in *CancelPlanCheckRunRequest, opts ...grpc.CallOption) (*CancelPlanCheckRunResponse, error)
}
type planServiceClient struct {
@@ -120,10 +120,10 @@ func (c *planServiceClient) UpdatePlan(ctx context.Context, in *UpdatePlanReques
return out, nil
}
-func (c *planServiceClient) ListPlanCheckRuns(ctx context.Context, in *ListPlanCheckRunsRequest, opts ...grpc.CallOption) (*ListPlanCheckRunsResponse, error) {
+func (c *planServiceClient) GetPlanCheckRun(ctx context.Context, in *GetPlanCheckRunRequest, opts ...grpc.CallOption) (*PlanCheckRun, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
- out := new(ListPlanCheckRunsResponse)
- err := c.cc.Invoke(ctx, PlanService_ListPlanCheckRuns_FullMethodName, in, out, cOpts...)
+ out := new(PlanCheckRun)
+ err := c.cc.Invoke(ctx, PlanService_GetPlanCheckRun_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
@@ -140,10 +140,10 @@ func (c *planServiceClient) RunPlanChecks(ctx context.Context, in *RunPlanChecks
return out, nil
}
-func (c *planServiceClient) BatchCancelPlanCheckRuns(ctx context.Context, in *BatchCancelPlanCheckRunsRequest, opts ...grpc.CallOption) (*BatchCancelPlanCheckRunsResponse, error) {
+func (c *planServiceClient) CancelPlanCheckRun(ctx context.Context, in *CancelPlanCheckRunRequest, opts ...grpc.CallOption) (*CancelPlanCheckRunResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
- out := new(BatchCancelPlanCheckRunsResponse)
- err := c.cc.Invoke(ctx, PlanService_BatchCancelPlanCheckRuns_FullMethodName, in, out, cOpts...)
+ out := new(CancelPlanCheckRunResponse)
+ err := c.cc.Invoke(ctx, PlanService_CancelPlanCheckRun_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
@@ -172,15 +172,15 @@ type PlanServiceServer interface {
// The plan creator and the user with bb.plans.update permission on the project can update the plan.
// Permissions required: bb.plans.update (or creator)
UpdatePlan(context.Context, *UpdatePlanRequest) (*Plan, error)
- // Lists plan check runs for a deployment plan.
- // Permissions required: bb.planCheckRuns.list
- ListPlanCheckRuns(context.Context, *ListPlanCheckRunsRequest) (*ListPlanCheckRunsResponse, error)
+ // Gets the plan check run for a deployment plan.
+ // Permissions required: bb.planCheckRuns.get
+ GetPlanCheckRun(context.Context, *GetPlanCheckRunRequest) (*PlanCheckRun, error)
// Executes validation checks on a deployment plan.
// Permissions required: bb.planCheckRuns.run
RunPlanChecks(context.Context, *RunPlanChecksRequest) (*RunPlanChecksResponse, error)
- // Cancels multiple plan check runs.
+ // Cancels the plan check run for a deployment plan.
// Permissions required: bb.planCheckRuns.run
- BatchCancelPlanCheckRuns(context.Context, *BatchCancelPlanCheckRunsRequest) (*BatchCancelPlanCheckRunsResponse, error)
+ CancelPlanCheckRun(context.Context, *CancelPlanCheckRunRequest) (*CancelPlanCheckRunResponse, error)
mustEmbedUnimplementedPlanServiceServer()
}
@@ -206,14 +206,14 @@ func (UnimplementedPlanServiceServer) CreatePlan(context.Context, *CreatePlanReq
func (UnimplementedPlanServiceServer) UpdatePlan(context.Context, *UpdatePlanRequest) (*Plan, error) {
return nil, status.Error(codes.Unimplemented, "method UpdatePlan not implemented")
}
-func (UnimplementedPlanServiceServer) ListPlanCheckRuns(context.Context, *ListPlanCheckRunsRequest) (*ListPlanCheckRunsResponse, error) {
- return nil, status.Error(codes.Unimplemented, "method ListPlanCheckRuns not implemented")
+func (UnimplementedPlanServiceServer) GetPlanCheckRun(context.Context, *GetPlanCheckRunRequest) (*PlanCheckRun, error) {
+ return nil, status.Error(codes.Unimplemented, "method GetPlanCheckRun not implemented")
}
func (UnimplementedPlanServiceServer) RunPlanChecks(context.Context, *RunPlanChecksRequest) (*RunPlanChecksResponse, error) {
return nil, status.Error(codes.Unimplemented, "method RunPlanChecks not implemented")
}
-func (UnimplementedPlanServiceServer) BatchCancelPlanCheckRuns(context.Context, *BatchCancelPlanCheckRunsRequest) (*BatchCancelPlanCheckRunsResponse, error) {
- return nil, status.Error(codes.Unimplemented, "method BatchCancelPlanCheckRuns not implemented")
+func (UnimplementedPlanServiceServer) CancelPlanCheckRun(context.Context, *CancelPlanCheckRunRequest) (*CancelPlanCheckRunResponse, error) {
+ return nil, status.Error(codes.Unimplemented, "method CancelPlanCheckRun not implemented")
}
func (UnimplementedPlanServiceServer) mustEmbedUnimplementedPlanServiceServer() {}
func (UnimplementedPlanServiceServer) testEmbeddedByValue() {}
@@ -326,20 +326,20 @@ func _PlanService_UpdatePlan_Handler(srv interface{}, ctx context.Context, dec f
return interceptor(ctx, in, info, handler)
}
-func _PlanService_ListPlanCheckRuns_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(ListPlanCheckRunsRequest)
+func _PlanService_GetPlanCheckRun_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(GetPlanCheckRunRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
- return srv.(PlanServiceServer).ListPlanCheckRuns(ctx, in)
+ return srv.(PlanServiceServer).GetPlanCheckRun(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
- FullMethod: PlanService_ListPlanCheckRuns_FullMethodName,
+ FullMethod: PlanService_GetPlanCheckRun_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(PlanServiceServer).ListPlanCheckRuns(ctx, req.(*ListPlanCheckRunsRequest))
+ return srv.(PlanServiceServer).GetPlanCheckRun(ctx, req.(*GetPlanCheckRunRequest))
}
return interceptor(ctx, in, info, handler)
}
@@ -362,20 +362,20 @@ func _PlanService_RunPlanChecks_Handler(srv interface{}, ctx context.Context, de
return interceptor(ctx, in, info, handler)
}
-func _PlanService_BatchCancelPlanCheckRuns_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(BatchCancelPlanCheckRunsRequest)
+func _PlanService_CancelPlanCheckRun_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(CancelPlanCheckRunRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
- return srv.(PlanServiceServer).BatchCancelPlanCheckRuns(ctx, in)
+ return srv.(PlanServiceServer).CancelPlanCheckRun(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
- FullMethod: PlanService_BatchCancelPlanCheckRuns_FullMethodName,
+ FullMethod: PlanService_CancelPlanCheckRun_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(PlanServiceServer).BatchCancelPlanCheckRuns(ctx, req.(*BatchCancelPlanCheckRunsRequest))
+ return srv.(PlanServiceServer).CancelPlanCheckRun(ctx, req.(*CancelPlanCheckRunRequest))
}
return interceptor(ctx, in, info, handler)
}
@@ -408,16 +408,16 @@ var PlanService_ServiceDesc = grpc.ServiceDesc{
Handler: _PlanService_UpdatePlan_Handler,
},
{
- MethodName: "ListPlanCheckRuns",
- Handler: _PlanService_ListPlanCheckRuns_Handler,
+ MethodName: "GetPlanCheckRun",
+ Handler: _PlanService_GetPlanCheckRun_Handler,
},
{
MethodName: "RunPlanChecks",
Handler: _PlanService_RunPlanChecks_Handler,
},
{
- MethodName: "BatchCancelPlanCheckRuns",
- Handler: _PlanService_BatchCancelPlanCheckRuns_Handler,
+ MethodName: "CancelPlanCheckRun",
+ Handler: _PlanService_CancelPlanCheckRun_Handler,
},
},
Streams: []grpc.StreamDesc{},
diff --git a/backend/generated-go/v1/v1connect/plan_service.connect.go b/backend/generated-go/v1/v1connect/plan_service.connect.go
index 9683cebbcb..c3c0c59876 100644
--- a/backend/generated-go/v1/v1connect/plan_service.connect.go
+++ b/backend/generated-go/v1/v1connect/plan_service.connect.go
@@ -43,15 +43,15 @@ const (
PlanServiceCreatePlanProcedure = "/bytebase.v1.PlanService/CreatePlan"
// PlanServiceUpdatePlanProcedure is the fully-qualified name of the PlanService's UpdatePlan RPC.
PlanServiceUpdatePlanProcedure = "/bytebase.v1.PlanService/UpdatePlan"
- // PlanServiceListPlanCheckRunsProcedure is the fully-qualified name of the PlanService's
- // ListPlanCheckRuns RPC.
- PlanServiceListPlanCheckRunsProcedure = "/bytebase.v1.PlanService/ListPlanCheckRuns"
+ // PlanServiceGetPlanCheckRunProcedure is the fully-qualified name of the PlanService's
+ // GetPlanCheckRun RPC.
+ PlanServiceGetPlanCheckRunProcedure = "/bytebase.v1.PlanService/GetPlanCheckRun"
// PlanServiceRunPlanChecksProcedure is the fully-qualified name of the PlanService's RunPlanChecks
// RPC.
PlanServiceRunPlanChecksProcedure = "/bytebase.v1.PlanService/RunPlanChecks"
- // PlanServiceBatchCancelPlanCheckRunsProcedure is the fully-qualified name of the PlanService's
- // BatchCancelPlanCheckRuns RPC.
- PlanServiceBatchCancelPlanCheckRunsProcedure = "/bytebase.v1.PlanService/BatchCancelPlanCheckRuns"
+ // PlanServiceCancelPlanCheckRunProcedure is the fully-qualified name of the PlanService's
+ // CancelPlanCheckRun RPC.
+ PlanServiceCancelPlanCheckRunProcedure = "/bytebase.v1.PlanService/CancelPlanCheckRun"
)
// PlanServiceClient is a client for the bytebase.v1.PlanService service.
@@ -72,15 +72,15 @@ type PlanServiceClient interface {
// The plan creator and the user with bb.plans.update permission on the project can update the plan.
// Permissions required: bb.plans.update (or creator)
UpdatePlan(context.Context, *connect.Request[v1.UpdatePlanRequest]) (*connect.Response[v1.Plan], error)
- // Lists plan check runs for a deployment plan.
- // Permissions required: bb.planCheckRuns.list
- ListPlanCheckRuns(context.Context, *connect.Request[v1.ListPlanCheckRunsRequest]) (*connect.Response[v1.ListPlanCheckRunsResponse], error)
+ // Gets the plan check run for a deployment plan.
+ // Permissions required: bb.planCheckRuns.get
+ GetPlanCheckRun(context.Context, *connect.Request[v1.GetPlanCheckRunRequest]) (*connect.Response[v1.PlanCheckRun], error)
// Executes validation checks on a deployment plan.
// Permissions required: bb.planCheckRuns.run
RunPlanChecks(context.Context, *connect.Request[v1.RunPlanChecksRequest]) (*connect.Response[v1.RunPlanChecksResponse], error)
- // Cancels multiple plan check runs.
+ // Cancels the plan check run for a deployment plan.
// Permissions required: bb.planCheckRuns.run
- BatchCancelPlanCheckRuns(context.Context, *connect.Request[v1.BatchCancelPlanCheckRunsRequest]) (*connect.Response[v1.BatchCancelPlanCheckRunsResponse], error)
+ CancelPlanCheckRun(context.Context, *connect.Request[v1.CancelPlanCheckRunRequest]) (*connect.Response[v1.CancelPlanCheckRunResponse], error)
}
// NewPlanServiceClient constructs a client for the bytebase.v1.PlanService service. By default, it
@@ -124,10 +124,10 @@ func NewPlanServiceClient(httpClient connect.HTTPClient, baseURL string, opts ..
connect.WithSchema(planServiceMethods.ByName("UpdatePlan")),
connect.WithClientOptions(opts...),
),
- listPlanCheckRuns: connect.NewClient[v1.ListPlanCheckRunsRequest, v1.ListPlanCheckRunsResponse](
+ getPlanCheckRun: connect.NewClient[v1.GetPlanCheckRunRequest, v1.PlanCheckRun](
httpClient,
- baseURL+PlanServiceListPlanCheckRunsProcedure,
- connect.WithSchema(planServiceMethods.ByName("ListPlanCheckRuns")),
+ baseURL+PlanServiceGetPlanCheckRunProcedure,
+ connect.WithSchema(planServiceMethods.ByName("GetPlanCheckRun")),
connect.WithClientOptions(opts...),
),
runPlanChecks: connect.NewClient[v1.RunPlanChecksRequest, v1.RunPlanChecksResponse](
@@ -136,10 +136,10 @@ func NewPlanServiceClient(httpClient connect.HTTPClient, baseURL string, opts ..
connect.WithSchema(planServiceMethods.ByName("RunPlanChecks")),
connect.WithClientOptions(opts...),
),
- batchCancelPlanCheckRuns: connect.NewClient[v1.BatchCancelPlanCheckRunsRequest, v1.BatchCancelPlanCheckRunsResponse](
+ cancelPlanCheckRun: connect.NewClient[v1.CancelPlanCheckRunRequest, v1.CancelPlanCheckRunResponse](
httpClient,
- baseURL+PlanServiceBatchCancelPlanCheckRunsProcedure,
- connect.WithSchema(planServiceMethods.ByName("BatchCancelPlanCheckRuns")),
+ baseURL+PlanServiceCancelPlanCheckRunProcedure,
+ connect.WithSchema(planServiceMethods.ByName("CancelPlanCheckRun")),
connect.WithClientOptions(opts...),
),
}
@@ -147,14 +147,14 @@ func NewPlanServiceClient(httpClient connect.HTTPClient, baseURL string, opts ..
// planServiceClient implements PlanServiceClient.
type planServiceClient struct {
- getPlan *connect.Client[v1.GetPlanRequest, v1.Plan]
- listPlans *connect.Client[v1.ListPlansRequest, v1.ListPlansResponse]
- searchPlans *connect.Client[v1.SearchPlansRequest, v1.SearchPlansResponse]
- createPlan *connect.Client[v1.CreatePlanRequest, v1.Plan]
- updatePlan *connect.Client[v1.UpdatePlanRequest, v1.Plan]
- listPlanCheckRuns *connect.Client[v1.ListPlanCheckRunsRequest, v1.ListPlanCheckRunsResponse]
- runPlanChecks *connect.Client[v1.RunPlanChecksRequest, v1.RunPlanChecksResponse]
- batchCancelPlanCheckRuns *connect.Client[v1.BatchCancelPlanCheckRunsRequest, v1.BatchCancelPlanCheckRunsResponse]
+ getPlan *connect.Client[v1.GetPlanRequest, v1.Plan]
+ listPlans *connect.Client[v1.ListPlansRequest, v1.ListPlansResponse]
+ searchPlans *connect.Client[v1.SearchPlansRequest, v1.SearchPlansResponse]
+ createPlan *connect.Client[v1.CreatePlanRequest, v1.Plan]
+ updatePlan *connect.Client[v1.UpdatePlanRequest, v1.Plan]
+ getPlanCheckRun *connect.Client[v1.GetPlanCheckRunRequest, v1.PlanCheckRun]
+ runPlanChecks *connect.Client[v1.RunPlanChecksRequest, v1.RunPlanChecksResponse]
+ cancelPlanCheckRun *connect.Client[v1.CancelPlanCheckRunRequest, v1.CancelPlanCheckRunResponse]
}
// GetPlan calls bytebase.v1.PlanService.GetPlan.
@@ -182,9 +182,9 @@ func (c *planServiceClient) UpdatePlan(ctx context.Context, req *connect.Request
return c.updatePlan.CallUnary(ctx, req)
}
-// ListPlanCheckRuns calls bytebase.v1.PlanService.ListPlanCheckRuns.
-func (c *planServiceClient) ListPlanCheckRuns(ctx context.Context, req *connect.Request[v1.ListPlanCheckRunsRequest]) (*connect.Response[v1.ListPlanCheckRunsResponse], error) {
- return c.listPlanCheckRuns.CallUnary(ctx, req)
+// GetPlanCheckRun calls bytebase.v1.PlanService.GetPlanCheckRun.
+func (c *planServiceClient) GetPlanCheckRun(ctx context.Context, req *connect.Request[v1.GetPlanCheckRunRequest]) (*connect.Response[v1.PlanCheckRun], error) {
+ return c.getPlanCheckRun.CallUnary(ctx, req)
}
// RunPlanChecks calls bytebase.v1.PlanService.RunPlanChecks.
@@ -192,9 +192,9 @@ func (c *planServiceClient) RunPlanChecks(ctx context.Context, req *connect.Requ
return c.runPlanChecks.CallUnary(ctx, req)
}
-// BatchCancelPlanCheckRuns calls bytebase.v1.PlanService.BatchCancelPlanCheckRuns.
-func (c *planServiceClient) BatchCancelPlanCheckRuns(ctx context.Context, req *connect.Request[v1.BatchCancelPlanCheckRunsRequest]) (*connect.Response[v1.BatchCancelPlanCheckRunsResponse], error) {
- return c.batchCancelPlanCheckRuns.CallUnary(ctx, req)
+// CancelPlanCheckRun calls bytebase.v1.PlanService.CancelPlanCheckRun.
+func (c *planServiceClient) CancelPlanCheckRun(ctx context.Context, req *connect.Request[v1.CancelPlanCheckRunRequest]) (*connect.Response[v1.CancelPlanCheckRunResponse], error) {
+ return c.cancelPlanCheckRun.CallUnary(ctx, req)
}
// PlanServiceHandler is an implementation of the bytebase.v1.PlanService service.
@@ -215,15 +215,15 @@ type PlanServiceHandler interface {
// The plan creator and the user with bb.plans.update permission on the project can update the plan.
// Permissions required: bb.plans.update (or creator)
UpdatePlan(context.Context, *connect.Request[v1.UpdatePlanRequest]) (*connect.Response[v1.Plan], error)
- // Lists plan check runs for a deployment plan.
- // Permissions required: bb.planCheckRuns.list
- ListPlanCheckRuns(context.Context, *connect.Request[v1.ListPlanCheckRunsRequest]) (*connect.Response[v1.ListPlanCheckRunsResponse], error)
+ // Gets the plan check run for a deployment plan.
+ // Permissions required: bb.planCheckRuns.get
+ GetPlanCheckRun(context.Context, *connect.Request[v1.GetPlanCheckRunRequest]) (*connect.Response[v1.PlanCheckRun], error)
// Executes validation checks on a deployment plan.
// Permissions required: bb.planCheckRuns.run
RunPlanChecks(context.Context, *connect.Request[v1.RunPlanChecksRequest]) (*connect.Response[v1.RunPlanChecksResponse], error)
- // Cancels multiple plan check runs.
+ // Cancels the plan check run for a deployment plan.
// Permissions required: bb.planCheckRuns.run
- BatchCancelPlanCheckRuns(context.Context, *connect.Request[v1.BatchCancelPlanCheckRunsRequest]) (*connect.Response[v1.BatchCancelPlanCheckRunsResponse], error)
+ CancelPlanCheckRun(context.Context, *connect.Request[v1.CancelPlanCheckRunRequest]) (*connect.Response[v1.CancelPlanCheckRunResponse], error)
}
// NewPlanServiceHandler builds an HTTP handler from the service implementation. It returns the path
@@ -263,10 +263,10 @@ func NewPlanServiceHandler(svc PlanServiceHandler, opts ...connect.HandlerOption
connect.WithSchema(planServiceMethods.ByName("UpdatePlan")),
connect.WithHandlerOptions(opts...),
)
- planServiceListPlanCheckRunsHandler := connect.NewUnaryHandler(
- PlanServiceListPlanCheckRunsProcedure,
- svc.ListPlanCheckRuns,
- connect.WithSchema(planServiceMethods.ByName("ListPlanCheckRuns")),
+ planServiceGetPlanCheckRunHandler := connect.NewUnaryHandler(
+ PlanServiceGetPlanCheckRunProcedure,
+ svc.GetPlanCheckRun,
+ connect.WithSchema(planServiceMethods.ByName("GetPlanCheckRun")),
connect.WithHandlerOptions(opts...),
)
planServiceRunPlanChecksHandler := connect.NewUnaryHandler(
@@ -275,10 +275,10 @@ func NewPlanServiceHandler(svc PlanServiceHandler, opts ...connect.HandlerOption
connect.WithSchema(planServiceMethods.ByName("RunPlanChecks")),
connect.WithHandlerOptions(opts...),
)
- planServiceBatchCancelPlanCheckRunsHandler := connect.NewUnaryHandler(
- PlanServiceBatchCancelPlanCheckRunsProcedure,
- svc.BatchCancelPlanCheckRuns,
- connect.WithSchema(planServiceMethods.ByName("BatchCancelPlanCheckRuns")),
+ planServiceCancelPlanCheckRunHandler := connect.NewUnaryHandler(
+ PlanServiceCancelPlanCheckRunProcedure,
+ svc.CancelPlanCheckRun,
+ connect.WithSchema(planServiceMethods.ByName("CancelPlanCheckRun")),
connect.WithHandlerOptions(opts...),
)
return "/bytebase.v1.PlanService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
@@ -293,12 +293,12 @@ func NewPlanServiceHandler(svc PlanServiceHandler, opts ...connect.HandlerOption
planServiceCreatePlanHandler.ServeHTTP(w, r)
case PlanServiceUpdatePlanProcedure:
planServiceUpdatePlanHandler.ServeHTTP(w, r)
- case PlanServiceListPlanCheckRunsProcedure:
- planServiceListPlanCheckRunsHandler.ServeHTTP(w, r)
+ case PlanServiceGetPlanCheckRunProcedure:
+ planServiceGetPlanCheckRunHandler.ServeHTTP(w, r)
case PlanServiceRunPlanChecksProcedure:
planServiceRunPlanChecksHandler.ServeHTTP(w, r)
- case PlanServiceBatchCancelPlanCheckRunsProcedure:
- planServiceBatchCancelPlanCheckRunsHandler.ServeHTTP(w, r)
+ case PlanServiceCancelPlanCheckRunProcedure:
+ planServiceCancelPlanCheckRunHandler.ServeHTTP(w, r)
default:
http.NotFound(w, r)
}
@@ -328,14 +328,14 @@ func (UnimplementedPlanServiceHandler) UpdatePlan(context.Context, *connect.Requ
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("bytebase.v1.PlanService.UpdatePlan is not implemented"))
}
-func (UnimplementedPlanServiceHandler) ListPlanCheckRuns(context.Context, *connect.Request[v1.ListPlanCheckRunsRequest]) (*connect.Response[v1.ListPlanCheckRunsResponse], error) {
- return nil, connect.NewError(connect.CodeUnimplemented, errors.New("bytebase.v1.PlanService.ListPlanCheckRuns is not implemented"))
+func (UnimplementedPlanServiceHandler) GetPlanCheckRun(context.Context, *connect.Request[v1.GetPlanCheckRunRequest]) (*connect.Response[v1.PlanCheckRun], error) {
+ return nil, connect.NewError(connect.CodeUnimplemented, errors.New("bytebase.v1.PlanService.GetPlanCheckRun is not implemented"))
}
func (UnimplementedPlanServiceHandler) RunPlanChecks(context.Context, *connect.Request[v1.RunPlanChecksRequest]) (*connect.Response[v1.RunPlanChecksResponse], error) {
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("bytebase.v1.PlanService.RunPlanChecks is not implemented"))
}
-func (UnimplementedPlanServiceHandler) BatchCancelPlanCheckRuns(context.Context, *connect.Request[v1.BatchCancelPlanCheckRunsRequest]) (*connect.Response[v1.BatchCancelPlanCheckRunsResponse], error) {
- return nil, connect.NewError(connect.CodeUnimplemented, errors.New("bytebase.v1.PlanService.BatchCancelPlanCheckRuns is not implemented"))
+func (UnimplementedPlanServiceHandler) CancelPlanCheckRun(context.Context, *connect.Request[v1.CancelPlanCheckRunRequest]) (*connect.Response[v1.CancelPlanCheckRunResponse], error) {
+ return nil, connect.NewError(connect.CodeUnimplemented, errors.New("bytebase.v1.PlanService.CancelPlanCheckRun is not implemented"))
}
diff --git a/backend/migrator/migration/3.14/0008##rename_plan_check_runs_permission.sql b/backend/migrator/migration/3.14/0008##rename_plan_check_runs_permission.sql
new file mode 100644
index 0000000000..c8f3165bd4
--- /dev/null
+++ b/backend/migrator/migration/3.14/0008##rename_plan_check_runs_permission.sql
@@ -0,0 +1,16 @@
+-- Rename bb.planCheckRuns.list to bb.planCheckRuns.get in custom roles
+UPDATE role
+SET permissions = jsonb_set(
+ permissions,
+ '{permissions}',
+ (
+ SELECT jsonb_agg(
+ CASE
+ WHEN elem = 'bb.planCheckRuns.list' THEN 'bb.planCheckRuns.get'
+ ELSE elem
+ END
+ )
+ FROM jsonb_array_elements_text(permissions->'permissions') AS elem
+ )
+)
+WHERE permissions->'permissions' @> '"bb.planCheckRuns.list"';
diff --git a/backend/migrator/migrator_test.go b/backend/migrator/migrator_test.go
index 76fc6e2693..8940ad3a5e 100644
--- a/backend/migrator/migrator_test.go
+++ b/backend/migrator/migrator_test.go
@@ -12,7 +12,7 @@ import (
func TestLatestVersion(t *testing.T) {
files, err := getSortedVersionedFiles()
require.NoError(t, err)
- require.Equal(t, semver.MustParse("3.14.7"), *files[len(files)-1].version)
+ require.Equal(t, semver.MustParse("3.14.8"), *files[len(files)-1].version)
}
func TestVersionUnique(t *testing.T) {
diff --git a/backend/tests/sql.go b/backend/tests/sql.go
index 51563b5aa4..a22c26bad2 100644
--- a/backend/tests/sql.go
+++ b/backend/tests/sql.go
@@ -2,6 +2,7 @@ package tests
import (
"context"
+ "fmt"
"time"
"connectrpc.com/connect"
@@ -33,25 +34,24 @@ func (ctl *controller) GetSQLReviewResult(ctx context.Context, plan *v1pb.Plan)
defer ticker.Stop()
for range ticker.C {
- resp, err := ctl.planServiceClient.ListPlanCheckRuns(ctx, connect.NewRequest(&v1pb.ListPlanCheckRunsRequest{
- Parent: plan.Name,
+ resp, err := ctl.planServiceClient.GetPlanCheckRun(ctx, connect.NewRequest(&v1pb.GetPlanCheckRunRequest{
+ Name: fmt.Sprintf("%s/planCheckRun", plan.Name),
}))
if err != nil {
return nil, err
}
- for _, check := range resp.Msg.PlanCheckRuns {
- // 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
- }
+ check := resp.Msg
+ // 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
- }
+ }
+ if hasStatementAdvise {
+ if check.Status == v1pb.PlanCheckRun_DONE || check.Status == v1pb.PlanCheckRun_FAILED {
+ return check, nil
}
}
}
diff --git a/docs/plans/2025-12-24-plan-check-run-singleton-api.md b/docs/plans/2025-12-24-plan-check-run-singleton-api.md
new file mode 100644
index 0000000000..a532491458
--- /dev/null
+++ b/docs/plans/2025-12-24-plan-check-run-singleton-api.md
@@ -0,0 +1,557 @@
+# Plan Check Run Singleton API Implementation Plan
+
+> **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.
+
+**Goal:** Convert plan check run from a collection resource to a singleton resource under plan.
+
+**Architecture:** Since each plan now has exactly one plan check run record (consolidated model), the API changes from List/Batch operations to Get/single operations. Resource pattern changes from `planCheckRuns/{id}` to `planCheckRun` (singleton).
+
+**Tech Stack:** Protocol Buffers, Go, TypeScript, Vue 3
+
+---
+
+## Task 1: Update Proto - PlanService
+
+**Files:**
+- Modify: `proto/v1/v1/plan_service.proto`
+
+**Step 1: Replace ListPlanCheckRuns with GetPlanCheckRun RPC**
+
+Replace lines 77-84:
+
+```protobuf
+ // Gets the plan check run for a deployment plan.
+ // Permissions required: bb.planCheckRuns.get
+ rpc GetPlanCheckRun(GetPlanCheckRunRequest) returns (PlanCheckRun) {
+ option (google.api.http) = {get: "/v1/{name=projects/*/plans/*/planCheckRun}"};
+ option (google.api.method_signature) = "name";
+ option (bytebase.v1.permission) = "bb.planCheckRuns.get";
+ option (bytebase.v1.auth_method) = IAM;
+ }
+```
+
+**Step 2: Replace BatchCancelPlanCheckRuns with CancelPlanCheckRun RPC**
+
+Replace lines 98-108:
+
+```protobuf
+ // Cancels the plan check run for a deployment plan.
+ // Permissions required: bb.planCheckRuns.run
+ rpc CancelPlanCheckRun(CancelPlanCheckRunRequest) returns (CancelPlanCheckRunResponse) {
+ option (google.api.http) = {
+ post: "/v1/{name=projects/*/plans/*/planCheckRun}:cancel"
+ body: "*"
+ };
+ option (google.api.method_signature) = "name";
+ option (bytebase.v1.permission) = "bb.planCheckRuns.run";
+ option (bytebase.v1.auth_method) = IAM;
+ }
+```
+
+**Step 3: Replace ListPlanCheckRunsRequest/Response with GetPlanCheckRunRequest**
+
+Replace lines 350-379:
+
+```protobuf
+message GetPlanCheckRunRequest {
+ // The name of the plan check run to retrieve.
+ // Format: projects/{project}/plans/{plan}/planCheckRun
+ string name = 1 [
+ (google.api.field_behavior) = REQUIRED
+ ];
+}
+```
+
+**Step 4: Replace BatchCancelPlanCheckRunsRequest/Response with CancelPlanCheckRun messages**
+
+Replace lines 397-410:
+
+```protobuf
+message CancelPlanCheckRunRequest {
+ // The name of the plan check run to cancel.
+ // Format: projects/{project}/plans/{plan}/planCheckRun
+ string name = 1 [
+ (google.api.field_behavior) = REQUIRED
+ ];
+}
+
+message CancelPlanCheckRunResponse {}
+```
+
+**Step 5: Update PlanCheckRun resource name comment**
+
+Update line 413:
+
+```protobuf
+message PlanCheckRun {
+ // Format: projects/{project}/plans/{plan}/planCheckRun
+ string name = 1;
+```
+
+**Step 6: Format and lint proto**
+
+Run: `buf format -w proto && buf lint proto`
+Expected: No errors
+
+**Step 7: Generate proto**
+
+Run: `cd proto && buf generate`
+Expected: Generated files updated
+
+**Step 8: Commit**
+
+```bash
+but commit consolidated-plan-check-runs -m "proto: convert plan check run to singleton resource API"
+```
+
+---
+
+## Task 2: Update Permissions
+
+**Files:**
+- Modify: `backend/component/iam/permission.yaml`
+- Modify: `backend/component/iam/permission.go`
+- Modify: `backend/component/iam/acl.yaml`
+- Modify: `frontend/src/types/iam/permission.ts`
+
+**Step 1: Update permission.yaml**
+
+Replace line 44 (`bb.planCheckRuns.list`) with:
+
+```yaml
+ - bb.planCheckRuns.get
+```
+
+**Step 2: Regenerate permission.go**
+
+Run: `go generate ./backend/component/iam/...`
+Expected: permission.go updated with new constant
+
+**Step 3: Update acl.yaml**
+
+Search for `bb.planCheckRuns.list` and replace with `bb.planCheckRuns.get`.
+
+Run: `grep -n "planCheckRuns.list" backend/component/iam/acl.yaml`
+
+Replace all occurrences.
+
+**Step 4: Update frontend permission.ts**
+
+Replace line 46:
+
+```typescript
+ | "bb.planCheckRuns.get"
+```
+
+**Step 5: Commit**
+
+```bash
+but commit consolidated-plan-check-runs -m "iam: rename planCheckRuns.list to planCheckRuns.get"
+```
+
+---
+
+## Task 2.5: Create Permission Migration Script
+
+**Files:**
+- Create: `backend/migrator/migration/3.14/0008##rename_plan_check_runs_permission.sql`
+
+**Step 1: Write the migration SQL**
+
+```sql
+-- Rename bb.planCheckRuns.list to bb.planCheckRuns.get in custom roles
+UPDATE role
+SET permissions = jsonb_set(
+ permissions,
+ '{permissions}',
+ (
+ SELECT jsonb_agg(
+ CASE
+ WHEN elem = 'bb.planCheckRuns.list' THEN 'bb.planCheckRuns.get'
+ ELSE elem
+ END
+ )
+ FROM jsonb_array_elements_text(permissions->'permissions') AS elem
+ )
+)
+WHERE permissions->'permissions' @> '"bb.planCheckRuns.list"';
+```
+
+**Step 2: Commit**
+
+```bash
+but commit consolidated-plan-check-runs -m "migration: rename planCheckRuns.list to planCheckRuns.get in custom roles"
+```
+
+---
+
+## Task 3: Update Backend Common Helpers
+
+**Files:**
+- Modify: `backend/common/resource_name.go`
+
+**Step 1: Add GetProjectIDPlanID from planCheckRun name**
+
+Add after `GetProjectIDPlanIDPlanCheckRunID` (around line 241):
+
+```go
+// GetProjectIDPlanIDFromPlanCheckRun returns the project ID and plan ID from a plan check run singleton resource name.
+// Format: projects/{project}/plans/{plan}/planCheckRun
+func GetProjectIDPlanIDFromPlanCheckRun(name string) (string, int64, error) {
+ // Remove the trailing "/planCheckRun" suffix
+ if !strings.HasSuffix(name, "/planCheckRun") {
+ return "", 0, errors.Errorf("invalid plan check run name %q, expected suffix /planCheckRun", name)
+ }
+ planName := strings.TrimSuffix(name, "/planCheckRun")
+ projectID, planID, err := GetProjectIDPlanID(planName)
+ if err != nil {
+ return "", 0, err
+ }
+ return projectID, int64(planID), nil
+}
+```
+
+**Step 2: Update FormatPlanCheckRun to singleton pattern**
+
+Replace the function at line 565:
+
+```go
+// FormatPlanCheckRun formats a plan check run singleton resource name.
+// Format: projects/{project}/plans/{plan}/planCheckRun
+func FormatPlanCheckRun(projectID string, planUID int64) string {
+ return fmt.Sprintf("%s/planCheckRun", FormatPlan(projectID, planUID))
+}
+```
+
+**Step 3: Run linter**
+
+Run: `golangci-lint run --allow-parallel-runners backend/common/resource_name.go`
+Expected: No errors
+
+**Step 4: Commit**
+
+```bash
+but commit consolidated-plan-check-runs -m "common: update plan check run helpers for singleton resource"
+```
+
+---
+
+## Task 4: Update Backend API - PlanService
+
+**Files:**
+- Modify: `backend/api/v1/plan_service.go`
+
+**Step 1: Replace ListPlanCheckRuns with GetPlanCheckRun**
+
+Replace the method (around line 437-463):
+
+```go
+// GetPlanCheckRun gets the plan check run for the plan.
+func (s *PlanService) GetPlanCheckRun(ctx context.Context, request *connect.Request[v1pb.GetPlanCheckRunRequest]) (*connect.Response[v1pb.PlanCheckRun], error) {
+ req := request.Msg
+ projectID, planUID, err := common.GetProjectIDPlanIDFromPlanCheckRun(req.Name)
+ if err != nil {
+ return nil, connect.NewError(connect.CodeInvalidArgument, err)
+ }
+
+ planCheckRun, err := s.store.GetPlanCheckRun(ctx, planUID)
+ if err != nil {
+ return nil, connect.NewError(connect.CodeInternal, errors.Errorf("failed to get plan check run, error: %v", err))
+ }
+ if planCheckRun == nil {
+ return nil, connect.NewError(connect.CodeNotFound, errors.Errorf("plan check run not found for plan %d", planUID))
+ }
+
+ converted := convertToPlanCheckRun(projectID, planUID, planCheckRun)
+ return connect.NewResponse(converted), nil
+}
+```
+
+**Step 2: Replace BatchCancelPlanCheckRuns with CancelPlanCheckRun**
+
+Replace the method (around line 658-721):
+
+```go
+// CancelPlanCheckRun cancels the plan check run for a plan.
+func (s *PlanService) CancelPlanCheckRun(ctx context.Context, request *connect.Request[v1pb.CancelPlanCheckRunRequest]) (*connect.Response[v1pb.CancelPlanCheckRunResponse], error) {
+ req := request.Msg
+ projectID, planUID, err := common.GetProjectIDPlanIDFromPlanCheckRun(req.Name)
+ if err != nil {
+ return nil, connect.NewError(connect.CodeInvalidArgument, err)
+ }
+
+ project, err := s.store.GetProject(ctx, &store.FindProjectMessage{
+ ResourceID: &projectID,
+ })
+ if err != nil {
+ return nil, connect.NewError(connect.CodeInternal, errors.Errorf("failed to find project, error: %v", err))
+ }
+ if project == nil {
+ return nil, connect.NewError(connect.CodeNotFound, errors.Errorf("project %v not found", projectID))
+ }
+
+ planCheckRun, err := s.store.GetPlanCheckRun(ctx, planUID)
+ if err != nil {
+ return nil, connect.NewError(connect.CodeInternal, errors.Errorf("failed to get plan check run, error: %v", err))
+ }
+ if planCheckRun == nil {
+ return nil, connect.NewError(connect.CodeNotFound, errors.Errorf("plan check run not found for plan %d", planUID))
+ }
+
+ if planCheckRun.Status != store.PlanCheckRunStatusRunning {
+ return nil, connect.NewError(connect.CodeInvalidArgument, errors.Errorf("plan check run is not running"))
+ }
+
+ // Cancel the plan check run.
+ if cancelFunc, ok := s.stateCfg.RunningPlanCheckRunsCancelFunc.Load(planCheckRun.UID); ok {
+ cancelFunc.(context.CancelFunc)()
+ }
+
+ // Update the status to canceled.
+ if err := s.store.BatchCancelPlanCheckRuns(ctx, []int{planCheckRun.UID}); err != nil {
+ return nil, connect.NewError(connect.CodeInternal, errors.Errorf("failed to cancel plan check run, error: %v", err))
+ }
+
+ return connect.NewResponse(&v1pb.CancelPlanCheckRunResponse{}), nil
+}
+```
+
+**Step 3: Delete parsePlanCheckRunFilter method**
+
+Remove the entire `parsePlanCheckRunFilter` method (lines 465-593) - no longer needed.
+
+**Step 4: Update convertToPlanCheckRuns to convertToPlanCheckRun**
+
+Replace around line 1058:
+
+```go
+func convertToPlanCheckRun(projectID string, planUID int64, run *store.PlanCheckRunMessage) *v1pb.PlanCheckRun {
+ return &v1pb.PlanCheckRun{
+ Name: common.FormatPlanCheckRun(projectID, planUID),
+ Status: convertToPlanCheckRunStatus(run.Status),
+ Results: convertToPlanCheckRunResults(run.Result.GetResults()),
+ Error: run.Result.Error,
+ CreateTime: timestamppb.New(run.CreatedAt),
+ }
+}
+```
+
+**Step 5: Update convertToPlan to use new helper**
+
+In `convertToPlan` function (around line 1031-1043), update the plan check run status count logic:
+
+```go
+ planCheckRun, err := s.GetPlanCheckRun(ctx, plan.UID)
+ if err != nil {
+ return nil, errors.Wrapf(err, "failed to get plan check run for plan uid %d", plan.UID)
+ }
+ if planCheckRun != nil {
+ p.PlanCheckRunStatusCount[string(planCheckRun.Status)]++
+ for _, result := range planCheckRun.Result.Results {
+ p.PlanCheckRunStatusCount[storepb.Advice_Status_name[int32(result.Status)]]++
+ }
+ }
+```
+
+**Step 6: Remove unused imports**
+
+Remove CEL-related imports that were used by `parsePlanCheckRunFilter`:
+- `"github.com/google/cel-go/cel"`
+- `celast "github.com/google/cel-go/common/ast"`
+- `celoperators "github.com/google/cel-go/common/operators"`
+
+**Step 7: Run linter**
+
+Run: `golangci-lint run --allow-parallel-runners backend/api/v1/plan_service.go`
+Expected: No errors (fix any that appear)
+
+**Step 8: Commit**
+
+```bash
+but commit consolidated-plan-check-runs -m "api: convert plan check run to singleton resource API"
+```
+
+---
+
+## Task 5: Update Frontend - Store and Components
+
+**Files:**
+- Modify: `frontend/src/store/modules/v1/experimental-issue.ts`
+- Modify: `frontend/src/store/modules/v1/common.ts`
+- Modify: `frontend/src/components/Plan/logic/poller/utils.ts`
+- Modify: `frontend/src/components/PlanCheckRun/PlanCheckRunDetail.vue`
+
+**Step 1: Update experimental-issue.ts**
+
+Replace the plan check run fetching logic (lines 66-76):
+
+```typescript
+ if (hasProjectPermissionV2(projectEntity, "bb.planCheckRuns.get")) {
+ const request = create(GetPlanCheckRunRequestSchema, {
+ name: `${issue.plan}/planCheckRun`,
+ });
+ try {
+ const response =
+ await planServiceClientConnect.getPlanCheckRun(request);
+ issue.planCheckRunList = [response];
+ } catch {
+ // Plan check run might not exist yet
+ issue.planCheckRunList = [];
+ }
+ }
+```
+
+Update imports at the top:
+
+```typescript
+import {
+ CreatePlanRequestSchema,
+ GetPlanRequestSchema,
+ GetPlanCheckRunRequestSchema,
+} from "@/types/proto-es/v1/plan_service_pb";
+```
+
+**Step 2: Update common.ts - add getProjectNamePlanId helper**
+
+Add after `getProjectNamePlanIdPlanCheckRunId` (around line 85):
+
+```typescript
+export const getProjectNamePlanIdFromPlanCheckRun = (name: string): [string, string] => {
+ // Format: projects/{project}/plans/{plan}/planCheckRun
+ if (!name.endsWith("/planCheckRun")) {
+ throw new Error(`Invalid plan check run name: ${name}`);
+ }
+ const planName = name.replace(/\/planCheckRun$/, "");
+ const tokens = getNameParentTokens(planName, [
+ projectNamePrefix,
+ planNamePrefix,
+ ]);
+ return [tokens[0], tokens[1]];
+};
+```
+
+**Step 3: Update poller/utils.ts**
+
+Replace `refreshPlanCheckRuns` function (lines 31-46):
+
+```typescript
+export const refreshPlanCheckRuns = async (
+ plan: Plan,
+ project: Project,
+ planCheckRuns: Ref<PlanCheckRun[]>
+): Promise<void> => {
+ if (!hasProjectPermissionV2(project, "bb.planCheckRuns.get")) {
+ return;
+ }
+
+ const request = create(GetPlanCheckRunRequestSchema, {
+ name: `${plan.name}/planCheckRun`,
+ });
+ try {
+ const response = await planServiceClientConnect.getPlanCheckRun(request);
+ planCheckRuns.value = [response];
+ } catch {
+ // Plan check run might not exist yet
+ planCheckRuns.value = [];
+ }
+};
+```
+
+Update imports:
+
+```typescript
+import {
+ GetPlanRequestSchema,
+ GetPlanCheckRunRequestSchema,
+} from "@/types/proto-es/v1/plan_service_pb";
+```
+
+**Step 4: Update PlanCheckRunDetail.vue**
+
+Update imports (around line 246-268):
+
+```typescript
+import {
+ getProjectNamePlanIdFromPlanCheckRun,
+ planNamePrefix,
+ projectNamePrefix,
+} from "@/store/modules/v1/common";
+```
+
+```typescript
+import {
+ CancelPlanCheckRunRequestSchema,
+ PlanCheckRun_ResultSchema,
+ PlanCheckRun_Status,
+} from "@/types/proto-es/v1/plan_service_pb";
+```
+
+Update `cancelPlanCheckRun` function (lines 560-572):
+
+```typescript
+const cancelPlanCheckRun = async () => {
+ const request = create(CancelPlanCheckRunRequestSchema, {
+ name: props.planCheckRun.name,
+ });
+ await planServiceClientConnect.cancelPlanCheckRun(request);
+ if (usePlanCheckRunContext()) {
+ usePlanCheckRunContext().events.emit("status-changed");
+ }
+};
+```
+
+**Step 5: Format frontend**
+
+Run: `pnpm --dir frontend biome:check`
+Expected: No errors
+
+**Step 6: Type check frontend**
+
+Run: `pnpm --dir frontend type-check`
+Expected: No errors
+
+**Step 7: Commit**
+
+```bash
+but commit consolidated-plan-check-runs -m "frontend: update to singleton plan check run API"
+```
+
+---
+
+## Task 6: Build and Test
+
+**Step 1: Build backend**
+
+Run: `go build -ldflags "-w -s" -p=16 -o ./bytebase-build/bytebase ./backend/bin/server/main.go`
+Expected: Build succeeds
+
+**Step 2: Run backend linter**
+
+Run: `golangci-lint run --allow-parallel-runners`
+Expected: No errors (run repeatedly until clean)
+
+**Step 3: Run related tests**
+
+Run: `go test -v -count=1 github.com/bytebase/bytebase/backend/store -run PlanCheck`
+Run: `go test -v -count=1 github.com/bytebase/bytebase/backend/api/v1 -run PlanCheck`
+Expected: Tests pass
+
+**Step 4: Final commit**
+
+```bash
+but commit consolidated-plan-check-runs -m "chore: fix build and lint issues"
+```
+
+---
+
+## Summary
+
+| Task | Description | Key Files |
+|------|-------------|-----------|
+| 1 | Proto changes | `proto/v1/v1/plan_service.proto` |
+| 2 | Permission changes | `backend/component/iam/*.yaml`, `frontend/src/types/iam/permission.ts` |
+| 2.5 | Permission migration | `backend/migrator/migration/3.14/0008##rename_plan_check_runs_permission.sql` |
+| 3 | Backend common helpers | `backend/common/resource_name.go` |
+| 4 | Backend API | `backend/api/v1/plan_service.go` |
+| 5 | Frontend updates | `frontend/src/store/`, `frontend/src/components/` |
+| 6 | Build & test | All |
diff --git a/frontend/src/components/Plan/logic/poller/utils.ts b/frontend/src/components/Plan/logic/poller/utils.ts
index c856de2976..47fccc9245 100644
--- a/frontend/src/components/Plan/logic/poller/utils.ts
+++ b/frontend/src/components/Plan/logic/poller/utils.ts
@@ -9,8 +9,8 @@ import type { Issue } from "@/types/proto-es/v1/issue_service_pb";
import { GetIssueRequestSchema } from "@/types/proto-es/v1/issue_service_pb";
import type { Plan, PlanCheckRun } from "@/types/proto-es/v1/plan_service_pb";
import {
+ GetPlanCheckRunRequestSchema,
GetPlanRequestSchema,
- ListPlanCheckRunsRequestSchema,
} from "@/types/proto-es/v1/plan_service_pb";
import type { Project } from "@/types/proto-es/v1/project_service_pb";
import type { Rollout, TaskRun } from "@/types/proto-es/v1/rollout_service_pb";
@@ -33,16 +33,20 @@ export const refreshPlanCheckRuns = async (
project: Project,
planCheckRuns: Ref<PlanCheckRun[]>
): Promise<void> => {
- if (!hasProjectPermissionV2(project, "bb.planCheckRuns.list")) {
+ if (!hasProjectPermissionV2(project, "bb.planCheckRuns.get")) {
return;
}
- const request = create(ListPlanCheckRunsRequestSchema, {
- parent: plan.name,
- latestOnly: true,
+ const request = create(GetPlanCheckRunRequestSchema, {
+ name: `${plan.name}/planCheckRun`,
});
- const response = await planServiceClientConnect.listPlanCheckRuns(request);
- planCheckRuns.value = response.planCheckRuns;
+ try {
+ const response = await planServiceClientConnect.getPlanCheckRun(request);
+ planCheckRuns.value = [response];
+ } catch {
+ // Plan check run might not exist yet
+ planCheckRuns.value = [];
+ }
};
export const refreshRollout = async (
diff --git a/frontend/src/components/PlanCheckRun/PlanCheckRunDetail.vue b/frontend/src/components/PlanCheckRun/PlanCheckRunDetail.vue
index ed7963b08f..57582a2d52 100644
--- a/frontend/src/components/PlanCheckRun/PlanCheckRunDetail.vue
+++ b/frontend/src/components/PlanCheckRun/PlanCheckRunDetail.vue
@@ -243,11 +243,6 @@ import { SQLRuleEditDialog } from "@/components/SQLReview/components";
import { planServiceClientConnect } from "@/grpcweb";
import { WORKSPACE_ROUTE_SQL_REVIEW } from "@/router/dashboard/workspaceRoutes";
import { useReviewPolicyForDatabase } from "@/store";
-import {
- getProjectNamePlanIdPlanCheckRunId,
- planNamePrefix,
- projectNamePrefix,
-} from "@/store/modules/v1/common";
import type { ComposedDatabase, RuleTemplateV2 } from "@/types";
import {
convertPolicyRuleToRuleTemplate,
@@ -262,7 +257,7 @@ import type {
PlanCheckRun_Result,
} from "@/types/proto-es/v1/plan_service_pb";
import {
- BatchCancelPlanCheckRunsRequestSchema,
+ CancelPlanCheckRunRequestSchema,
PlanCheckRun_ResultSchema,
PlanCheckRun_Status,
} from "@/types/proto-es/v1/plan_service_pb";
@@ -558,14 +553,10 @@ const handleClickPlanCheckDetailLine = (line: number) => {
};
const cancelPlanCheckRun = async () => {
- const planCheckRunName = props.planCheckRun.name;
- const [projectName, planId] =
- getProjectNamePlanIdPlanCheckRunId(planCheckRunName);
- const request = create(BatchCancelPlanCheckRunsRequestSchema, {
- parent: `${projectNamePrefix}${projectName}/${planNamePrefix}${planId}`,
- planCheckRuns: [planCheckRunName],
+ const request = create(CancelPlanCheckRunRequestSchema, {
+ name: props.planCheckRun.name,
});
- await planServiceClientConnect.batchCancelPlanCheckRuns(request);
+ await planServiceClientConnect.cancelPlanCheckRun(request);
if (usePlanCheckRunContext()) {
usePlanCheckRunContext().events.emit("status-changed");
}
diff --git a/frontend/src/store/modules/v1/experimental-issue.ts b/frontend/src/store/modules/v1/experimental-issue.ts
index 5d5396fde7..b3e8c5b941 100644
--- a/frontend/src/store/modules/v1/experimental-issue.ts
+++ b/frontend/src/store/modules/v1/experimental-issue.ts
@@ -1,5 +1,4 @@
import { create } from "@bufbuild/protobuf";
-import { orderBy } from "lodash-es";
import {
issueServiceClientConnect,
planServiceClientConnect,
@@ -22,8 +21,8 @@ import {
import type { Plan } from "@/types/proto-es/v1/plan_service_pb";
import {
CreatePlanRequestSchema,
+ GetPlanCheckRunRequestSchema,
GetPlanRequestSchema,
- ListPlanCheckRunsRequestSchema,
} from "@/types/proto-es/v1/plan_service_pb";
import type { Project } from "@/types/proto-es/v1/project_service_pb";
import {
@@ -63,16 +62,18 @@ const composeIssue = async (
issue.planEntity = response;
}
- if (hasProjectPermissionV2(projectEntity, "bb.planCheckRuns.list")) {
- // Only show the latest plan check runs.
- const request = create(ListPlanCheckRunsRequestSchema, {
- parent: issue.plan,
- latestOnly: true,
+ if (hasProjectPermissionV2(projectEntity, "bb.planCheckRuns.get")) {
+ const request = create(GetPlanCheckRunRequestSchema, {
+ name: `${issue.plan}/planCheckRun`,
});
- const response =
- await planServiceClientConnect.listPlanCheckRuns(request);
- const planCheckRuns = response.planCheckRuns;
- issue.planCheckRunList = orderBy(planCheckRuns, "name", "desc");
+ try {
+ const response =
+ await planServiceClientConnect.getPlanCheckRun(request);
+ issue.planCheckRunList = [response];
+ } catch {
+ // Plan check run might not exist yet
+ issue.planCheckRunList = [];
+ }
}
}
if (config.withRollout && issue.rollout) {
diff --git a/frontend/src/types/iam/permission.ts b/frontend/src/types/iam/permission.ts
index 40d680daaa..c121a3b7bc 100644
--- a/frontend/src/types/iam/permission.ts
+++ b/frontend/src/types/iam/permission.ts
@@ -43,7 +43,7 @@ export type Permission =
| "bb.issues.get"
| "bb.issues.list"
| "bb.issues.update"
- | "bb.planCheckRuns.list"
+ | "bb.planCheckRuns.get"
| "bb.planCheckRuns.run"
| "bb.plans.create"
| "bb.plans.get"
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 6bf0bbce09..d34c0330d7 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
@@ -565,66 +565,23 @@ export declare type Plan_ExportDataConfig = Message<"bytebase.v1.Plan.ExportData
export declare const Plan_ExportDataConfigSchema: GenMessage<Plan_ExportDataConfig>;
/**
- * @generated from message bytebase.v1.ListPlanCheckRunsRequest
+ * @generated from message bytebase.v1.GetPlanCheckRunRequest
*/
-export declare type ListPlanCheckRunsRequest = Message<"bytebase.v1.ListPlanCheckRunsRequest"> & {
+export declare type GetPlanCheckRunRequest = Message<"bytebase.v1.GetPlanCheckRunRequest"> & {
/**
- * The parent, which owns this collection of plan check runs.
- * Format: projects/{project}/plans/{plan}
- *
- * @generated from field: string parent = 1;
- */
- parent: string;
-
- /**
- * If set to true, only the latest plan check run will be returned.
- *
- * @generated from field: bool latest_only = 2;
- */
- latestOnly: boolean;
-
- /**
- * Filter is used to filter plan check runs returned in the list.
- * The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
- *
- * Supported filters:
- * - status: the plan check run status, support "==" and "in" operator, check the Status enum in the PlanCheckRun message for the values.
- * - result_status: the plan check run result status, support "==" and "in" operator, check the Result.Status enum in the PlanCheckRun message for the values.
- *
- * For example:
- * status in ["DONE", "FAILED"]
- * status == "RUNNING"
- * result_status in ["SUCCESS", "ERROR"]
- * result_status == "WARNING"
- *
- * @generated from field: string filter = 3;
- */
- filter: string;
-};
-
-/**
- * Describes the message bytebase.v1.ListPlanCheckRunsRequest.
- * Use `create(ListPlanCheckRunsRequestSchema)` to create a new message.
- */
-export declare const ListPlanCheckRunsRequestSchema: GenMessage<ListPlanCheckRunsRequest>;
-
-/**
- * @generated from message bytebase.v1.ListPlanCheckRunsResponse
- */
-export declare type ListPlanCheckRunsResponse = Message<"bytebase.v1.ListPlanCheckRunsResponse"> & {
- /**
- * The plan check runs from the specified request.
+ * The name of the plan check run to retrieve.
+ * Format: projects/{project}/plans/{plan}/planCheckRun
*
- * @generated from field: repeated bytebase.v1.PlanCheckRun plan_check_runs = 1;
+ * @generated from field: string name = 1;
*/
- planCheckRuns: PlanCheckRun[];
+ name: string;
};
/**
- * Describes the message bytebase.v1.ListPlanCheckRunsResponse.
- * Use `create(ListPlanCheckRunsResponseSchema)` to create a new message.
+ * Describes the message bytebase.v1.GetPlanCheckRunRequest.
+ * Use `create(GetPlanCheckRunRequestSchema)` to create a new message.
*/
-export declare const ListPlanCheckRunsResponseSchema: GenMessage<ListPlanCheckRunsResponse>;
+export declare const GetPlanCheckRunRequestSchema: GenMessage<GetPlanCheckRunRequest>;
/**
* @generated from message bytebase.v1.RunPlanChecksRequest
@@ -667,51 +624,42 @@ export declare type RunPlanChecksResponse = Message<"bytebase.v1.RunPlanChecksRe
export declare const RunPlanChecksResponseSchema: GenMessage<RunPlanChecksResponse>;
/**
- * @generated from message bytebase.v1.BatchCancelPlanCheckRunsRequest
+ * @generated from message bytebase.v1.CancelPlanCheckRunRequest
*/
-export declare type BatchCancelPlanCheckRunsRequest = Message<"bytebase.v1.BatchCancelPlanCheckRunsRequest"> & {
+export declare type CancelPlanCheckRunRequest = Message<"bytebase.v1.CancelPlanCheckRunRequest"> & {
/**
- * The name of the parent of the planChecks.
- * Format: projects/{project}/plans/{plan}
+ * The name of the plan check run to cancel.
+ * Format: projects/{project}/plans/{plan}/planCheckRun
*
- * @generated from field: string parent = 1;
- */
- parent: string;
-
- /**
- * TODO(d): update this API.
- * The planCheckRuns to cancel.
- * Format: projects/{project}/plans/{plan}/planCheckRuns/{planCheckRun}
- *
- * @generated from field: repeated string plan_check_runs = 2;
+ * @generated from field: string name = 1;
*/
- planCheckRuns: string[];
+ name: string;
};
/**
- * Describes the message bytebase.v1.BatchCancelPlanCheckRunsRequest.
- * Use `create(BatchCancelPlanCheckRunsRequestSchema)` to create a new message.
+ * Describes the message bytebase.v1.CancelPlanCheckRunRequest.
+ * Use `create(CancelPlanCheckRunRequestSchema)` to create a new message.
*/
-export declare const BatchCancelPlanCheckRunsRequestSchema: GenMessage<BatchCancelPlanCheckRunsRequest>;
+export declare const CancelPlanCheckRunRequestSchema: GenMessage<CancelPlanCheckRunRequest>;
/**
- * @generated from message bytebase.v1.BatchCancelPlanCheckRunsResponse
+ * @generated from message bytebase.v1.CancelPlanCheckRunResponse
*/
-export declare type BatchCancelPlanCheckRunsResponse = Message<"bytebase.v1.BatchCancelPlanCheckRunsResponse"> & {
+export declare type CancelPlanCheckRunResponse = Message<"bytebase.v1.CancelPlanCheckRunResponse"> & {
};
/**
- * Describes the message bytebase.v1.BatchCancelPlanCheckRunsResponse.
- * Use `create(BatchCancelPlanCheckRunsResponseSchema)` to create a new message.
+ * Describes the message bytebase.v1.CancelPlanCheckRunResponse.
+ * Use `create(CancelPlanCheckRunResponseSchema)` to create a new message.
*/
-export declare const BatchCancelPlanCheckRunsResponseSchema: GenMessage<BatchCancelPlanCheckRunsResponse>;
+export declare const CancelPlanCheckRunResponseSchema: GenMessage<CancelPlanCheckRunResponse>;
/**
* @generated from message bytebase.v1.PlanCheckRun
*/
export declare type PlanCheckRun = Message<"bytebase.v1.PlanCheckRun"> & {
/**
- * Format: projects/{project}/plans/{plan}/planCheckRuns/{planCheckRun}
+ * Format: projects/{project}/plans/{plan}/planCheckRun
*
* @generated from field: string name = 1;
*/
@@ -981,15 +929,15 @@ export declare const PlanService: GenService<{
output: typeof PlanSchema;
},
/**
- * Lists plan check runs for a deployment plan.
- * Permissions required: bb.planCheckRuns.list
+ * Gets the plan check run for a deployment plan.
+ * Permissions required: bb.planCheckRuns.get
*
- * @generated from rpc bytebase.v1.PlanService.ListPlanCheckRuns
+ * @generated from rpc bytebase.v1.PlanService.GetPlanCheckRun
*/
- listPlanCheckRuns: {
+ getPlanCheckRun: {
methodKind: "unary";
- input: typeof ListPlanCheckRunsRequestSchema;
- output: typeof ListPlanCheckRunsResponseSchema;
+ input: typeof GetPlanCheckRunRequestSchema;
+ output: typeof PlanCheckRunSchema;
},
/**
* Executes validation checks on a deployment plan.
@@ -1003,15 +951,15 @@ export declare const PlanService: GenService<{
output: typeof RunPlanChecksResponseSchema;
},
/**
- * Cancels multiple plan check runs.
+ * Cancels the plan check run for a deployment plan.
* Permissions required: bb.planCheckRuns.run
*
- * @generated from rpc bytebase.v1.PlanService.BatchCancelPlanCheckRuns
+ * @generated from rpc bytebase.v1.PlanService.CancelPlanCheckRun
*/
- batchCancelPlanCheckRuns: {
+ cancelPlanCheckRun: {
methodKind: "unary";
- input: typeof BatchCancelPlanCheckRunsRequestSchema;
- output: typeof BatchCancelPlanCheckRunsResponseSchema;
+ input: typeof CancelPlanCheckRunRequestSchema;
+ output: typeof CancelPlanCheckRunResponseSchema;
},
}>;
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 e00793d637..c487656f9e 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("ChV2MS9wbGFuX3NlcnZpY2UucHJvdG8SC2J5dGViYXNlLnYxIjkKDkdldFBsYW5SZXF1ZXN0EicKBG5hbWUYASABKAlCGeBBAvpBEwoRYnl0ZWJhc2UuY29tL1BsYW4iZwoQTGlzdFBsYW5zUmVxdWVzdBIsCgZwYXJlbnQYASABKAlCHOBBAvpBFgoUYnl0ZWJhc2UuY29tL1Byb2plY3QSEQoJcGFnZV9zaXplGAIgASgFEhIKCnBhZ2VfdG9rZW4YAyABKAkiTgoRTGlzdFBsYW5zUmVzcG9uc2USIAoFcGxhbnMYASADKAsyES5ieXRlYmFzZS52MS5QbGFuEhcKD25leHRfcGFnZV90b2tlbhgCIAEoCSJgChJTZWFyY2hQbGFuc1JlcXVlc3QSEwoGcGFyZW50GAEgASgJQgPgQQISEQoJcGFnZV9zaXplGAIgASgFEhIKCnBhZ2VfdG9rZW4YAyABKAkSDgoGZmlsdGVyGAQgASgJIlAKE1NlYXJjaFBsYW5zUmVzcG9uc2USIAoFcGxhbnMYASADKA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i8SLS92MS97cGFyZW50PXByb2plY3RzLyovcGxhbnMvKn0vcGxhbkNoZWNrUnVucxKxAQoNUnVuUGxhbkNoZWNrcxIhLmJ5dGViYXNlLnYxLlJ1blBsYW5DaGVja3NSZXF1ZXN0GiIuYnl0ZWJhc2UudjEuUnVuUGxhbkNoZWNrc1Jlc3BvbnNlIlnaQQRuYW1liuowFGJiLnBsYW5DaGVja1J1bnMucnVukOowAYLT5JMCMDoBKiIrL3YxL3tuYW1lPXByb2plY3RzLyovcGxhbnMvKn06cnVuUGxhbkNoZWNrcxLiAQoYQmF0Y2hDYW5jZWxQbGFuQ2hlY2tSdW5zEiwuYnl0ZWJhc2UudjEuQmF0Y2hDYW5jZWxQbGFuQ2hlY2tSdW5zUmVxdWVzdBotLmJ5dGViYXNlLnYxLkJhdGNoQ2FuY2VsUGxhbkNoZWNrUnVuc1Jlc3BvbnNlImnaQQZwYXJlbnSK6jAUYmIucGxhbkNoZWNrUnVucy5ydW6Q6jABgtPkkwI+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]);
+ fileDesc("ChV2MS9wbGFuX3NlcnZpY2UucHJvdG8SC2J5dGViYXNlLnYxIjkKDkdldFBsYW5SZXF1ZXN0EicKBG5hbWUYASABKAlC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YmFzZS5WMcoCC0J5dGViYXNlXFYx4gIXQnl0ZWJhc2VcVjFcR1BCTWV0YWRhdGHqAgxCeXRlYmFzZTo6VjFiBnByb3RvMw", [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.
@@ -104,80 +104,73 @@ export const Plan_ExportDataConfigSchema = /*@__PURE__*/
messageDesc(file_v1_plan_service, 7, 3);
/**
- * Describes the message bytebase.v1.ListPlanCheckRunsRequest.
- * Use `create(ListPlanCheckRunsRequestSchema)` to create a new message.
+ * Describes the message bytebase.v1.GetPlanCheckRunRequest.
+ * Use `create(GetPlanCheckRunRequestSchema)` to create a new message.
*/
-export const ListPlanCheckRunsRequestSchema = /*@__PURE__*/
+export const GetPlanCheckRunRequestSchema = /*@__PURE__*/
messageDesc(file_v1_plan_service, 8);
-/**
- * Describes the message bytebase.v1.ListPlanCheckRunsResponse.
- * Use `create(ListPlanCheckRunsResponseSchema)` to create a new message.
- */
-export const ListPlanCheckRunsResponseSchema = /*@__PURE__*/
- messageDesc(file_v1_plan_service, 9);
-
/**
* Describes the message bytebase.v1.RunPlanChecksRequest.
* Use `create(RunPlanChecksRequestSchema)` to create a new message.
*/
export const RunPlanChecksRequestSchema = /*@__PURE__*/
- messageDesc(file_v1_plan_service, 10);
+ messageDesc(file_v1_plan_service, 9);
/**
* Describes the message bytebase.v1.RunPlanChecksResponse.
* Use `create(RunPlanChecksResponseSchema)` to create a new message.
*/
export const RunPlanChecksResponseSchema = /*@__PURE__*/
- messageDesc(file_v1_plan_service, 11);
+ messageDesc(file_v1_plan_service, 10);
/**
- * Describes the message bytebase.v1.BatchCancelPlanCheckRunsRequest.
- * Use `create(BatchCancelPlanCheckRunsRequestSchema)` to create a new message.
+ * Describes the message bytebase.v1.CancelPlanCheckRunRequest.
+ * Use `create(CancelPlanCheckRunRequestSchema)` to create a new message.
*/
-export const BatchCancelPlanCheckRunsRequestSchema = /*@__PURE__*/
- messageDesc(file_v1_plan_service, 12);
+export const CancelPlanCheckRunRequestSchema = /*@__PURE__*/
+ messageDesc(file_v1_plan_service, 11);
/**
- * Describes the message bytebase.v1.BatchCancelPlanCheckRunsResponse.
- * Use `create(BatchCancelPlanCheckRunsResponseSchema)` to create a new message.
+ * Describes the message bytebase.v1.CancelPlanCheckRunResponse.
+ * Use `create(CancelPlanCheckRunResponseSchema)` to create a new message.
*/
-export const BatchCancelPlanCheckRunsResponseSchema = /*@__PURE__*/
- messageDesc(file_v1_plan_service, 13);
+export const CancelPlanCheckRunResponseSchema = /*@__PURE__*/
+ messageDesc(file_v1_plan_service, 12);
/**
* Describes the message bytebase.v1.PlanCheckRun.
* Use `create(PlanCheckRunSchema)` to create a new message.
*/
export const PlanCheckRunSchema = /*@__PURE__*/
- messageDesc(file_v1_plan_service, 14);
+ messageDesc(file_v1_plan_service, 13);
/**
* Describes the message bytebase.v1.PlanCheckRun.Result.
* Use `create(PlanCheckRun_ResultSchema)` to create a new message.
*/
export const PlanCheckRun_ResultSchema = /*@__PURE__*/
- messageDesc(file_v1_plan_service, 14, 0);
+ messageDesc(file_v1_plan_service, 13, 0);
/**
* Describes the message bytebase.v1.PlanCheckRun.Result.SqlSummaryReport.
* Use `create(PlanCheckRun_Result_SqlSummaryReportSchema)` to create a new message.
*/
export const PlanCheckRun_Result_SqlSummaryReportSchema = /*@__PURE__*/
- messageDesc(file_v1_plan_service, 14, 0, 0);
+ messageDesc(file_v1_plan_service, 13, 0, 0);
/**
* Describes the message bytebase.v1.PlanCheckRun.Result.SqlReviewReport.
* Use `create(PlanCheckRun_Result_SqlReviewReportSchema)` to create a new message.
*/
export const PlanCheckRun_Result_SqlReviewReportSchema = /*@__PURE__*/
- messageDesc(file_v1_plan_service, 14, 0, 1);
+ messageDesc(file_v1_plan_service, 13, 0, 1);
/**
* Describes the enum bytebase.v1.PlanCheckRun.Result.Type.
*/
export const PlanCheckRun_Result_TypeSchema = /*@__PURE__*/
- enumDesc(file_v1_plan_service, 14, 0, 0);
+ enumDesc(file_v1_plan_service, 13, 0, 0);
/**
* @generated from enum bytebase.v1.PlanCheckRun.Result.Type
@@ -189,7 +182,7 @@ export const PlanCheckRun_Result_Type = /*@__PURE__*/
* Describes the enum bytebase.v1.PlanCheckRun.Status.
*/
export const PlanCheckRun_StatusSchema = /*@__PURE__*/
- enumDesc(file_v1_plan_service, 14, 0);
+ enumDesc(file_v1_plan_service, 13, 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 e52004d685..d4a20bf1e8 100644
--- a/proto/gen/grpc-doc/openapi.yaml
+++ b/proto/gen/grpc-doc/openapi.yaml
@@ -4607,14 +4607,14 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Status'
- /v1/projects/{project}/plans/{plan}/planCheckRuns:
+ /v1/projects/{project}/plans/{plan}/planCheckRun:
get:
tags:
- PlanService
description: |-
- Lists plan check runs for a deployment plan.
- Permissions required: bb.planCheckRuns.list
- operationId: PlanService_ListPlanCheckRuns
+ Gets the plan check run for a deployment plan.
+ Permissions required: bb.planCheckRuns.get
+ operationId: PlanService_GetPlanCheckRun
parameters:
- name: project
in: path
@@ -4628,49 +4628,27 @@ paths:
required: true
schema:
type: string
- - name: latestOnly
- in: query
- description: If set to true, only the latest plan check run will be returned.
- schema:
- type: boolean
- - name: filter
- in: query
- description: |-
- Filter is used to filter plan check runs returned in the list.
- The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
-
- Supported filters:
- - status: the plan check run status, support "==" and "in" operator, check the Status enum in the PlanCheckRun message for the values.
- - result_status: the plan check run result status, support "==" and "in" operator, check the Result.Status enum in the PlanCheckRun message for the values.
-
- For example:
- status in ["DONE", "FAILED"]
- status == "RUNNING"
- result_status in ["SUCCESS", "ERROR"]
- result_status == "WARNING"
- schema:
- type: string
responses:
"200":
description: OK
content:
application/json:
schema:
- $ref: '#/components/schemas/ListPlanCheckRunsResponse'
+ $ref: '#/components/schemas/PlanCheckRun'
default:
description: Default error response
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
- /v1/projects/{project}/plans/{plan}/planCheckRuns:batchCancel:
+ /v1/projects/{project}/plans/{plan}/planCheckRun:cancel:
post:
tags:
- PlanService
description: |-
- Cancels multiple plan check runs.
+ Cancels the plan check run for a deployment plan.
Permissions required: bb.planCheckRuns.run
- operationId: PlanService_BatchCancelPlanCheckRuns
+ operationId: PlanService_CancelPlanCheckRun
parameters:
- name: project
in: path
@@ -4688,7 +4666,7 @@ paths:
content:
application/json:
schema:
- $ref: '#/components/schemas/BatchCancelPlanCheckRunsRequest'
+ $ref: '#/components/schemas/CancelPlanCheckRunRequest'
required: true
responses:
"200":
@@ -4696,7 +4674,7 @@ paths:
content:
application/json:
schema:
- $ref: '#/components/schemas/BatchCancelPlanCheckRunsResponse'
+ $ref: '#/components/schemas/CancelPlanCheckRunResponse'
default:
description: Default error response
content:
@@ -8258,27 +8236,6 @@ components:
- $ref: '#/components/schemas/RequestMetadata'
description: Metadata about the request context.
description: Audit log entry recording system activity or API call.
- BatchCancelPlanCheckRunsRequest:
- required:
- - parent
- type: object
- properties:
- parent:
- type: string
- description: |-
- The name of the parent of the planChecks.
- Format: projects/{project}/plans/{plan}
- planCheckRuns:
- type: array
- items:
- type: string
- description: |-
- TODO(d): update this API.
- The planCheckRuns to cancel.
- Format: projects/{project}/plans/{plan}/planCheckRuns/{planCheckRun}
- BatchCancelPlanCheckRunsResponse:
- type: object
- properties: {}
BatchCancelTaskRunsRequest:
type: object
properties:
@@ -8666,6 +8623,19 @@ components:
description: Maximum Y coordinate
format: double
description: BoundingBox defines the spatial bounds for GEOMETRY spatial indexes.
+ CancelPlanCheckRunRequest:
+ required:
+ - name
+ type: object
+ properties:
+ name:
+ type: string
+ description: |-
+ The name of the plan check run to cancel.
+ Format: projects/{project}/plans/{plan}/planCheckRun
+ CancelPlanCheckRunResponse:
+ type: object
+ properties: {}
Candidate_Content:
type: object
properties:
@@ -11256,14 +11226,6 @@ components:
description: |-
A token, which can be sent as `page_token` to retrieve the next page.
If this field is omitted, there are no subsequent pages.
- ListPlanCheckRunsResponse:
- type: object
- properties:
- planCheckRuns:
- type: array
- items:
- $ref: '#/components/schemas/PlanCheckRun'
- description: The plan check runs from the specified request.
ListPlansResponse:
type: object
properties:
@@ -11804,7 +11766,7 @@ components:
properties:
name:
type: string
- description: 'Format: projects/{project}/plans/{plan}/planCheckRuns/{planCheckRun}'
+ description: 'Format: projects/{project}/plans/{plan}/planCheckRun'
status:
enum:
- STATUS_UNSPECIFIED
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index 0ae074cbb2..911db3e11c 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -446,12 +446,11 @@
- [SQLService](#bytebase-v1-SQLService)
- [v1/plan_service.proto](#v1_plan_service-proto)
- - [BatchCancelPlanCheckRunsRequest](#bytebase-v1-BatchCancelPlanCheckRunsRequest)
- - [BatchCancelPlanCheckRunsResponse](#bytebase-v1-BatchCancelPlanCheckRunsResponse)
+ - [CancelPlanCheckRunRequest](#bytebase-v1-CancelPlanCheckRunRequest)
+ - [CancelPlanCheckRunResponse](#bytebase-v1-CancelPlanCheckRunResponse)
- [CreatePlanRequest](#bytebase-v1-CreatePlanRequest)
+ - [GetPlanCheckRunRequest](#bytebase-v1-GetPlanCheckRunRequest)
- [GetPlanRequest](#bytebase-v1-GetPlanRequest)
- - [ListPlanCheckRunsRequest](#bytebase-v1-ListPlanCheckRunsRequest)
- - [ListPlanCheckRunsResponse](#bytebase-v1-ListPlanCheckRunsResponse)
- [ListPlansRequest](#bytebase-v1-ListPlansRequest)
- [ListPlansResponse](#bytebase-v1-ListPlansResponse)
- [Plan](#bytebase-v1-Plan)
@@ -7415,25 +7414,24 @@ SQLService executes SQL queries and manages query operations.
-<a name="bytebase-v1-BatchCancelPlanCheckRunsRequest"></a>
+<a name="bytebase-v1-CancelPlanCheckRunRequest"></a>
-### BatchCancelPlanCheckRunsRequest
+### CancelPlanCheckRunRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| parent | [string](#string) | | The name of the parent of the planChecks. Format: projects/{project}/plans/{plan} |
-| plan_check_runs | [string](#string) | repeated | TODO(d): update this API. The planCheckRuns to cancel. Format: projects/{project}/plans/{plan}/planCheckRuns/{planCheckRun} |
+| name | [string](#string) | | The name of the plan check run to cancel. Format: projects/{project}/plans/{plan}/planCheckRun |
-<a name="bytebase-v1-BatchCancelPlanCheckRunsResponse"></a>
+<a name="bytebase-v1-CancelPlanCheckRunResponse"></a>
-### BatchCancelPlanCheckRunsResponse
+### CancelPlanCheckRunResponse
@@ -7457,51 +7455,30 @@ SQLService executes SQL queries and manages query operations.
-<a name="bytebase-v1-GetPlanRequest"></a>
-
-### GetPlanRequest
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| name | [string](#string) | | The name of the plan to retrieve. Format: projects/{project}/plans/{plan} |
-
+<a name="bytebase-v1-GetPlanCheckRunRequest"></a>
-
-
-
-
-<a name="bytebase-v1-ListPlanCheckRunsRequest"></a>
-
-### ListPlanCheckRunsRequest
+### GetPlanCheckRunRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| parent | [string](#string) | | The parent, which owns this collection of plan check runs. Format: projects/{project}/plans/{plan} |
-| latest_only | [bool](#bool) | | If set to true, only the latest plan check run will be returned. |
-| filter | [string](#string) | | Filter is used to filter plan check runs returned in the list. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+| name | [string](#string) | | The name of the plan check run to retrieve. Format: projects/{project}/plans/{plan}/planCheckRun |
-Supported filters: - status: the plan check run status, support &#34;==&#34; and &#34;in&#34; operator, check the Status enum in the PlanCheckRun message for the values. - result_status: the plan check run result status, support &#34;==&#34; and &#34;in&#34; operator, check the Result.Status enum in the PlanCheckRun message for the values.
-For example: status in [&#34;DONE&#34;, &#34;FAILED&#34;] status == &#34;RUNNING&#34; result_status in [&#34;SUCCESS&#34;, &#34;ERROR&#34;] result_status == &#34;WARNING&#34; |
+<a name="bytebase-v1-GetPlanRequest"></a>
-
-<a name="bytebase-v1-ListPlanCheckRunsResponse"></a>
-
-### ListPlanCheckRunsResponse
+### GetPlanRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| plan_check_runs | [PlanCheckRun](#bytebase-v1-PlanCheckRun) | repeated | The plan check runs from the specified request. |
+| name | [string](#string) | | The name of the plan to retrieve. Format: projects/{project}/plans/{plan} |
@@ -7687,7 +7664,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} |
+| name | [string](#string) | | Format: projects/{project}/plans/{plan}/planCheckRun |
| status | [PlanCheckRun.Status](#bytebase-v1-PlanCheckRun-Status) | | |
| results | [PlanCheckRun.Result](#bytebase-v1-PlanCheckRun-Result) | repeated | |
| error | [string](#string) | | error is set if the Status is FAILED. |
@@ -7884,9 +7861,9 @@ PlanService manages deployment plans for database changes.
| SearchPlans | [SearchPlansRequest](#bytebase-v1-SearchPlansRequest) | [SearchPlansResponse](#bytebase-v1-SearchPlansResponse) | Search for plans that the caller has the bb.plans.get permission on and also satisfy the specified filter &amp; query. Permissions required: bb.plans.get |
| CreatePlan | [CreatePlanRequest](#bytebase-v1-CreatePlanRequest) | [Plan](#bytebase-v1-Plan) | Creates a new deployment plan. Permissions required: bb.plans.create |
| UpdatePlan | [UpdatePlanRequest](#bytebase-v1-UpdatePlanRequest) | [Plan](#bytebase-v1-Plan) | UpdatePlan updates the plan. The plan creator and the user with bb.plans.update permission on the project can update the plan. Permissions required: bb.plans.update (or creator) |
-| ListPlanCheckRuns | [ListPlanCheckRunsRequest](#bytebase-v1-ListPlanCheckRunsRequest) | [ListPlanCheckRunsResponse](#bytebase-v1-ListPlanCheckRunsResponse) | Lists plan check runs for a deployment plan. Permissions required: bb.planCheckRuns.list |
+| GetPlanCheckRun | [GetPlanCheckRunRequest](#bytebase-v1-GetPlanCheckRunRequest) | [PlanCheckRun](#bytebase-v1-PlanCheckRun) | Gets the plan check run for a deployment plan. Permissions required: bb.planCheckRuns.get |
| RunPlanChecks | [RunPlanChecksRequest](#bytebase-v1-RunPlanChecksRequest) | [RunPlanChecksResponse](#bytebase-v1-RunPlanChecksResponse) | Executes validation checks on a deployment plan. Permissions required: bb.planCheckRuns.run |
-| BatchCancelPlanCheckRuns | [BatchCancelPlanCheckRunsRequest](#bytebase-v1-BatchCancelPlanCheckRunsRequest) | [BatchCancelPlanCheckRunsResponse](#bytebase-v1-BatchCancelPlanCheckRunsResponse) | Cancels multiple plan check runs. Permissions required: bb.planCheckRuns.run |
+| CancelPlanCheckRun | [CancelPlanCheckRunRequest](#bytebase-v1-CancelPlanCheckRunRequest) | [CancelPlanCheckRunResponse](#bytebase-v1-CancelPlanCheckRunResponse) | Cancels the plan check run for a deployment plan. Permissions required: bb.planCheckRuns.run |
diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.html
index 0fd7fa0486..53b93666ee 100644
--- a/proto/gen/grpc-doc/v1/index.html
+++ b/proto/gen/grpc-doc/v1/index.html
@@ -1880,11 +1880,11 @@
<ul>
<li>
- <a href="#bytebase.v1.BatchCancelPlanCheckRunsRequest"><span class="badge">M</span>BatchCancelPlanCheckRunsRequest</a>
+ <a href="#bytebase.v1.CancelPlanCheckRunRequest"><span class="badge">M</span>CancelPlanCheckRunRequest</a>
</li>
<li>
- <a href="#bytebase.v1.BatchCancelPlanCheckRunsResponse"><span class="badge">M</span>BatchCancelPlanCheckRunsResponse</a>
+ <a href="#bytebase.v1.CancelPlanCheckRunResponse"><span class="badge">M</span>CancelPlanCheckRunResponse</a>
</li>
<li>
@@ -1892,15 +1892,11 @@
</li>
<li>
- <a href="#bytebase.v1.GetPlanRequest"><span class="badge">M</span>GetPlanRequest</a>
- </li>
-
- <li>
- <a href="#bytebase.v1.ListPlanCheckRunsRequest"><span class="badge">M</span>ListPlanCheckRunsRequest</a>
+ <a href="#bytebase.v1.GetPlanCheckRunRequest"><span class="badge">M</span>GetPlanCheckRunRequest</a>
</li>
<li>
- <a href="#bytebase.v1.ListPlanCheckRunsResponse"><span class="badge">M</span>ListPlanCheckRunsResponse</a>
+ <a href="#bytebase.v1.GetPlanRequest"><span class="badge">M</span>GetPlanRequest</a>
</li>
<li>
@@ -21015,7 +21011,7 @@ Permissions required: None (authenticated users only, requires AI to be enabled)
<p></p>
- <h3 id="bytebase.v1.BatchCancelPlanCheckRunsRequest">BatchCancelPlanCheckRunsRequest</h3>
+ <h3 id="bytebase.v1.CancelPlanCheckRunRequest">CancelPlanCheckRunRequest</h3>
<p></p>
@@ -21026,20 +21022,11 @@ Permissions required: None (authenticated users only, requires AI to be enabled)
<tbody>
<tr>
- <td>parent</td>
+ <td>name</td>
<td><a href="#string">string</a></td>
<td></td>
- <td><p>The name of the parent of the planChecks.
-Format: projects/{project}/plans/{plan} </p></td>
- </tr>
-
- <tr>
- <td>plan_check_runs</td>
- <td><a href="#string">string</a></td>
- <td>repeated</td>
- <td><p>TODO(d): update this API.
-The planCheckRuns to cancel.
-Format: projects/{project}/plans/{plan}/planCheckRuns/{planCheckRun} </p></td>
+ <td><p>The name of the plan check run to cancel.
+Format: projects/{project}/plans/{plan}/planCheckRun </p></td>
</tr>
</tbody>
@@ -21049,7 +21036,7 @@ Format: projects/{project}/plans/{plan}/planCheckRuns/{planCheckRun} </p></td>
- <h3 id="bytebase.v1.BatchCancelPlanCheckRunsResponse">BatchCancelPlanCheckRunsResponse</h3>
+ <h3 id="bytebase.v1.CancelPlanCheckRunResponse">CancelPlanCheckRunResponse</h3>
<p></p>
@@ -21088,7 +21075,7 @@ Format: projects/{project} </p></td>
- <h3 id="bytebase.v1.GetPlanRequest">GetPlanRequest</h3>
+ <h3 id="bytebase.v1.GetPlanCheckRunRequest">GetPlanCheckRunRequest</h3>
<p></p>
@@ -21102,8 +21089,8 @@ Format: projects/{project} </p></td>
<td>name</td>
<td><a href="#string">string</a></td>
<td></td>
- <td><p>The name of the plan to retrieve.
-Format: projects/{project}/plans/{plan} </p></td>
+ <td><p>The name of the plan check run to retrieve.
+Format: projects/{project}/plans/{plan}/planCheckRun </p></td>
</tr>
</tbody>
@@ -21113,7 +21100,7 @@ Format: projects/{project}/plans/{plan} </p></td>
- <h3 id="bytebase.v1.ListPlanCheckRunsRequest">ListPlanCheckRunsRequest</h3>
+ <h3 id="bytebase.v1.GetPlanRequest">GetPlanRequest</h3>
<p></p>
@@ -21124,62 +21111,13 @@ Format: projects/{project}/plans/{plan} </p></td>
<tbody>
<tr>
- <td>parent</td>
+ <td>name</td>
<td><a href="#string">string</a></td>
<td></td>
- <td><p>The parent, which owns this collection of plan check runs.
+ <td><p>The name of the plan to retrieve.
Format: projects/{project}/plans/{plan} </p></td>
</tr>
- <tr>
- <td>latest_only</td>
- <td><a href="#bool">bool</a></td>
- <td></td>
- <td><p>If set to true, only the latest plan check run will be returned. </p></td>
- </tr>
-
- <tr>
- <td>filter</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>Filter is used to filter plan check runs returned in the list.
-The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
-
-Supported filters:
-- status: the plan check run status, support &#34;==&#34; and &#34;in&#34; operator, check the Status enum in the PlanCheckRun message for the values.
-- result_status: the plan check run result status, support &#34;==&#34; and &#34;in&#34; operator, check the Result.Status enum in the PlanCheckRun message for the values.
-
-For example:
-status in [&#34;DONE&#34;, &#34;FAILED&#34;]
-status == &#34;RUNNING&#34;
-result_status in [&#34;SUCCESS&#34;, &#34;ERROR&#34;]
-result_status == &#34;WARNING&#34; </p></td>
- </tr>
-
- </tbody>
- </table>
-
-
-
-
-
- <h3 id="bytebase.v1.ListPlanCheckRunsResponse">ListPlanCheckRunsResponse</h3>
- <p></p>
-
-
- <table class="field-table">
- <thead>
- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
- </thead>
- <tbody>
-
- <tr>
- <td>plan_check_runs</td>
- <td><a href="#bytebase.v1.PlanCheckRun">PlanCheckRun</a></td>
- <td>repeated</td>
- <td><p>The plan check runs from the specified request. </p></td>
- </tr>
-
</tbody>
</table>
@@ -21687,7 +21625,7 @@ Leave it empty if no needs to encrypt the zip file. </p></td>
<td>name</td>
<td><a href="#string">string</a></td>
<td></td>
- <td><p>Format: projects/{project}/plans/{plan}/planCheckRuns/{planCheckRun} </p></td>
+ <td><p>Format: projects/{project}/plans/{plan}/planCheckRun </p></td>
</tr>
<tr>
@@ -22180,11 +22118,11 @@ Permissions required: bb.plans.update (or creator)</p></td>
</tr>
<tr>
- <td>ListPlanCheckRuns</td>
- <td><a href="#bytebase.v1.ListPlanCheckRunsRequest">ListPlanCheckRunsRequest</a></td>
- <td><a href="#bytebase.v1.ListPlanCheckRunsResponse">ListPlanCheckRunsResponse</a></td>
- <td><p>Lists plan check runs for a deployment plan.
-Permissions required: bb.planCheckRuns.list</p></td>
+ <td>GetPlanCheckRun</td>
+ <td><a href="#bytebase.v1.GetPlanCheckRunRequest">GetPlanCheckRunRequest</a></td>
+ <td><a href="#bytebase.v1.PlanCheckRun">PlanCheckRun</a></td>
+ <td><p>Gets the plan check run for a deployment plan.
+Permissions required: bb.planCheckRuns.get</p></td>
</tr>
<tr>
@@ -22196,10 +22134,10 @@ Permissions required: bb.planCheckRuns.run</p></td>
</tr>
<tr>
- <td>BatchCancelPlanCheckRuns</td>
- <td><a href="#bytebase.v1.BatchCancelPlanCheckRunsRequest">BatchCancelPlanCheckRunsRequest</a></td>
- <td><a href="#bytebase.v1.BatchCancelPlanCheckRunsResponse">BatchCancelPlanCheckRunsResponse</a></td>
- <td><p>Cancels multiple plan check runs.
+ <td>CancelPlanCheckRun</td>
+ <td><a href="#bytebase.v1.CancelPlanCheckRunRequest">CancelPlanCheckRunRequest</a></td>
+ <td><a href="#bytebase.v1.CancelPlanCheckRunResponse">CancelPlanCheckRunResponse</a></td>
+ <td><p>Cancels the plan check run for a deployment plan.
Permissions required: bb.planCheckRuns.run</p></td>
</tr>
@@ -22274,9 +22212,9 @@ Permissions required: bb.planCheckRuns.run</p></td>
<tr>
- <td>ListPlanCheckRuns</td>
+ <td>GetPlanCheckRun</td>
<td>GET</td>
- <td>/v1/{parent=projects/*/plans/*}/planCheckRuns</td>
+ <td>/v1/{name=projects/*/plans/*/planCheckRun}</td>
<td></td>
</tr>
@@ -22294,9 +22232,9 @@ Permissions required: bb.planCheckRuns.run</p></td>
<tr>
- <td>BatchCancelPlanCheckRuns</td>
+ <td>CancelPlanCheckRun</td>
<td>POST</td>
- <td>/v1/{parent=projects/*/plans/*}/planCheckRuns:batchCancel</td>
+ <td>/v1/{name=projects/*/plans/*/planCheckRun}:cancel</td>
<td>*</td>
</tr>
diff --git a/proto/v1/v1/plan_service.proto b/proto/v1/v1/plan_service.proto
index 75e98322e5..e9fa1cdefc 100644
--- a/proto/v1/v1/plan_service.proto
+++ b/proto/v1/v1/plan_service.proto
@@ -74,12 +74,12 @@ service PlanService {
option (bytebase.v1.audit) = true;
}
- // Lists plan check runs for a deployment plan.
- // Permissions required: bb.planCheckRuns.list
- rpc ListPlanCheckRuns(ListPlanCheckRunsRequest) returns (ListPlanCheckRunsResponse) {
- option (google.api.http) = {get: "/v1/{parent=projects/*/plans/*}/planCheckRuns"};
- option (google.api.method_signature) = "parent";
- option (bytebase.v1.permission) = "bb.planCheckRuns.list";
+ // Gets the plan check run for a deployment plan.
+ // Permissions required: bb.planCheckRuns.get
+ rpc GetPlanCheckRun(GetPlanCheckRunRequest) returns (PlanCheckRun) {
+ option (google.api.http) = {get: "/v1/{name=projects/*/plans/*/planCheckRun}"};
+ option (google.api.method_signature) = "name";
+ option (bytebase.v1.permission) = "bb.planCheckRuns.get";
option (bytebase.v1.auth_method) = IAM;
}
@@ -95,14 +95,14 @@ service PlanService {
option (bytebase.v1.auth_method) = IAM;
}
- // Cancels multiple plan check runs.
+ // Cancels the plan check run for a deployment plan.
// Permissions required: bb.planCheckRuns.run
- rpc BatchCancelPlanCheckRuns(BatchCancelPlanCheckRunsRequest) returns (BatchCancelPlanCheckRunsResponse) {
+ rpc CancelPlanCheckRun(CancelPlanCheckRunRequest) returns (CancelPlanCheckRunResponse) {
option (google.api.http) = {
- post: "/v1/{parent=projects/*/plans/*}/planCheckRuns:batchCancel"
+ post: "/v1/{name=projects/*/plans/*/planCheckRun}:cancel"
body: "*"
};
- option (google.api.method_signature) = "parent";
+ option (google.api.method_signature) = "name";
option (bytebase.v1.permission) = "bb.planCheckRuns.run";
option (bytebase.v1.auth_method) = IAM;
}
@@ -347,35 +347,13 @@ message Plan {
}
}
-message ListPlanCheckRunsRequest {
- // The parent, which owns this collection of plan check runs.
- // Format: projects/{project}/plans/{plan}
- string parent = 1 [
+message GetPlanCheckRunRequest {
+ // The name of the plan check run to retrieve.
+ // Format: projects/{project}/plans/{plan}/planCheckRun
+ string name = 1 [
(google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {type: "bytebase.com/Plan"}
+ (google.api.resource_reference) = {type: "bytebase.com/PlanCheckRun"}
];
-
- // If set to true, only the latest plan check run will be returned.
- bool latest_only = 2;
-
- // Filter is used to filter plan check runs returned in the list.
- // The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
- //
- // Supported filters:
- // - status: the plan check run status, support "==" and "in" operator, check the Status enum in the PlanCheckRun message for the values.
- // - result_status: the plan check run result status, support "==" and "in" operator, check the Result.Status enum in the PlanCheckRun message for the values.
- //
- // For example:
- // status in ["DONE", "FAILED"]
- // status == "RUNNING"
- // result_status in ["SUCCESS", "ERROR"]
- // result_status == "WARNING"
- string filter = 3;
-}
-
-message ListPlanCheckRunsResponse {
- // The plan check runs from the specified request.
- repeated PlanCheckRun plan_check_runs = 1;
}
message RunPlanChecksRequest {
@@ -394,23 +372,24 @@ message RunPlanChecksRequest {
message RunPlanChecksResponse {}
-message BatchCancelPlanCheckRunsRequest {
- // The name of the parent of the planChecks.
- // Format: projects/{project}/plans/{plan}
- string parent = 1 [
+message CancelPlanCheckRunRequest {
+ // The name of the plan check run to cancel.
+ // Format: projects/{project}/plans/{plan}/planCheckRun
+ string name = 1 [
(google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {type: "bytebase.com/Plan"}
+ (google.api.resource_reference) = {type: "bytebase.com/PlanCheckRun"}
];
- // TODO(d): update this API.
- // The planCheckRuns to cancel.
- // Format: projects/{project}/plans/{plan}/planCheckRuns/{planCheckRun}
- repeated string plan_check_runs = 2;
}
-message BatchCancelPlanCheckRunsResponse {}
+message CancelPlanCheckRunResponse {}
message PlanCheckRun {
- // Format: projects/{project}/plans/{plan}/planCheckRuns/{planCheckRun}
+ option (google.api.resource) = {
+ type: "bytebase.com/PlanCheckRun"
+ pattern: "projects/{project}/plans/{plan}/planCheckRun"
+ };
+
+ // Format: projects/{project}/plans/{plan}/planCheckRun
string name = 1;
enum Status {