From 5511c230b678a181cc596238bf6669428d1b1902 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Thu, 18 Aug 2022 23:34:05 +0200 Subject: move {bug,identity} to /entities, move input to /commands --- bridge/jira/import.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bridge/jira/import.go') diff --git a/bridge/jira/import.go b/bridge/jira/import.go index 572c393e..fb551b47 100644 --- a/bridge/jira/import.go +++ b/bridge/jira/import.go @@ -11,8 +11,8 @@ import ( "github.com/MichaelMure/git-bug/bridge/core" "github.com/MichaelMure/git-bug/bridge/core/auth" - "github.com/MichaelMure/git-bug/bug" "github.com/MichaelMure/git-bug/cache" + "github.com/MichaelMure/git-bug/entities/bug" "github.com/MichaelMure/git-bug/entity" "github.com/MichaelMure/git-bug/entity/dag" "github.com/MichaelMure/git-bug/util/text" -- cgit From 8818d091e85087766d7f493b7dfaf1aedc3a4ab0 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Sat, 20 Aug 2022 10:52:11 +0200 Subject: move bug.Status in entities/common for reuse --- bridge/jira/import.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'bridge/jira/import.go') diff --git a/bridge/jira/import.go b/bridge/jira/import.go index fb551b47..c297abcf 100644 --- a/bridge/jira/import.go +++ b/bridge/jira/import.go @@ -13,6 +13,7 @@ import ( "github.com/MichaelMure/git-bug/bridge/core/auth" "github.com/MichaelMure/git-bug/cache" "github.com/MichaelMure/git-bug/entities/bug" + "github.com/MichaelMure/git-bug/entities/common" "github.com/MichaelMure/git-bug/entity" "github.com/MichaelMure/git-bug/entity/dag" "github.com/MichaelMure/git-bug/util/text" @@ -516,7 +517,7 @@ func (ji *jiraImporter) ensureChange(repo *cache.RepoCache, b *cache.BugCache, e statusStr, hasMap := statusMap[item.To] if hasMap { switch statusStr { - case bug.OpenStatus.String(): + case common.OpenStatus.String(): op, err := b.OpenRaw( author, entry.Created.Unix(), @@ -530,7 +531,7 @@ func (ji *jiraImporter) ensureChange(repo *cache.RepoCache, b *cache.BugCache, e } ji.out <- core.NewImportStatusChange(op.Id()) - case bug.ClosedStatus.String(): + case common.ClosedStatus.String(): op, err := b.CloseRaw( author, entry.Created.Unix(), @@ -608,8 +609,8 @@ func getStatusMap(conf core.Configuration) (map[string]string, error) { mapStr, hasConf := conf[confKeyIDMap] if !hasConf { return map[string]string{ - bug.OpenStatus.String(): "1", - bug.ClosedStatus.String(): "6", + common.OpenStatus.String(): "1", + common.ClosedStatus.String(): "6", }, nil } -- cgit From 45b04351d8d02e53b3401b0ee23f7cbe750b63cd Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Mon, 3 May 2021 11:45:15 +0200 Subject: bug: have a type for combined ids, fix https://github.com/MichaelMure/git-bug/issues/653 --- bridge/jira/import.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'bridge/jira/import.go') diff --git a/bridge/jira/import.go b/bridge/jira/import.go index c297abcf..8043acf4 100644 --- a/bridge/jira/import.go +++ b/bridge/jira/import.go @@ -270,8 +270,7 @@ func (ji *jiraImporter) ensureComment(repo *cache.RepoCache, b *cache.BugCache, return err } - targetOpID, err := b.ResolveOperationWithMetadata( - metaKeyJiraId, item.ID) + targetOpID, err := b.ResolveOperationWithMetadata(metaKeyJiraId, item.ID) if err != nil && err != cache.ErrNoMatchingOp { return err } @@ -334,7 +333,7 @@ func (ji *jiraImporter) ensureComment(repo *cache.RepoCache, b *cache.BugCache, op, err := b.EditCommentRaw( editor, item.Updated.Unix(), - targetOpID, + entity.CombineIds(b.Id(), targetOpID), text.Cleanup(item.Body), map[string]string{ metaKeyJiraId: derivedID, -- cgit