diff options
author | Michael Muré <batolettre@gmail.com> | 2019-11-19 19:25:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-19 19:25:43 +0100 |
commit | e01cefff9826589b77bd34464301f196112d68f7 (patch) | |
tree | 44b32dfc7727c957ce7e364c6dc631ba8d76a4a5 /bridge/gitlab/export.go | |
parent | 67c82f4a2d683e746df5f8af9e0725acd252d29d (diff) | |
parent | 8ffe2a9b03f5d489e12d2d4d2677bbe67a1b53d7 (diff) | |
download | git-bug-e01cefff9826589b77bd34464301f196112d68f7.tar.gz |
Merge pull request #247 from MichaelMure/bridge-origin
bridge: move keyOrigin to core package
Diffstat (limited to 'bridge/gitlab/export.go')
-rw-r--r-- | bridge/gitlab/export.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/bridge/gitlab/export.go b/bridge/gitlab/export.go index 251d720a..44778b44 100644 --- a/bridge/gitlab/export.go +++ b/bridge/gitlab/export.go @@ -141,7 +141,7 @@ func (ge *gitlabExporter) exportBug(ctx context.Context, b *cache.BugCache, sinc // from Gitlab) and we do not have the token of the bug author, there is nothing we can do. // skip bug if origin is not allowed - 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)) return @@ -152,9 +152,9 @@ func (ge *gitlabExporter) exportBug(ctx context.Context, b *cache.BugCache, sinc author := snapshot.Author // get gitlab bug ID - gitlabID, ok := snapshot.GetCreateMetadata(keyGitlabId) + gitlabID, ok := snapshot.GetCreateMetadata(metaKeyGitlabId) if ok { - projectID, ok := snapshot.GetCreateMetadata(keyGitlabProject) + projectID, ok := snapshot.GetCreateMetadata(metaKeyGitlabProject) if !ok { err := fmt.Errorf("expected to find gitlab project id") out <- core.NewExportError(err, b.Id()) @@ -199,9 +199,9 @@ func (ge *gitlabExporter) exportBug(ctx context.Context, b *cache.BugCache, sinc _, err = b.SetMetadata( createOp.Id(), map[string]string{ - keyGitlabId: idString, - keyGitlabUrl: url, - keyGitlabProject: ge.repositoryID, + metaKeyGitlabId: idString, + metaKeyGitlabUrl: url, + metaKeyGitlabProject: ge.repositoryID, }, ) if err != nil { @@ -235,7 +235,7 @@ func (ge *gitlabExporter) exportBug(ctx context.Context, b *cache.BugCache, sinc // ignore operations already existing in gitlab (due to import or export) // cache the ID of already exported or imported issues and events from Gitlab - if id, ok := op.GetMetadata(keyGitlabId); ok { + if id, ok := op.GetMetadata(metaKeyGitlabId); ok { ge.cachedOperationIDs[op.Id().String()] = id out <- core.NewExportNothing(op.Id(), "already exported operation") continue @@ -378,8 +378,8 @@ func markOperationAsExported(b *cache.BugCache, target entity.Id, gitlabID, gitl _, err := b.SetMetadata( target, map[string]string{ - keyGitlabId: gitlabID, - keyGitlabUrl: gitlabURL, + metaKeyGitlabId: gitlabID, + metaKeyGitlabUrl: gitlabURL, }, ) |