Merge pull request #195 from A-Hilaly/gitlab-import-fix

bridge/gitlab: importer handle mentions in other issue and merge requets
This commit is contained in:
Amine 2019-08-11 00:22:57 +02:00 committed by GitHub
commit 146894a565
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View File

@ -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:

View File

@ -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, ""
}