diff options
author | Amine <hilalyamine@gmail.com> | 2019-08-11 00:22:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-11 00:22:57 +0200 |
commit | 146894a5657d3b20dbaf769a950b12bd19df499c (patch) | |
tree | a724702af5fb0d7893f4ef3d3044abf0e10340bd /bridge | |
parent | 2c3034a0abe13eb6b07d8dd13041e7be4adc6f93 (diff) | |
parent | ca5e40e5236e2ce2e3b4604ebdce857206163ae4 (diff) | |
download | git-bug-146894a5657d3b20dbaf769a950b12bd19df499c.tar.gz |
Merge pull request #195 from A-Hilaly/gitlab-import-fix
bridge/gitlab: importer handle mentions in other issue and merge requets
Diffstat (limited to 'bridge')
-rw-r--r-- | bridge/gitlab/import.go | 4 | ||||
-rw-r--r-- | bridge/gitlab/import_notes.go | 10 |
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, "" } |