From c34dd4a8e606369f12838117f7201fabe2ca8d8b Mon Sep 17 00:00:00 2001 From: bb-ben <70356237+bboerben@users.noreply.github.com> Date: Sat, 2 Nov 2024 15:08:35 +0800 Subject: [PATCH] postpone the review request notification the review requet notifaction is now sent after the new pull request notification. --- services/pull/pull.go | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/services/pull/pull.go b/services/pull/pull.go index db2c23a2fe..7e7006d305 100644 --- a/services/pull/pull.go +++ b/services/pull/pull.go @@ -147,10 +147,6 @@ func NewPullRequest(ctx context.Context, repo *repo_model.Repository, issue *iss if err != nil { return err } - _, err = issue_service.ReviewRequest(ctx, issue, issue.Poster, reviewer, true) - if err != nil { - return err - } } pr.Issue = issue @@ -235,6 +231,17 @@ func NewPullRequest(ctx context.Context, repo *repo_model.Repository, issue *iss notify_service.IssueChangeAssignee(ctx, issue.Poster, issue, assignee, false, assigneeCommentMap[assigneeID]) } + for _, reviewerID := range reviewerIDs { + reviewer, err := user_model.GetUserByID(ctx, reviewerID) + if err != nil { + return ErrDependenciesLeft + } + _, err = issue_service.ReviewRequest(ctx, issue, issue.Poster, reviewer, true) + if err != nil { + return err + } + } + return nil }