diff options
author | Vladimir Buyanov <81759784+cl-bvl@users.noreply.github.com> | 2023-06-08 11:56:05 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-08 16:56:05 +0800 |
commit | 3bdd48016f659c440d6e8bb57386fab7ad7b357b (patch) | |
tree | 7cf65016a18ce0e3d0e96e29838d40008f4306fe /services | |
parent | b5a2bb9ab347fb5aaa6c6ca95dfd1b31751f1fba (diff) | |
download | gitea-3bdd48016f659c440d6e8bb57386fab7ad7b357b.tar.gz gitea-3bdd48016f659c440d6e8bb57386fab7ad7b357b.zip |
Add codeowners feature (#24910)
Hello.
This PR adds a github like configuration for the CODEOWNERS file.
Resolves: #10161
Diffstat (limited to 'services')
-rw-r--r-- | services/issue/issue.go | 6 | ||||
-rw-r--r-- | services/pull/pull.go | 7 |
2 files changed, 13 insertions, 0 deletions
diff --git a/services/issue/issue.go b/services/issue/issue.go index ce2b1c0976..61890c75de 100644 --- a/services/issue/issue.go +++ b/services/issue/issue.go @@ -57,6 +57,12 @@ func ChangeTitle(ctx context.Context, issue *issues_model.Issue, doer *user_mode return } + if issue.IsPull && issues_model.HasWorkInProgressPrefix(oldTitle) && !issues_model.HasWorkInProgressPrefix(title) { + if err = issues_model.PullRequestCodeOwnersReview(ctx, issue, issue.PullRequest); err != nil { + return + } + } + notification.NotifyIssueChangeTitle(ctx, doer, issue, oldTitle) return nil diff --git a/services/pull/pull.go b/services/pull/pull.go index 8f2befa8ff..f44e690ab7 100644 --- a/services/pull/pull.go +++ b/services/pull/pull.go @@ -123,6 +123,13 @@ func NewPullRequest(ctx context.Context, repo *repo_model.Repository, pull *issu } _, _ = issue_service.CreateComment(ctx, ops) + + if !pr.IsWorkInProgress() { + if err := issues_model.PullRequestCodeOwnersReview(ctx, pull, pr); err != nil { + return err + } + } + } return nil |