aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2019-08-13 16:02:13 +0200
committerMichael Muré <batolettre@gmail.com>2019-08-13 16:23:05 +0200
commitc809d37152ea87a66fc281730042dcb4299a8263 (patch)
treec92867a5b4bcc1c923cc1c78689023868bee10be
parent99b5c58d43137bd9f6503788a55484327b0c531f (diff)
downloadgit-bug-c809d37152ea87a66fc281730042dcb4299a8263.tar.gz
more hash-->id fixes
-rw-r--r--bridge/gitlab/import.go2
-rw-r--r--entity/id.go2
-rw-r--r--graphql/resolvers/operations.go2
3 files changed, 4 insertions, 2 deletions
diff --git a/bridge/gitlab/import.go b/bridge/gitlab/import.go
index 08e4c6eb..f65aba6a 100644
--- a/bridge/gitlab/import.go
+++ b/bridge/gitlab/import.go
@@ -132,7 +132,7 @@ func (gi *gitlabImporter) ensureNote(repo *cache.RepoCache, b *cache.BugCache, n
gitlabID := parseID(note.ID)
id, errResolve := b.ResolveOperationWithMetadata(keyGitlabId, gitlabID)
- if errResolve != cache.ErrNoMatchingOp {
+ if errResolve != nil && errResolve != cache.ErrNoMatchingOp {
return errResolve
}
diff --git a/entity/id.go b/entity/id.go
index 7fa1785a..7ff6b223 100644
--- a/entity/id.go
+++ b/entity/id.go
@@ -17,10 +17,12 @@ const UnsetId = Id("unset")
// Id is an identifier for an entity or part of an entity
type Id string
+// String return the identifier as a string
func (i Id) String() string {
return string(i)
}
+// Human return the identifier, shortened for human consumption
func (i Id) Human() string {
format := fmt.Sprintf("%%.%ds", humanIdLength)
return fmt.Sprintf(format, i)
diff --git a/graphql/resolvers/operations.go b/graphql/resolvers/operations.go
index 3080c98b..ec803c1f 100644
--- a/graphql/resolvers/operations.go
+++ b/graphql/resolvers/operations.go
@@ -45,7 +45,7 @@ func (editCommentOperationResolver) ID(ctx context.Context, obj *bug.EditComment
}
func (editCommentOperationResolver) Target(ctx context.Context, obj *bug.EditCommentOperation) (string, error) {
- panic("implement me")
+ return obj.Target.String(), nil
}
func (editCommentOperationResolver) Date(ctx context.Context, obj *bug.EditCommentOperation) (*time.Time, error) {