aboutsummaryrefslogtreecommitdiffstats
path: root/bridge
diff options
context:
space:
mode:
Diffstat (limited to 'bridge')
-rw-r--r--bridge/github/export.go6
-rw-r--r--bridge/github/import_integration_test.go3
-rw-r--r--bridge/github/import_test.go6
-rw-r--r--bridge/gitlab/import_test.go6
-rw-r--r--bridge/jira/client.go4
-rw-r--r--bridge/jira/import.go2
6 files changed, 14 insertions, 13 deletions
diff --git a/bridge/github/export.go b/bridge/github/export.go
index 6f882637..8cea9314 100644
--- a/bridge/github/export.go
+++ b/bridge/github/export.go
@@ -595,7 +595,7 @@ func (ge *githubExporter) createGithubLabelV4(gc *githubv4.Client, label, labelC
}
*/
-func (ge *githubExporter) getOrCreateGithubLabelID(ctx context.Context, gc *rateLimitHandlerClient, repositoryID string, label bug.Label) (string, error) {
+func (ge *githubExporter) getOrCreateGithubLabelID(ctx context.Context, gc *rateLimitHandlerClient, repositoryID string, label common.Label) (string, error) {
// try to get label id from cache
labelID, err := ge.getLabelID(string(label))
if err == nil {
@@ -617,7 +617,7 @@ func (ge *githubExporter) getOrCreateGithubLabelID(ctx context.Context, gc *rate
return labelID, nil
}
-func (ge *githubExporter) getLabelsIDs(ctx context.Context, gc *rateLimitHandlerClient, repositoryID string, labels []bug.Label) ([]githubv4.ID, error) {
+func (ge *githubExporter) getLabelsIDs(ctx context.Context, gc *rateLimitHandlerClient, repositoryID string, labels []common.Label) ([]githubv4.ID, error) {
ids := make([]githubv4.ID, 0, len(labels))
var err error
@@ -744,7 +744,7 @@ func (ge *githubExporter) updateGithubIssueTitle(ctx context.Context, gc *rateLi
}
// update github issue labels
-func (ge *githubExporter) updateGithubIssueLabels(ctx context.Context, gc *rateLimitHandlerClient, labelableID string, added, removed []bug.Label) error {
+func (ge *githubExporter) updateGithubIssueLabels(ctx context.Context, gc *rateLimitHandlerClient, labelableID string, added, removed []common.Label) error {
wg, ctx := errgroup.WithContext(ctx)
if len(added) > 0 {
diff --git a/bridge/github/import_integration_test.go b/bridge/github/import_integration_test.go
index a642d374..365427e1 100644
--- a/bridge/github/import_integration_test.go
+++ b/bridge/github/import_integration_test.go
@@ -14,6 +14,7 @@ import (
"github.com/git-bug/git-bug/bridge/github/mocks"
"github.com/git-bug/git-bug/cache"
"github.com/git-bug/git-bug/entities/bug"
+ "github.com/git-bug/git-bug/entities/common"
"github.com/git-bug/git-bug/repository"
"github.com/git-bug/git-bug/util/interrupt"
)
@@ -64,7 +65,7 @@ func TestGithubImporterIntegration(t *testing.T) {
ops3 := b3.Snapshot().Operations
require.Equal(t, "issue 3 comment 1", ops3[1].(*bug.AddCommentOperation).Message)
require.Equal(t, "issue 3 comment 2", ops3[2].(*bug.AddCommentOperation).Message)
- require.Equal(t, []bug.Label{"bug"}, ops3[3].(*bug.LabelChangeOperation).Added)
+ require.Equal(t, []common.Label{"bug"}, ops3[3].(*bug.LabelChangeOperation).Added)
require.Equal(t, "title 3, edit 1", ops3[4].(*bug.SetTitleOperation).Title)
b4, err := backend.Bugs().ResolveBugCreateMetadata(metaKeyGithubUrl, "https://github.com/marcus/to-himself/issues/4")
diff --git a/bridge/github/import_test.go b/bridge/github/import_test.go
index 80be5116..3d583c36 100644
--- a/bridge/github/import_test.go
+++ b/bridge/github/import_test.go
@@ -72,9 +72,9 @@ func TestGithubImporter(t *testing.T) {
bug: &bug.Snapshot{
Operations: []dag.Operation{
bug.NewCreateOp(author, 0, "complex issue", "initial comment", nil),
- bug.NewLabelChangeOperation(author, 0, []bug.Label{"bug"}, []bug.Label{}),
- bug.NewLabelChangeOperation(author, 0, []bug.Label{"duplicate"}, []bug.Label{}),
- bug.NewLabelChangeOperation(author, 0, []bug.Label{}, []bug.Label{"duplicate"}),
+ bug.NewLabelChangeOperation(author, 0, []common.Label{"bug"}, []common.Label{}),
+ bug.NewLabelChangeOperation(author, 0, []common.Label{"duplicate"}, []common.Label{}),
+ bug.NewLabelChangeOperation(author, 0, []common.Label{}, []common.Label{"duplicate"}),
bug.NewAddCommentOp(author, 0, strings.Join([]string{
"### header",
"**bold**",
diff --git a/bridge/gitlab/import_test.go b/bridge/gitlab/import_test.go
index 2190369b..56feee46 100644
--- a/bridge/gitlab/import_test.go
+++ b/bridge/gitlab/import_test.go
@@ -78,9 +78,9 @@ func TestGitlabImport(t *testing.T) {
bug.NewSetTitleOp(author, 0, "complex issue", "complex issue edited"),
bug.NewSetStatusOp(author, 0, common.ClosedStatus),
bug.NewSetStatusOp(author, 0, common.OpenStatus),
- bug.NewLabelChangeOperation(author, 0, []bug.Label{"bug"}, []bug.Label{}),
- bug.NewLabelChangeOperation(author, 0, []bug.Label{"critical"}, []bug.Label{}),
- bug.NewLabelChangeOperation(author, 0, []bug.Label{}, []bug.Label{"critical"}),
+ bug.NewLabelChangeOperation(author, 0, []common.Label{"bug"}, []common.Label{}),
+ bug.NewLabelChangeOperation(author, 0, []common.Label{"critical"}, []common.Label{}),
+ bug.NewLabelChangeOperation(author, 0, []common.Label{}, []common.Label{"critical"}),
},
},
},
diff --git a/bridge/jira/client.go b/bridge/jira/client.go
index 53dfad6e..95856f05 100644
--- a/bridge/jira/client.go
+++ b/bridge/jira/client.go
@@ -16,7 +16,7 @@ import (
"github.com/pkg/errors"
- "github.com/git-bug/git-bug/entities/bug"
+ "github.com/git-bug/git-bug/entities/common"
)
var errDone = errors.New("Iteration Done")
@@ -1230,7 +1230,7 @@ func (client *Client) UpdateComment(issueKeyOrID, commentID, body string) (
}
// UpdateLabels changes labels for an issue
-func (client *Client) UpdateLabels(issueKeyOrID string, added, removed []bug.Label) (time.Time, error) {
+func (client *Client) UpdateLabels(issueKeyOrID string, added, removed []common.Label) (time.Time, error) {
url := fmt.Sprintf(
"%s/rest/api/2/issue/%s/", client.serverURL, issueKeyOrID)
var responseTime time.Time
diff --git a/bridge/jira/import.go b/bridge/jira/import.go
index 0d7d1f1e..bd5a67d8 100644
--- a/bridge/jira/import.go
+++ b/bridge/jira/import.go
@@ -357,7 +357,7 @@ func getIndexDerivedID(jiraID string, idx int) string {
return fmt.Sprintf("%s-%d", jiraID, idx)
}
-func labelSetsMatch(jiraSet []string, gitbugSet []bug.Label) bool {
+func labelSetsMatch(jiraSet []string, gitbugSet []common.Label) bool {
if len(jiraSet) != len(gitbugSet) {
return false
}