···2525 NewSha string `json:"newSha" cborgen:"newSha"`
2626 // oldSha: old SHA of this ref
2727 OldSha string `json:"oldSha" cborgen:"oldSha"`
2828+ // ownerDid: did of the owner of the repo
2929+ OwnerDid string `json:"ownerDid" cborgen:"ownerDid"`
2830 // ref: Ref being updated
2931 Ref string `json:"ref" cborgen:"ref"`
3030- // repoDid: did of the owner of the repo
3232+ // repoDid: DID of the repo itself
3133 RepoDid string `json:"repoDid" cborgen:"repoDid"`
3234 // repoName: name of the repo
3335 RepoName string `json:"repoName" cborgen:"repoName"`
+2-1
api/tangled/labelop.go
···2222 Delete []*LabelOp_Operand `json:"delete" cborgen:"delete"`
2323 PerformedAt string `json:"performedAt" cborgen:"performedAt"`
2424 // subject: The subject (task, pull or discussion) of this label. Appviews may apply a `scope` check and refuse this op.
2525- Subject string `json:"subject" cborgen:"subject"`
2525+ Subject string `json:"subject" cborgen:"subject"`
2626+ SubjectDid *string `json:"subjectDid,omitempty" cborgen:"subjectDid,omitempty"`
2627}
27282829// LabelOp_Operand is a "operand" in the sh.tangled.label.op schema.
+2-1
api/tangled/repoartifact.go
···2525 // name: name of the artifact
2626 Name string `json:"name" cborgen:"name"`
2727 // repo: repo that this artifact is being uploaded to
2828- Repo string `json:"repo" cborgen:"repo"`
2828+ Repo *string `json:"repo,omitempty" cborgen:"repo,omitempty"`
2929+ RepoDid *string `json:"repoDid,omitempty" cborgen:"repoDid,omitempty"`
2930 // tag: hash of the tag object that this artifact is attached to (only annotated tags are supported)
3031 Tag util.LexBytes `json:"tag,omitempty" cborgen:"tag,omitempty"`
3132}
···7070 Did string `json:"did" cborgen:"did"`
7171 Knot string `json:"knot" cborgen:"knot"`
7272 Repo string `json:"repo" cborgen:"repo"`
7373+ // repoDid: DID of the repo itself
7474+ RepoDid string `json:"repoDid" cborgen:"repoDid"`
7375}
74767577// Pipeline_Workflow is a "workflow" in the sh.tangled.pipeline schema.
+2
api/tangled/tangledrepo.go
···2626 Labels []string `json:"labels,omitempty" cborgen:"labels,omitempty"`
2727 // name: name of the repo
2828 Name string `json:"name" cborgen:"name"`
2929+ // repoDid: DID of the repo itself, if assigned
3030+ RepoDid *string `json:"repoDid,omitempty" cborgen:"repoDid,omitempty"`
2931 // source: source of the repo
3032 Source *string `json:"source,omitempty" cborgen:"source,omitempty"`
3133 // spindle: CI runner to send jobs to and receive results from
···7575 // TODO: get this in the original query; requires COALESCE because nullable
7676 var sourceRepo *models.Repo
7777 if repo.Source != "" {
7878- sourceRepo, err = GetRepoByAtUri(e, repo.Source)
7878+ if strings.HasPrefix(repo.Source, "did:") {
7979+ sourceRepo, err = GetRepoByDid(e, repo.Source)
8080+ } else {
8181+ sourceRepo, err = GetRepoByAtUri(e, repo.Source)
8282+ }
7983 if err != nil {
8080- // the source repo was not found, skip this bit
8184 log.Println("profile", "err", err)
8285 }
8386 }
···449452 query = `select count(id) from repos where did = ?`
450453 args = append(args, did)
451454 case models.VanityStatStarCount:
452452- query = `select count(id) from stars where subject_at like 'at://' || ? || '%'`
455455+ query = `select count(s.id) from stars s join repos r on (s.subject_at = r.at_uri or (s.subject_did is not null and s.subject_did = r.repo_did)) where r.did = ?`
453456 args = append(args, did)
454457 case models.VanityStatNone:
455458 return 0, nil
···77)
8899type Star struct {
1010- Did string
1111- RepoAt syntax.ATURI
1212- Created time.Time
1313- Rkey string
1010+ Did string
1111+ RepoAt syntax.ATURI
1212+ SubjectDid string
1313+ Created time.Time
1414+ Rkey string
1415}
15161617// RepoStar is used for reverse mapping to repos
···3737 <p class="text-sm text-gray-500 dark:text-gray-400">A knot hosts repository data. <a href="/settings/knots" class="underline">Learn how to register your own knot.</a></p>
3838 </fieldset>
39394040+ <fieldset class="space-y-3">
4141+ <details>
4242+ <summary class="dark:text-white cursor-pointer select-none">Bring your own DID</summary>
4343+ <div class="mt-2">
4444+ <input
4545+ type="text"
4646+ id="repo_did"
4747+ name="repo_did"
4848+ class="w-full p-2 border rounded bg-gray-100 dark:bg-gray-700 dark:text-white dark:border-gray-600"
4949+ placeholder="did:web:example.com"
5050+ />
5151+ <p class="text-sm text-gray-500 dark:text-gray-400 mt-1">
5252+ Provide a <code>did:web</code> you control to use as this fork's identity.
5353+ You must serve a DID doc on your domain with an <code>atproto_pds</code> service
5454+ endpoint pointing to the selected knot. If left empty, a <code>did:plc</code> will be
5555+ automatically created for you!
5656+ </p>
5757+ </div>
5858+ </details>
5959+ </fieldset>
6060+4061 <div class="space-y-2">
4162 <button type="submit" class="btn-create flex items-center gap-2">
4263 {{ i "git-fork" "w-4 h-4" }}
+26
appview/pages/templates/repo/new.html
···7070 <div class="space-y-2">
7171 {{ template "defaultBranch" . }}
7272 {{ template "knot" . }}
7373+ {{ template "repoDid" . }}
7374 </div>
7475 </div>
7576 </div>
···168169 A knot hosts repository data and handles Git operations.
169170 You can also <a href="/settings/knots" class="underline">register your own knot</a>.
170171 </p>
172172+ </div>
173173+{{ end }}
174174+175175+{{ define "repoDid" }}
176176+ <div>
177177+ <details>
178178+ <summary class="text-sm font-bold uppercase dark:text-white mb-1 cursor-pointer select-none">
179179+ Bring your own DID
180180+ </summary>
181181+ <div class="mt-2">
182182+ <input
183183+ type="text"
184184+ id="repo_did"
185185+ name="repo_did"
186186+ class="w-full dark:bg-gray-700 dark:text-white dark:border-gray-600 border border-gray-300 rounded px-3 py-2"
187187+ placeholder="did:web:example.com"
188188+ />
189189+ <p class="text-sm text-gray-500 dark:text-gray-400 mt-1">
190190+ Provide a <code>did:web</code> you control to use as this repo's identity.
191191+ You must serve a DID doc on your domain with an <code>atproto_pds</code> service
192192+ endpoint pointing to the selected knot. If left empty, a <code>did:plc</code> will be
193193+ automatically created for you!
194194+ </p>
195195+ </div>
196196+ </details>
171197 </div>
172198{{ end }}
173199