GetPlanCheckRun gets the plan check run for the plan.
(ctx context.Context, request *connect.Request[v1pb.GetPlanCheckRunRequest])
| 437 | |
| 438 | // GetPlanCheckRun gets the plan check run for the plan. |
| 439 | func (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. |
| 459 | func (s *PlanService) RunPlanChecks(ctx context.Context, request *connect.Request[v1pb.RunPlanChecksRequest]) (*connect.Response[v1pb.RunPlanChecksResponse], error) { |
nothing calls this directly
no test coverage detected