Skip to content

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

chore: disallow to update release-created plans (#15319)

p0nydd4bc07d722b
diff --git a/backend/api/v1/plan_service.go b/backend/api/v1/plan_service.go
index 163f2aed5d..4f45f8f029 100644
--- a/backend/api/v1/plan_service.go
+++ b/backend/api/v1/plan_service.go
@@ -323,6 +323,10 @@ func (s *PlanService) UpdatePlan(ctx context.Context, request *v1pb.UpdatePlanRe
return nil, status.Errorf(codes.NotFound, "plan %q not found", request.Plan.Name)
}
+ if oldPlan.Config.GetReleaseSource().GetRelease() != "" && slices.Contains(request.UpdateMask.Paths, "steps") {
+ return nil, status.Errorf(codes.InvalidArgument, "disallowed to update the plan steps because the plan is created from a release")
+ }
+
ok, err = func() (bool, error) {
if oldPlan.CreatorUID == user.ID {
return true, nil