Monorepo for Tangled tangled.org

appview: update state, ingester, middleware, and resolver for repo DID #1140

open opened by oyster.cafe targeting master from oyster.cafe/tangled-core: master
Labels

None yet.

assignee

None yet.

Participants 2
AT URI
at://did:plc:3fwecdnvtcscjnrx2p4n7alz/sh.tangled.repo.pull/3mgprvt2eon22
+21 -10
Interdiff #10 #11
appview/ingester.go

This file has not been changed.

appview/issues/issues.go

This file has not been changed.

appview/middleware/middleware.go

This file has not been changed.

+8 -1
appview/pulls/pulls.go
··· 1219 1219 Repo: &forkAtUriStr, 1220 1220 Sha: sourceRev, 1221 1221 } 1222 + if fork.RepoDid != "" { 1223 + recordPullSource.RepoDid = &fork.RepoDid 1224 + } 1222 1225 1223 1226 s.createPullRequest(w, r, repo, user, title, body, targetBranch, patch, combined, sourceRev, pullSource, recordPullSource, isStacked) 1224 1227 } ··· 2542 2545 2543 2546 func repoPullTarget(repo *models.Repo, branch string) *tangled.RepoPull_Target { 2544 2547 s := string(repo.RepoAt()) 2545 - return &tangled.RepoPull_Target{ 2548 + t := &tangled.RepoPull_Target{ 2546 2549 Branch: branch, 2547 2550 Repo: &s, 2548 2551 } 2552 + if repo.RepoDid != "" { 2553 + t.RepoDid = &repo.RepoDid 2554 + } 2555 + return t 2549 2556 }
appview/repo/archive.go

This file has not been changed.

+2 -3
appview/repo/artifact.go
··· 359 359 Name: name, 360 360 Tag: tag, 361 361 } 362 + s := f.RepoAt().String() 363 + rec.Repo = &s 362 364 if f.RepoDid != "" { 363 365 rec.RepoDid = &f.RepoDid 364 - } else { 365 - s := f.RepoAt().String() 366 - rec.Repo = &s 367 366 } 368 367 return rec 369 368 }
appview/repo/blob.go

This file has not been changed.

appview/repo/branches.go

This file has not been changed.

appview/repo/compare.go

This file has not been changed.

appview/repo/index.go

This file has not been changed.

appview/repo/log.go

This file has not been changed.

+3
appview/repo/repo.go
··· 1282 1282 } 1283 1283 s := string(f.RepoAt()) 1284 1284 rec.Repo = &s 1285 + if f.RepoDid != "" { 1286 + rec.RepoDid = &f.RepoDid 1287 + } 1285 1288 return rec 1286 1289 }
appview/repo/settings.go

This file has not been changed.

appview/repo/tags.go

This file has not been changed.

appview/repo/tree.go

This file has not been changed.

appview/reporesolver/resolver.go

This file has not been changed.

appview/state/git_http.go

This file has not been changed.

appview/state/knotstream.go

This file has not been changed.

appview/state/router.go

This file has not been changed.

+3 -5
appview/state/star.go
··· 42 42 createdAt := time.Now().Format(time.RFC3339) 43 43 rkey := tid.TID() 44 44 45 + subjectStr := subjectUri.String() 45 46 starRecord := &tangled.FeedStar{ 46 47 CreatedAt: createdAt, 48 + Subject: &subjectStr, 47 49 } 48 50 repo, err := db.GetRepo(s.db, orm.FilterEq("at_uri", subjectUri.String())) 49 - repoHasDid := err == nil && repo.RepoDid != "" 50 - if repoHasDid { 51 + if err == nil && repo.RepoDid != "" { 51 52 starRecord.SubjectDid = &repo.RepoDid 52 - } else { 53 - s := subjectUri.String() 54 - starRecord.Subject = &s 55 53 } 56 54 57 55 resp, err := comatproto.RepoPutRecord(r.Context(), client, &comatproto.RepoPutRecord_Input{
appview/state/state.go

This file has not been changed.

appview/validator/label.go

This file has not been changed.

+5 -1
appview/models/issue.go
··· 45 45 references[i] = string(uri) 46 46 } 47 47 repoAtStr := i.RepoAt.String() 48 - return tangled.RepoIssue{ 48 + rec := tangled.RepoIssue{ 49 49 Repo: &repoAtStr, 50 50 Title: i.Title, 51 51 Body: &i.Body, ··· 53 53 References: references, 54 54 CreatedAt: i.Created.Format(time.RFC3339), 55 55 } 56 + if i.Repo != nil && i.Repo.RepoDid != "" { 57 + rec.RepoDid = &i.Repo.RepoDid 58 + } 59 + return rec 56 60 } 57 61 58 62 func (i *Issue) State() string {

History

14 rounds 2 comments
sign up or login to add to the discussion
1 commit
expand
appview: DID-based routing, state/handler/middleware updates
no conflicts, ready to merge
expand 0 comments
1 commit
expand
appview: DID-based routing, state/handler/middleware updates
expand 0 comments
oyster.cafe submitted #11
1 commit
expand
appview: DID-based routing, state/handler/middleware updates
expand 2 comments

appview/state/state.go:631 won't this eventually redirect to /{owner}/{reponame}?

wdym by eventually? I was thinking to keep this in, so that we don't simply error out if someone does decide to be clever and link to their git repo by repoDID, we should render the page anyway to reward them for being clever instead of punishing heh

1 commit
expand
appview: DID-based routing, state/handler/middleware updates
expand 0 comments
1 commit
expand
appview: DID-based routing, state/handler/middleware updates
expand 0 comments
1 commit
expand
appview: update state, ingester, middleware, and resolver for repo DID
expand 0 comments
1 commit
expand
appview: update state, ingester, middleware, and resolver for repo DID
expand 0 comments
1 commit
expand
appview: update state, ingester, middleware, and resolver for repo DID
expand 0 comments
1 commit
expand
appview: update state, ingester, middleware, and resolver for repo DID
expand 0 comments
1 commit
expand
appview: update state, ingester, middleware, and resolver for repo DID
expand 0 comments
1 commit
expand
appview: update state, ingester, middleware, and resolver for repo DID
expand 0 comments
1 commit
expand
appview: update state, ingester, middleware, and resolver for repo DID
expand 0 comments
1 commit
expand
appview: update state, ingester, middleware, and resolver for repo DID
expand 0 comments
1 commit
expand
appview: update state, ingester, middleware, and resolver for repo DID
expand 0 comments