From f7ea3421caa2c8957a82454255c4fdd699b70a9c Mon Sep 17 00:00:00 2001 From: Amine Hilaly Date: Sat, 4 May 2019 13:19:56 +0200 Subject: Add ForceLabelChange functionalities --- bridge/github/import.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'bridge/github') diff --git a/bridge/github/import.go b/bridge/github/import.go index 4960117a..5f99b5ea 100644 --- a/bridge/github/import.go +++ b/bridge/github/import.go @@ -40,7 +40,7 @@ func (gi *githubImporter) ImportAll(repo *cache.RepoCache, since time.Time) erro for gi.iterator.NextIssue() { issue := gi.iterator.IssueValue() - fmt.Printf("importing issue: %v\n", gi.iterator.count) + fmt.Printf("importing issue: %v %v\n", gi.iterator.count, issue.Title) // get issue edits issueEdits := []userContentEdit{} for gi.iterator.NextIssueEdit() { @@ -71,12 +71,12 @@ func (gi *githubImporter) ImportAll(repo *cache.RepoCache, since time.Time) erro err := gi.ensureTimelineComment(repo, b, item.IssueComment, commentEdits) if err != nil { - return fmt.Errorf("timeline event creation: %v", err) + return fmt.Errorf("timeline comment creation: %v", err) } } else { if err := gi.ensureTimelineItem(repo, b, item); err != nil { - return fmt.Errorf("timeline comment creation: %v", err) + return fmt.Errorf("timeline event creation: %v", err) } } } @@ -189,7 +189,7 @@ func (gi *githubImporter) ensureTimelineItem(repo *cache.RepoCache, b *cache.Bug if err != nil { return err } - _, _, err = b.ChangeLabelsRaw( + _, err = b.ForceChangeLabelsRaw( author, item.LabeledEvent.CreatedAt.Unix(), []string{ @@ -198,6 +198,7 @@ func (gi *githubImporter) ensureTimelineItem(repo *cache.RepoCache, b *cache.Bug nil, map[string]string{keyGithubId: id}, ) + return err case "UnlabeledEvent": @@ -211,7 +212,7 @@ func (gi *githubImporter) ensureTimelineItem(repo *cache.RepoCache, b *cache.Bug return err } - _, _, err = b.ChangeLabelsRaw( + _, err = b.ForceChangeLabelsRaw( author, item.UnlabeledEvent.CreatedAt.Unix(), nil, -- cgit