diff --git a/bridge/gitlab/gitlab.go b/bridge/gitlab/gitlab.go index d0faf1efaa2f3ec8b41b4e19d165bfe48a6de130..743ab1728de114c25f114f431844f76e8538c1d3 100644 --- a/bridge/gitlab/gitlab.go +++ b/bridge/gitlab/gitlab.go @@ -1,6 +1,7 @@ package gitlab import ( + "net/http" "time" "github.com/xanzy/go-gitlab" @@ -9,9 +10,7 @@ import ( ) const ( - target = "gitlab" - gitlabV4Url = "https://gitlab.com/api/v4" - + target = "gitlab" keyProjectID = "project-id" keyGitlabId = "gitlab-id" keyGitlabUrl = "gitlab-url" @@ -42,10 +41,9 @@ func (*Gitlab) NewExporter() core.Exporter { } func buildClient(token string) *gitlab.Client { - return gitlab.NewClient(nil, token) -} - -func buildClientFromUsernameAndPassword(username, password string) (*gitlab.Client, error) { - return gitlab.NewBasicAuthClient(nil, "https://gitlab.com", username, password) + client := &http.Client{ + Timeout: defaultTimeout, + } + return gitlab.NewClient(client, token) } diff --git a/bridge/gitlab/import.go b/bridge/gitlab/import.go index 6227767b68858fab35caa1843e62de7610aa6c58..6869a1034ee77129758f50ae64007ff6ae58ccb0 100644 --- a/bridge/gitlab/import.go +++ b/bridge/gitlab/import.go @@ -120,7 +120,7 @@ func (gi *gitlabImporter) ensureIssue(repo *cache.RepoCache, issue *gitlab.Issue return b, nil } - return nil, nil + return b, nil } func (gi *gitlabImporter) ensureNote(repo *cache.RepoCache, b *cache.BugCache, note *gitlab.Note) error {