diff options
author | Josh Bialkowski <josh.bialkowski@gmail.com> | 2019-12-04 22:50:35 -0800 |
---|---|---|
committer | Josh Bialkowski <josh.bialkowski@gmail.com> | 2019-12-18 07:42:16 -0800 |
commit | a59aaebc7e2fb6b1d14d6637cad7522463c0b25f (patch) | |
tree | e0f480918a4b16e0ac336e9ac46e6f3ce2007742 /bridge/jira/import.go | |
parent | cd889572f7870a62758240b323a9086a76c5120a (diff) | |
download | git-bug-a59aaebc7e2fb6b1d14d6637cad7522463c0b25f.tar.gz |
codreview #3: two credential types, more fixes
* Support both token and session credential types
* use getTimeDervedID in export.go
* keyOrigin -> core.KeyOrigin
* fix one indentation
* remove project key from operation metadata
* fix missing credentials codepath if not using sidecar
Diffstat (limited to 'bridge/jira/import.go')
-rw-r--r-- | bridge/jira/import.go | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/bridge/jira/import.go b/bridge/jira/import.go index 96ef81ab..346aa6fd 100644 --- a/bridge/jira/import.go +++ b/bridge/jira/import.go @@ -17,7 +17,6 @@ import ( ) const ( - keyOrigin = "origin" keyJiraID = "jira-id" keyJiraOperationID = "jira-derived-id" keyJiraKey = "jira-key" @@ -216,7 +215,7 @@ func (self *jiraImporter) ensureIssue( cleanText, nil, map[string]string{ - keyOrigin: target, + core.KeyOrigin: target, keyJiraID: issue.ID, keyJiraKey: issue.Key, keyJiraProject: self.conf[keyProject], @@ -237,8 +236,8 @@ func getTimeDerivedID(jiraID string, timestamp MyTime) string { } // Create a bug.Comment from a JIRA comment -func (self *jiraImporter) ensureComment( - repo *cache.RepoCache, b *cache.BugCache, item Comment) error { +func (self *jiraImporter) ensureComment(repo *cache.RepoCache, + b *cache.BugCache, item Comment) error { // ensure person author, err := self.ensurePerson(repo, item.Author) if err != nil { @@ -271,8 +270,7 @@ func (self *jiraImporter) ensureComment( cleanText, nil, map[string]string{ - keyJiraID: item.ID, - keyJiraProject: self.conf[keyProject], + keyJiraID: item.ID, }, ) if err != nil { @@ -315,8 +313,7 @@ func (self *jiraImporter) ensureComment( target, cleanText, map[string]string{ - keyJiraID: derivedID, - keyJiraProject: self.conf[keyProject], + keyJiraID: derivedID, }, ) @@ -489,7 +486,6 @@ func (self *jiraImporter) ensureChange( map[string]string{ keyJiraID: entry.ID, keyJiraOperationID: derivedID, - keyJiraProject: self.conf[keyProject], }, ) if err != nil { @@ -504,9 +500,7 @@ func (self *jiraImporter) ensureChange( author, entry.Created.Unix(), map[string]string{ - keyJiraID: entry.ID, - - keyJiraProject: self.conf[keyProject], + keyJiraID: entry.ID, keyJiraOperationID: derivedID, }, ) @@ -519,9 +513,7 @@ func (self *jiraImporter) ensureChange( author, entry.Created.Unix(), map[string]string{ - keyJiraID: entry.ID, - - keyJiraProject: self.conf[keyProject], + keyJiraID: entry.ID, keyJiraOperationID: derivedID, }, ) @@ -545,7 +537,6 @@ func (self *jiraImporter) ensureChange( map[string]string{ keyJiraID: entry.ID, keyJiraOperationID: derivedID, - keyJiraProject: self.conf[keyProject], }, ) if err != nil { @@ -564,7 +555,6 @@ func (self *jiraImporter) ensureChange( map[string]string{ keyJiraID: entry.ID, keyJiraOperationID: derivedID, - keyJiraProject: self.conf[keyProject], }, ) if err != nil { |