From bc1b2969ef318f2068d48d8957b1d0df52486c7b Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Wed, 21 Aug 2024 20:17:07 -0700 Subject: [PATCH] revert unnecessary change --- services/pull/pull.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/services/pull/pull.go b/services/pull/pull.go index 4f68a3084c..cba94a711f 100644 --- a/services/pull/pull.go +++ b/services/pull/pull.go @@ -128,13 +128,6 @@ func NewPullRequest(ctx context.Context, repo *repo_model.Repository, issue *iss return err } - if !pr.IsWorkInProgress(ctx) { - reviewNotifiers, err = issue_service.PullRequestCodeOwnersReview(ctx, issue, pr) - if err != nil { - return err - } - } - if pr.Flow == issues_model.PullRequestFlowGithub { devLinks, err := issues_model.FindDevLinksByBranch(ctx, issue.RepoID, pr.HeadRepoID, pr.HeadBranch) if err != nil { @@ -152,7 +145,6 @@ func NewPullRequest(ctx context.Context, repo *repo_model.Repository, issue *iss } } - // leave creating comment last compareInfo, err := baseGitRepo.GetCompareInfo(pr.BaseRepo.RepoPath(), git.BranchPrefix+pr.BaseBranch, pr.GetGitRefName(), false, false) if err != nil { @@ -186,6 +178,13 @@ func NewPullRequest(ctx context.Context, repo *repo_model.Repository, issue *iss return err } + if !pr.IsWorkInProgress(ctx) { + reviewNotifiers, err = issue_service.PullRequestCodeOwnersReview(ctx, issue, pr) + if err != nil { + return err + } + } + return nil }); err != nil { // cleanup: this will only remove the reference, the real commit will be clean up when next GC