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

Function getPlanCheckRunFromPlan

backend/api/v1/plan_service.go:810–825  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

808
809// getPlanCheckRunFromPlan returns the plan check run for a plan.
810func 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
827func convertToPlans(ctx context.Context, s *store.Store, plans []*store.PlanMessage) ([]*v1pb.Plan, error) {
828 if len(plans) == 0 {

Callers 3

CreatePlanMethod · 0.85
UpdatePlanMethod · 0.85
RunPlanChecksMethod · 0.85

Calls 1

DeriveCheckTargetsFunction · 0.92

Tested by

no test coverage detected