Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions bridge/core/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ const (
// but not severe enough to consider the import a failure.
ImportEventWarning

// The import system (web API) has reached the rate limit
ImportEventRateLimiting

// Error happened during import
ImportEventError
)
Expand Down Expand Up @@ -87,6 +90,8 @@ func (er ImportResult) String() string {
parts = append(parts, fmt.Sprintf("err: %s", er.Err))
}
return strings.Join(parts, " ")
case ImportEventRateLimiting:
return fmt.Sprintf("rate limiting: %s", er.Reason)

default:
panic("unknown import result")
Expand Down Expand Up @@ -165,3 +170,10 @@ func NewImportIdentity(id entity.Id) ImportResult {
Event: ImportEventIdentity,
}
}

func NewImportRateLimiting(msg string) ImportResult {
return ImportResult{
Reason: msg,
Event: ImportEventRateLimiting,
}
}
2 changes: 1 addition & 1 deletion bridge/github/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ func promptUserToGoToBrowser(url, userCode string) {
fmt.Println("Please visit the following Github URL in a browser and enter your user authentication code.")
fmt.Println()
fmt.Println(" URL:", url)
fmt.Println(" user authentiation code:", userCode)
fmt.Println(" user authentication code:", userCode)
fmt.Println()
}

Expand Down
4 changes: 2 additions & 2 deletions bridge/github/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ func (ge *githubExporter) cacheGithubLabels(ctx context.Context, gc *githubv4.Cl
return nil
}

func (ge *githubExporter) getLabelID(gc *githubv4.Client, label string) (string, error) {
func (ge *githubExporter) getLabelID(label string) (string, error) {
label = strings.ToLower(label)
for cachedLabel, ID := range ge.cachedLabels {
if label == strings.ToLower(cachedLabel) {
Expand Down Expand Up @@ -598,7 +598,7 @@ func (ge *githubExporter) createGithubLabelV4(gc *githubv4.Client, label, labelC

func (ge *githubExporter) getOrCreateGithubLabelID(ctx context.Context, gc *githubv4.Client, repositoryID string, label bug.Label) (string, error) {
// try to get label id from cache
labelID, err := ge.getLabelID(gc, string(label))
labelID, err := ge.getLabelID(string(label))
if err == nil {
return labelID, nil
}
Expand Down
2 changes: 1 addition & 1 deletion bridge/github/export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ func TestGithubPushPull(t *testing.T) {
require.True(t, ok)
require.Equal(t, issueOrigin, target)

//TODO: maybe more tests to ensure bug final state
// TODO: maybe more tests to ensure bug final state
})
}
}
Expand Down
Loading