more hash-->id fixes

Michael Muré created

Change summary

bridge/gitlab/import.go         | 2 +-
entity/id.go                    | 2 ++
graphql/resolvers/operations.go | 2 +-
3 files changed, 4 insertions(+), 2 deletions(-)

Detailed changes

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
 	}
 

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)

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) {