Skip to content

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

fix: send approval notif on re-requesting review (#14625)

p0ny2c2f10853488
diff --git a/backend/api/v1/issue_service.go b/backend/api/v1/issue_service.go
index 79dacd28f3..69d5960a53 100644
--- a/backend/api/v1/issue_service.go
+++ b/backend/api/v1/issue_service.go
@@ -1069,6 +1069,31 @@ func (s *IssueService) RequestIssue(ctx context.Context, request *v1pb.RequestIs
return nil, status.Errorf(codes.Internal, "failed to update issue, error: %v", err)
}
+ if err := func() error {
+ if len(payload.Approval.ApprovalTemplates) != 1 {
+ return nil
+ }
+ approvalStep := utils.FindNextPendingStep(payload.Approval.ApprovalTemplates[0], payload.Approval.Approvers)
+ if approvalStep == nil {
+ return nil
+ }
+
+ s.webhookManager.CreateEvent(ctx, &webhook.Event{
+ Actor: s.store.GetSystemBotUser(ctx),
+ Type: webhook.EventTypeIssueApprovalCreate,
+ Comment: "",
+ Issue: webhook.NewIssue(issue),
+ Project: webhook.NewProject(issue.Project),
+ IssueApprovalCreate: &webhook.EventIssueApprovalCreate{
+ ApprovalStep: approvalStep,
+ },
+ })
+
+ return nil
+ }(); err != nil {
+ slog.Error("failed to create approval step pending activity after re-request issue review", log.BBError(err))
+ }
+
if err := func() error {
p := &storepb.IssueCommentPayload{
Comment: request.Comment,