aboutsummaryrefslogtreecommitdiffstats
path: root/bridge
diff options
context:
space:
mode:
authorAmine Hilaly <hilalyamine@gmail.com>2019-08-11 00:08:26 +0200
committerAmine Hilaly <hilalyamine@gmail.com>2019-08-11 00:08:26 +0200
commitca5e40e5236e2ce2e3b4604ebdce857206163ae4 (patch)
treea724702af5fb0d7893f4ef3d3044abf0e10340bd /bridge
parent2c3034a0abe13eb6b07d8dd13041e7be4adc6f93 (diff)
downloadgit-bug-ca5e40e5236e2ce2e3b4604ebdce857206163ae4.tar.gz
bridge/gitlab: importer handle mentions in other issue and merge requests
Diffstat (limited to 'bridge')
-rw-r--r--bridge/gitlab/import.go4
-rw-r--r--bridge/gitlab/import_notes.go10
2 files changed, 13 insertions, 1 deletions
diff --git a/bridge/gitlab/import.go b/bridge/gitlab/import.go
index dbedfda8..360a585f 100644
--- a/bridge/gitlab/import.go
+++ b/bridge/gitlab/import.go
@@ -267,7 +267,9 @@ func (gi *gitlabImporter) ensureNote(repo *cache.RepoCache, b *cache.BugCache, n
NOTE_CHANGED_DUEDATE,
NOTE_REMOVED_DUEDATE,
NOTE_LOCKED,
- NOTE_UNLOCKED:
+ NOTE_UNLOCKED,
+ NOTE_MENTIONED_IN_ISSUE,
+ NOTE_MENTIONED_IN_MERGE_REQUEST:
return nil
default:
diff --git a/bridge/gitlab/import_notes.go b/bridge/gitlab/import_notes.go
index 85da3158..c0796037 100644
--- a/bridge/gitlab/import_notes.go
+++ b/bridge/gitlab/import_notes.go
@@ -23,6 +23,8 @@ const (
NOTE_UNASSIGNED
NOTE_CHANGED_MILESTONE
NOTE_REMOVED_MILESTONE
+ NOTE_MENTIONED_IN_ISSUE
+ NOTE_MENTIONED_IN_MERGE_REQUEST
NOTE_UNKNOWN
)
@@ -83,6 +85,14 @@ func GetNoteType(n *gitlab.Note) (NoteType, string) {
return NOTE_REMOVED_MILESTONE, ""
}
+ if strings.HasPrefix(n.Body, "mentioned in issue") {
+ return NOTE_MENTIONED_IN_ISSUE, ""
+ }
+
+ if strings.HasPrefix(n.Body, "mentioned in merge request") {
+ return NOTE_MENTIONED_IN_MERGE_REQUEST, ""
+ }
+
return NOTE_UNKNOWN, ""
}