You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by zh...@apache.org on 2022/08/24 06:12:06 UTC
[incubator-devlake] branch main updated: fix(gitlab): add approval to pr_comments (#2820)
This is an automated email from the ASF dual-hosted git repository.
zhangliang2022 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/main by this push:
new 32599674 fix(gitlab): add approval to pr_comments (#2820)
32599674 is described below
commit 325996742cf06216cc9e274b1dd11be2840869c5
Author: Warren Chen <yi...@merico.dev>
AuthorDate: Wed Aug 24 14:12:01 2022 +0800
fix(gitlab): add approval to pr_comments (#2820)
closes #2814
---
plugins/gitlab/tasks/mr_note_extractor.go | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/plugins/gitlab/tasks/mr_note_extractor.go b/plugins/gitlab/tasks/mr_note_extractor.go
index 80761168..aea9bd13 100644
--- a/plugins/gitlab/tasks/mr_note_extractor.go
+++ b/plugins/gitlab/tasks/mr_note_extractor.go
@@ -67,7 +67,7 @@ func ExtractApiMergeRequestsNotes(taskCtx core.SubTaskContext) error {
return nil, err
}
results := make([]interface{}, 0, 2)
- if !toolMrNote.IsSystem {
+ if !toolMrNote.IsSystem || toolMrNote.Body == "approved this merge request" {
toolMrComment := &models.GitlabMrComment{
GitlabId: toolMrNote.GitlabId,
MergeRequestId: toolMrNote.MergeRequestId,
@@ -80,6 +80,9 @@ func ExtractApiMergeRequestsNotes(taskCtx core.SubTaskContext) error {
Type: toolMrNote.Type,
ConnectionId: data.Options.ConnectionId,
}
+ if toolMrNote.Body == "approved this merge request" {
+ toolMrComment.Type = "REVIEW"
+ }
results = append(results, toolMrComment)
}
results = append(results, toolMrNote)