diff options
Diffstat (limited to 'bridge/github/import.go')
-rw-r--r-- | bridge/github/import.go | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/bridge/github/import.go b/bridge/github/import.go index ae3ca81d..2b9e5561 100644 --- a/bridge/github/import.go +++ b/bridge/github/import.go @@ -39,12 +39,8 @@ func (gi *githubImporter) Init(conf core.Configuration) error { return nil } -func (gi *githubImporter) Reset() { - gi.importedIssues = 0 - gi.importedIdentities = 0 -} - -// ImportAll . +// ImportAll iterate over all the configured repository issues and ensure the creation of the +// missing issues / timeline items / edits / label events ... func (gi *githubImporter) ImportAll(repo *cache.RepoCache, since time.Time) error { gi.iterator = NewIterator(gi.conf[keyUser], gi.conf[keyProject], gi.conf[keyToken], since) @@ -60,9 +56,9 @@ func (gi *githubImporter) ImportAll(repo *cache.RepoCache, since time.Time) erro } // loop over timeline items - for gi.iterator.NextTimeline() { - if err := gi.ensureTimelineItem(repo, b, gi.iterator.TimelineValue()); err != nil { - return fmt.Errorf("timeline event creation: %v", err) + for gi.iterator.NextTimelineItem() { + if err := gi.ensureTimelineItem(repo, b, gi.iterator.TimelineItemValue()); err != nil { + return fmt.Errorf("timeline item creation: %v", err) } } @@ -77,8 +73,7 @@ func (gi *githubImporter) ImportAll(repo *cache.RepoCache, since time.Time) erro return err } - fmt.Printf("Successfully imported %d issues from Github\n", gi.importedIssues) - fmt.Printf("Total imported identities: %d\n", gi.importedIdentities) + fmt.Printf("Successfully imported %d issues and %d identities from Github\n", gi.importedIssues, gi.importedIdentities) return nil } @@ -160,6 +155,9 @@ func (gi *githubImporter) ensureIssue(repo *cache.RepoCache, issue issueTimeline return nil, err } + // importing a new bug + gi.importedIssues++ + continue } |