Skip to content

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

feat: CreatePlan validates plan by calling GetPipelineCreate (#10385)

p0ny0b5532f1229a
diff --git a/backend/api/v1/rollout_service.go b/backend/api/v1/rollout_service.go
index 1d6515de9a..9224a586fd 100644
--- a/backend/api/v1/rollout_service.go
+++ b/backend/api/v1/rollout_service.go
@@ -187,6 +187,9 @@ func (s *RolloutService) CreatePlan(ctx context.Context, request *v1pb.CreatePla
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to create plan, error: %v", err)
}
+ if _, err := GetPipelineCreate(ctx, s.store, s.licenseService, s.dbFactory, plan.Config.GetSteps(), project); err != nil {
+ return nil, status.Errorf(codes.InvalidArgument, "failed to get pipeline from the plan, please check you request, error: %v", err)
+ }
planCheckRuns, err := getPlanCheckRunsFromPlan(ctx, s.store, plan)
if err != nil {