+7
-4
appview/db/repos.go
+7
-4
appview/db/repos.go
···
391
391
var description, spindle sql.NullString
392
392
393
393
row := e.QueryRow(`
394
-
select did, name, knot, created, at_uri, description, spindle
394
+
select did, name, knot, created, at_uri, description, spindle, rkey
395
395
from repos
396
396
where did = ? and name = ?
397
397
`,
···
400
400
)
401
401
402
402
var createdAt string
403
-
if err := row.Scan(&repo.Did, &repo.Name, &repo.Knot, &createdAt, &repo.AtUri, &description, &spindle); err != nil {
403
+
if err := row.Scan(&repo.Did, &repo.Name, &repo.Knot, &createdAt, &repo.AtUri, &description, &spindle, &repo.Rkey); err != nil {
404
404
return nil, err
405
405
}
406
406
createdAtTime, _ := time.Parse(time.RFC3339, createdAt)
···
421
421
var repo Repo
422
422
var nullableDescription sql.NullString
423
423
424
-
row := e.QueryRow(`select did, name, knot, created, at_uri, description from repos where at_uri = ?`, atUri)
424
+
row := e.QueryRow(`select did, name, knot, created, at_uri, rkey, description from repos where at_uri = ?`, atUri)
425
425
426
426
var createdAt string
427
-
if err := row.Scan(&repo.Did, &repo.Name, &repo.Knot, &createdAt, &repo.AtUri, &nullableDescription); err != nil {
427
+
if err := row.Scan(&repo.Did, &repo.Name, &repo.Knot, &createdAt, &repo.AtUri, &repo.Rkey, &nullableDescription); err != nil {
428
428
return nil, err
429
429
}
430
430
createdAtTime, _ := time.Parse(time.RFC3339, createdAt)
···
440
440
}
441
441
442
442
func AddRepo(e Execer, repo *Repo) error {
443
+
if repo.AtUri == "" {
444
+
repo.AtUri = repo.RepoAt().String()
445
+
}
443
446
_, err := e.Exec(
444
447
`insert into repos
445
448
(did, name, knot, rkey, at_uri, description, source)
+3
-8
appview/pulls/pulls.go
+3
-8
appview/pulls/pulls.go
···
28
28
29
29
"github.com/bluekeyes/go-gitdiff/gitdiff"
30
30
comatproto "github.com/bluesky-social/indigo/api/atproto"
31
-
"github.com/bluesky-social/indigo/atproto/syntax"
32
31
lexutil "github.com/bluesky-social/indigo/lex/util"
33
32
"github.com/go-chi/chi/v5"
34
33
"github.com/google/uuid"
···
918
917
return
919
918
}
920
919
921
-
forkAtUri, err := syntax.ParseATURI(fork.AtUri)
922
-
if err != nil {
923
-
log.Println("failed to parse fork AT URI", err)
924
-
s.pages.Notice(w, "pull", "Failed to create pull request. Try again later.")
925
-
return
926
-
}
920
+
forkAtUri := fork.RepoAt()
921
+
forkAtUriStr := forkAtUri.String()
927
922
928
923
pullSource := &db.PullSource{
929
924
Branch: sourceBranch,
···
931
926
}
932
927
recordPullSource := &tangled.RepoPull_Source{
933
928
Branch: sourceBranch,
934
-
Repo: &fork.AtUri,
929
+
Repo: &forkAtUriStr,
935
930
Sha: sourceRev,
936
931
}
937
932
-1
appview/repo/repo.go
-1
appview/repo/repo.go