diff options
author | Amine Hilaly <hilalyamine@gmail.com> | 2019-07-22 18:56:14 +0200 |
---|---|---|
committer | Amine Hilaly <hilalyamine@gmail.com> | 2019-07-23 17:18:04 +0200 |
commit | ece2cb126293361212d7673fea976876af7b811b (patch) | |
tree | f0ad5735e51719f5b41099f379ff1f2ee9446b8b /bridge/gitlab/import.go | |
parent | 54dd81e3376ef557b5be3aa642accec219005949 (diff) | |
download | git-bug-ece2cb126293361212d7673fea976876af7b811b.tar.gz |
bridge/gitlab: improve tests and errors
bridge/gitlab: global fixes
Diffstat (limited to 'bridge/gitlab/import.go')
-rw-r--r-- | bridge/gitlab/import.go | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/bridge/gitlab/import.go b/bridge/gitlab/import.go index b2db13d0..67d9aa25 100644 --- a/bridge/gitlab/import.go +++ b/bridge/gitlab/import.go @@ -95,7 +95,7 @@ func (gi *gitlabImporter) ensureIssue(repo *cache.RepoCache, issue *gitlab.Issue // if bug was never imported if err == bug.ErrBugNotExist { - cleanText, err := text.Cleanup(string(issue.Description)) + cleanText, err := text.Cleanup(issue.Description) if err != nil { return nil, err } @@ -261,10 +261,12 @@ func (gi *gitlabImporter) ensureNote(repo *cache.RepoCache, b *cache.BugCache, n return err - default: - // non handled note types, this is not an error + case NOTE_UNKNOWN: //TODO: send warning via channel return nil + + default: + panic("unhandled note type") } return nil @@ -322,9 +324,6 @@ func (gi *gitlabImporter) ensurePerson(repo *cache.RepoCache, id int) (*cache.Id return nil, err } - // importing a new identity - gi.importedIdentities++ - client := buildClient(gi.conf["token"]) user, _, err := client.Users.GetUser(id) @@ -332,6 +331,9 @@ func (gi *gitlabImporter) ensurePerson(repo *cache.RepoCache, id int) (*cache.Id return nil, err } + // importing a new identity + gi.importedIdentities++ + return repo.NewIdentityRaw( user.Name, user.PublicEmail, |