Monorepo for Tangled tangled.org

appview: use less OwnerSlashRepo() in handlers #802

merged opened by boltless.me targeting master from sl/yurolxtlpsmz
Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:xasnlahkri4ewmbuzly2rlc5/sh.tangled.repo.pull/3m5mgmc446w22
+10 -3
Interdiff #2 #3
appview/issues/issues.go

This file has not been changed.

appview/middleware/middleware.go

This file has not been changed.

appview/pages/repoinfo/repoinfo.go

This file has not been changed.

appview/pulls/pulls.go

This file has not been changed.

+8 -1
appview/repo/artifact.go
··· 174 174 175 175 artifact := artifacts[0] 176 176 177 - ownerPds := f.OwnerId.PDSEndpoint() 177 + ownerId, err := rp.idResolver.ResolveIdent(r.Context(), f.Did) 178 + if err != nil { 179 + log.Println("failed to resolve repo owner did", f.Did, err) 180 + http.Error(w, "repository owner not found", http.StatusNotFound) 181 + return 182 + } 183 + 184 + ownerPds := ownerId.PDSEndpoint() 178 185 url, _ := url.Parse(fmt.Sprintf("%s/xrpc/com.atproto.sync.getBlob", ownerPds)) 179 186 q := url.Query() 180 187 q.Set("cid", artifact.BlobCid.String())
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/feed.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.

appview/repo/repo.go

This file has not been changed.

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.

+2 -2
appview/repo/archive.go
··· 31 31 xrpcc := &indigoxrpc.Client{ 32 32 Host: host, 33 33 } 34 - repo := fmt.Sprintf("%s/%s", f.OwnerDid(), f.Name) 35 - archiveBytes, err := tangled.RepoArchive(r.Context(), xrpcc, "tar.gz", "", ref, repo) 34 + didSlashRepo := f.DidSlashRepo() 35 + archiveBytes, err := tangled.RepoArchive(r.Context(), xrpcc, "tar.gz", "", ref, didSlashRepo) 36 36 if xrpcerr := xrpcclient.HandleXrpcErr(err); xrpcerr != nil { 37 37 l.Error("failed to call XRPC repo.archive", "err", xrpcerr) 38 38 rp.pages.Error503(w)

History

6 rounds 1 comment
sign up or login to add to the discussion
1 commit
expand
appview: use less OwnerSlashRepo() in handlers
expand 0 comments
pull request successfully merged
1 commit
expand
appview: use less OwnerSlashRepo() in handlers
expand 0 comments
1 commit
expand
appview: use less OwnerSlashRepo() in handlers
expand 0 comments
1 commit
expand
appview: use less OwnerSlashRepo() in handlers
expand 0 comments
1 commit
expand
appview: use less OwnerSlashRepo() in handlers
expand 0 comments
1 commit
expand
appview: use less OwnerSlashRepo() in handlers
expand 1 comment

The end goal here is to remove the RepoInfo and ResolvedRepo