repair after rebase

Josh Bialkowski created

Change summary

bridge/jira/config.go              | 20 ++++++++++----------
bridge/jira/export.go              |  5 +++--
bridge/jira/import.go              | 11 ++++++-----
bridge/jira/jira.go                |  4 ----
doc/md/git-bug_bridge_configure.md |  2 +-
5 files changed, 20 insertions(+), 22 deletions(-)

Detailed changes

bridge/jira/config.go 🔗

@@ -13,8 +13,8 @@ import (
 	"github.com/pkg/errors"
 
 	"github.com/MichaelMure/git-bug/bridge/core"
+	"github.com/MichaelMure/git-bug/cache"
 	"github.com/MichaelMure/git-bug/input"
-	"github.com/MichaelMure/git-bug/repository"
 )
 
 const (
@@ -66,7 +66,7 @@ How would you like to store your JIRA login credentials?
 
 // Configure sets up the bridge configuration
 func (g *Jira) Configure(
-	repo repository.RepoCommon, params core.BridgeParams) (
+	repo *cache.RepoCache, params core.BridgeParams) (
 	core.Configuration, error) {
 	conf := make(core.Configuration)
 	var err error
@@ -77,11 +77,11 @@ func (g *Jira) Configure(
 	var password string
 	var serverURL string
 
-	if params.Token != "" || params.TokenStdin {
-		return nil, fmt.Errorf(
-			"JIRA session tokens are extremely short lived. We don't store them " +
-				"in the configuration, so they are not valid for this bridge.")
-	}
+	// if params.Token != "" || params.TokenStdin {
+	// 	return nil, fmt.Errorf(
+	// 		"JIRA session tokens are extremely short lived. We don't store them " +
+	// 			"in the configuration, so they are not valid for this bridge.")
+	// }
 
 	if params.Owner != "" {
 		return nil, fmt.Errorf("owner doesn't make sense for jira")
@@ -137,7 +137,7 @@ func (g *Jira) Configure(
 		return nil, err
 	}
 
-	conf[core.KeyTarget] = target
+	conf[core.ConfigKeyTarget] = target
 	conf[keyServer] = serverURL
 	conf[keyProject] = project
 
@@ -191,8 +191,8 @@ func (g *Jira) Configure(
 
 // ValidateConfig returns true if all required keys are present
 func (*Jira) ValidateConfig(conf core.Configuration) error {
-	if v, ok := conf[core.KeyTarget]; !ok {
-		return fmt.Errorf("missing %s key", core.KeyTarget)
+	if v, ok := conf[core.ConfigKeyTarget]; !ok {
+		return fmt.Errorf("missing %s key", core.ConfigKeyTarget)
 	} else if v != target {
 		return fmt.Errorf("unexpected target name: %v", v)
 	}

bridge/jira/export.go 🔗

@@ -43,7 +43,8 @@ type jiraExporter struct {
 }
 
 // Init .
-func (self *jiraExporter) Init(conf core.Configuration) error {
+func (self *jiraExporter) Init(repo *cache.RepoCache,
+	conf core.Configuration) error {
 	self.conf = conf
 	self.identityClient = make(map[entity.Id]*Client)
 	self.cachedOperationIDs = make(map[entity.Id]string)
@@ -171,7 +172,7 @@ func (self *jiraExporter) exportBug(
 	author := snapshot.Author
 
 	// skip bug if it was imported from some other bug system
-	origin, ok := snapshot.GetCreateMetadata(core.KeyOrigin)
+	origin, ok := snapshot.GetCreateMetadata(core.MetaKeyOrigin)
 	if ok && origin != target {
 		out <- core.NewExportNothing(
 			b.Id(), fmt.Sprintf("issue tagged with origin: %s", origin))

bridge/jira/import.go 🔗

@@ -35,7 +35,8 @@ type jiraImporter struct {
 }
 
 // Init .
-func (gi *jiraImporter) Init(conf core.Configuration) error {
+func (gi *jiraImporter) Init(repo *cache.RepoCache,
+	conf core.Configuration) error {
 	gi.conf = conf
 	return nil
 }
@@ -217,10 +218,10 @@ func (self *jiraImporter) ensureIssue(
 			cleanText,
 			nil,
 			map[string]string{
-				core.KeyOrigin: target,
-				keyJiraID:      issue.ID,
-				keyJiraKey:     issue.Key,
-				keyJiraProject: self.conf[keyProject],
+				core.MetaKeyOrigin: target,
+				keyJiraID:          issue.ID,
+				keyJiraKey:         issue.Key,
+				keyJiraProject:     self.conf[keyProject],
 			})
 		if err != nil {
 			return nil, err

bridge/jira/jira.go 🔗

@@ -7,10 +7,6 @@ import (
 	"github.com/MichaelMure/git-bug/bridge/core"
 )
 
-func init() {
-	core.Register(&Jira{})
-}
-
 // Jira Main object for the bridge
 type Jira struct{}
 

doc/md/git-bug_bridge_configure.md 🔗

@@ -71,7 +71,7 @@ git bug bridge configure \
 
 ```
   -n, --name string         A distinctive name to identify the bridge
-  -t, --target string       The target of the bridge. Valid values are [github,gitlab,launchpad-preview]
+  -t, --target string       The target of the bridge. Valid values are [github,gitlab,jira,launchpad-preview]
   -u, --url string          The URL of the target repository
   -b, --base-url string     The base URL of your issue tracker service
   -o, --owner string        The owner of the target repository