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
··· 34 34 } 35 35 36 36 func (r *Resolver) Resolve(ctx context.Context, source string) ([]syntax.DID, []syntax.ATURI) { 37 - l := r.logger.With("method", "find_references") 37 + l := r.logger.With("method", "Resolve") 38 38 rawMentions, rawRefs := markup.FindReferences(r.config.Core.AppviewHost, source) 39 39 l.Debug("found possible references", "mentions", rawMentions, "refs", rawRefs) 40 40 idents := r.idResolver.ResolveIdents(ctx, rawMentions) ··· 55 55 rawRef.Handle = string(ident.DID) 56 56 resolvedRefs = append(resolvedRefs, rawRef) 57 57 } 58 - aturiRefs, err := db.FindReferences(r.execer, resolvedRefs) 58 + aturiRefs, err := db.ValidateReferenceLinks(r.execer, resolvedRefs) 59 59 if err != nil { 60 60 l.Error("failed running query", "err", err) 61 61 }