back interdiff of round #7 and #6

draft: render backlinks #765

merged
opened by boltless.me targeting master from feat/mentions
files
appview
db
issues
models
pages
templates
repo
fragments
issues
pulls
pulls
ERROR
appview/db/reference.go

Failed to calculate interdiff for this file.

ERROR
appview/issues/issues.go

Failed to calculate interdiff for this file.

ERROR
appview/models/reference.go

Failed to calculate interdiff for this file.

ERROR
appview/pages/pages.go

Failed to calculate interdiff for this file.

ERROR
appview/pages/templates/repo/fragments/backlinks.html

Failed to calculate interdiff for this file.

ERROR
appview/pages/templates/repo/issues/issue.html

Failed to calculate interdiff for this file.

ERROR
appview/pages/templates/repo/pulls/pull.html

Failed to calculate interdiff for this file.

ERROR
appview/pulls/pulls.go

Failed to calculate interdiff for this file.

NEW
appview/db/pulls.go
···
insert into pull_submissions (pull_at, round_number, patch, combined, source_rev)
values (?, ?, ?, ?, ?)
`, pull.AtUri(), 0, pull.Submissions[0].Patch, pull.Submissions[0].Combined, pull.Submissions[0].SourceRev)
-
return err
+
if err != nil {
+
return err
+
}
+
+
if err := putReferences(tx, pull.AtUri(), pull.References); err != nil {
+
return fmt.Errorf("put reference_links: %w", err)
+
}
+
+
return nil
}
func GetPullAt(e Execer, repoAt syntax.ATURI, pullId int) (syntax.ATURI, error) {
···
}
}
+
allReferences, err := GetReferencesAll(e, FilterIn("from_at", pullAts))
+
if err != nil {
+
return nil, fmt.Errorf("failed to query reference_links: %w", err)
+
}
+
for pullAt, references := range allReferences {
+
if pull, ok := pulls[pullAt]; ok {
+
pull.References = references
+
}
+
}
+
orderedByPullId := []*models.Pull{}
for _, p := range pulls {
orderedByPullId = append(orderedByPullId, p)
NEW
appview/models/pull.go
···
TargetBranch string
State PullState
Submissions []*PullSubmission
+
Mentions []syntax.DID
+
References []syntax.ATURI
// stacking
StackId string // nullable string
···
source.Repo = &s
}
}
+
mentions := make([]string, len(p.Mentions))
+
for i, did := range p.Mentions {
+
mentions[i] = string(did)
+
}
+
references := make([]string, len(p.References))
+
for i, uri := range p.References {
+
references[i] = string(uri)
+
}
record := tangled.RepoPull{
-
Title: p.Title,
-
Body: &p.Body,
+
Title: p.Title,
+
Body: &p.Body,
+
Mentions: mentions,
+
References: references,
CreatedAt: p.Created.Format(time.RFC3339),
Target: &tangled.RepoPull_Target{
Repo: p.RepoAt.String(),