Converters section - ordered with callers before callees. getPlanCheckRunFromPlan returns the plan check run for a plan.
(ctx context.Context, s *store.Store, project *store.ProjectMessage, plan *store.PlanMessage, databaseGroup *v1pb.DatabaseGroup)
| 808 | |
| 809 | // getPlanCheckRunFromPlan returns the plan check run for a plan. |
| 810 | func getPlanCheckRunFromPlan(ctx context.Context, s *store.Store, project *store.ProjectMessage, plan *store.PlanMessage, databaseGroup *v1pb.DatabaseGroup) (*store.PlanCheckRunMessage, error) { |
| 811 | targets, err := plancheck.DeriveCheckTargets(ctx, s, project, plan, databaseGroup) |
| 812 | if err != nil { |
| 813 | return nil, err |
| 814 | } |
| 815 | |
| 816 | if len(targets) == 0 { |
| 817 | return nil, nil |
| 818 | } |
| 819 | |
| 820 | return &store.PlanCheckRunMessage{ |
| 821 | ProjectID: plan.ProjectID, |
| 822 | PlanUID: plan.UID, |
| 823 | Status: store.PlanCheckRunStatusRunning, |
| 824 | }, nil |
| 825 | } |
| 826 | |
| 827 | func convertToPlans(ctx context.Context, s *store.Store, plans []*store.PlanMessage) ([]*v1pb.Plan, error) { |
| 828 | if len(plans) == 0 { |
no test coverage detected