back interdiff of round #1 and #0

appview,lexicons: atprotate the mentions & references #761

merged
opened by boltless.me targeting master from feat/mentions

Storing references parsed from the markdown body in atproto record and DB. There can be lots of reference types considering the from/to types so storing both as AT-URIs

Using sql.Tx more to combine multiple DB query to single recoverable operation.

Note: Pulls don't have mentinos/references yet

Signed-off-by: Seongmin Lee git@boltless.me

REBASED
api/tangled/cbor_gen.go

This patch was likely rebased, as context lines do not match.

ERROR
api/tangled/issuecomment.go

Failed to calculate interdiff for this file.

ERROR
api/tangled/pullcomment.go

Failed to calculate interdiff for this file.

ERROR
api/tangled/repoissue.go

Failed to calculate interdiff for this file.

ERROR
appview/db/db.go

Failed to calculate interdiff for this file.

ERROR
appview/db/issues.go

Failed to calculate interdiff for this file.

ERROR
appview/db/pulls.go

Failed to calculate interdiff for this file.

ERROR
appview/db/reference.go

Failed to calculate interdiff for this file.

ERROR
appview/ingester.go

Failed to calculate interdiff for this file.

ERROR
appview/issues/issues.go

Failed to calculate interdiff for this file.

ERROR
appview/models/issue.go

Failed to calculate interdiff for this file.

ERROR
appview/models/pull.go

Failed to calculate interdiff for this file.

ERROR
appview/pulls/pulls.go

Failed to calculate interdiff for this file.

ERROR
lexicons/issue/comment.json

Failed to calculate interdiff for this file.

ERROR
lexicons/issue/issue.json

Failed to calculate interdiff for this file.

ERROR
lexicons/pulls/comment.json

Failed to calculate interdiff for this file.

NEW
appview/refresolver/resolver.go
···
}
func (r *Resolver) Resolve(ctx context.Context, source string) ([]syntax.DID, []syntax.ATURI) {
-
l := r.logger.With("method", "find_references")
rawMentions, rawRefs := markup.FindReferences(r.config.Core.AppviewHost, source)
l.Debug("found possible references", "mentions", rawMentions, "refs", rawRefs)
idents := r.idResolver.ResolveIdents(ctx, rawMentions)
···
rawRef.Handle = string(ident.DID)
resolvedRefs = append(resolvedRefs, rawRef)
}
-
aturiRefs, err := db.FindReferences(r.execer, resolvedRefs)
if err != nil {
l.Error("failed running query", "err", err)
}
···
}
func (r *Resolver) Resolve(ctx context.Context, source string) ([]syntax.DID, []syntax.ATURI) {
+
l := r.logger.With("method", "Resolve")
rawMentions, rawRefs := markup.FindReferences(r.config.Core.AppviewHost, source)
l.Debug("found possible references", "mentions", rawMentions, "refs", rawRefs)
idents := r.idResolver.ResolveIdents(ctx, rawMentions)
···
rawRef.Handle = string(ident.DID)
resolvedRefs = append(resolvedRefs, rawRef)
}
+
aturiRefs, err := db.ValidateReferenceLinks(r.execer, resolvedRefs)
if err != nil {
l.Error("failed running query", "err", err)
}