aboutsummaryrefslogtreecommitdiffstats
path: root/bridge
diff options
context:
space:
mode:
authorAmine Hilaly <hilalyamine@gmail.com>2019-08-17 23:46:10 +0200
committerAmine Hilaly <hilalyamine@gmail.com>2019-08-18 23:50:13 +0200
commitdf412430ab35106df57bc32d6dd01bd088bf4735 (patch)
treeea126fb14a3d5abcdfb66e0128c9cbd044f6cb02 /bridge
parent501a9310807d4c53cf9e28b84d88aebd64a04ead (diff)
downloadgit-bug-df412430ab35106df57bc32d6dd01bd088bf4735.tar.gz
bridge/github: improve error handling and Nothing events
vendor: add package golang.org/x/sync/errgroup
Diffstat (limited to 'bridge')
-rw-r--r--bridge/core/export.go4
-rw-r--r--bridge/core/import.go4
-rw-r--r--bridge/github/import.go3
-rw-r--r--bridge/gitlab/import.go3
4 files changed, 6 insertions, 8 deletions
diff --git a/bridge/core/export.go b/bridge/core/export.go
index 55cf5a60..ceae1401 100644
--- a/bridge/core/export.go
+++ b/bridge/core/export.go
@@ -46,9 +46,9 @@ func (er ExportResult) String() string {
return fmt.Sprintf("changed label: %s", er.ID)
case ExportEventNothing:
if er.ID != "" {
- return fmt.Sprintf("ignoring export event %s: %s", er.ID, er.Reason)
+ return fmt.Sprintf("no actions taken for event %s: %s", er.ID, er.Reason)
}
- return fmt.Sprintf("ignoring export event: %s", er.Reason)
+ return fmt.Sprintf("no actions taken: %s", er.Reason)
case ExportEventError:
if er.ID != "" {
return fmt.Sprintf("export error at %s: %s", er.ID, er.Err.Error())
diff --git a/bridge/core/import.go b/bridge/core/import.go
index 0961e00b..cff30f61 100644
--- a/bridge/core/import.go
+++ b/bridge/core/import.go
@@ -49,9 +49,9 @@ func (er ImportResult) String() string {
return fmt.Sprintf("new identity: %s", er.ID)
case ImportEventNothing:
if er.ID != "" {
- return fmt.Sprintf("ignoring import event %s: %s", er.ID, er.Reason)
+ return fmt.Sprintf("no action taken for event %s: %s", er.ID, er.Reason)
}
- return fmt.Sprintf("ignoring event: %s", er.Reason)
+ return fmt.Sprintf("no action taken: %s", er.Reason)
case ImportEventError:
if er.ID != "" {
return fmt.Sprintf("import error at id %s: %s", er.ID, er.Err.Error())
diff --git a/bridge/github/import.go b/bridge/github/import.go
index 9fef9cb5..7c4deb50 100644
--- a/bridge/github/import.go
+++ b/bridge/github/import.go
@@ -369,8 +369,7 @@ func (gi *githubImporter) ensureTimelineComment(repo *cache.RepoCache, b *cache.
targetOpID, err := b.ResolveOperationWithMetadata(keyGithubId, parseId(item.Id))
if err == nil {
- reason := fmt.Sprintf("comment already imported")
- gi.out <- core.NewImportNothing("", reason)
+ gi.out <- core.NewImportNothing("", "comment already imported")
} else if err != cache.ErrNoMatchingOp {
// real error
return err
diff --git a/bridge/gitlab/import.go b/bridge/gitlab/import.go
index 40ac06d3..1391bf88 100644
--- a/bridge/gitlab/import.go
+++ b/bridge/gitlab/import.go
@@ -99,8 +99,7 @@ func (gi *gitlabImporter) ensureIssue(repo *cache.RepoCache, issue *gitlab.Issue
// resolve bug
b, err := repo.ResolveBugCreateMetadata(keyGitlabUrl, issue.WebURL)
if err == nil {
- reason := fmt.Sprintf("bug already imported")
- gi.out <- core.NewImportNothing("", reason)
+ gi.out <- core.NewImportNothing("", "bug already imported")
return b, nil
}
if err != bug.ErrBugNotExist {