MCPcopy Create free account
hub / github.com/bytebase/bytebase / GetPlanCheckRun

Method GetPlanCheckRun

backend/api/v1/plan_service.go:439–456  ·  view source on GitHub ↗

GetPlanCheckRun gets the plan check run for the plan.

(ctx context.Context, request *connect.Request[v1pb.GetPlanCheckRunRequest])

Source from the content-addressed store, hash-verified

437
438// GetPlanCheckRun gets the plan check run for the plan.
439func (s *PlanService) GetPlanCheckRun(ctx context.Context, request *connect.Request[v1pb.GetPlanCheckRunRequest]) (*connect.Response[v1pb.PlanCheckRun], error) {
440 req := request.Msg
441 projectID, planUID, err := common.GetProjectIDPlanIDFromPlanCheckRun(req.Name)
442 if err != nil {
443 return nil, connect.NewError(connect.CodeInvalidArgument, err)
444 }
445
446 planCheckRun, err := s.store.GetPlanCheckRun(ctx, projectID, planUID)
447 if err != nil {
448 return nil, connect.NewError(connect.CodeInternal, errors.Wrapf(err, "failed to get plan check run"))
449 }
450 if planCheckRun == nil {
451 return nil, connect.NewError(connect.CodeNotFound, errors.Errorf("plan check run not found for plan %d", planUID))
452 }
453
454 converted := convertToPlanCheckRun(projectID, planUID, planCheckRun)
455 return connect.NewResponse(converted), nil
456}
457
458// RunPlanChecks runs plan checks for a plan.
459func (s *PlanService) RunPlanChecks(ctx context.Context, request *connect.Request[v1pb.RunPlanChecksRequest]) (*connect.Response[v1pb.RunPlanChecksResponse], error) {

Callers

nothing calls this directly

Calls 4

convertToPlanCheckRunFunction · 0.85
ErrorfMethod · 0.80
GetPlanCheckRunMethod · 0.65

Tested by

no test coverage detected