···22 Delete []*LabelOp_Operand `json:"delete" cborgen:"delete"`
23 PerformedAt string `json:"performedAt" cborgen:"performedAt"`
24 // subject: The subject (task, pull or discussion) of this label. Appviews may apply a `scope` check and refuse this op.
25- Subject string `json:"subject" cborgen:"subject"`
026}
2728// LabelOp_Operand is a "operand" in the sh.tangled.label.op schema.
···22 Delete []*LabelOp_Operand `json:"delete" cborgen:"delete"`
23 PerformedAt string `json:"performedAt" cborgen:"performedAt"`
24 // subject: The subject (task, pull or discussion) of this label. Appviews may apply a `scope` check and refuse this op.
25+ Subject string `json:"subject" cborgen:"subject"`
26+ SubjectDid *string `json:"subjectDid,omitempty" cborgen:"subjectDid,omitempty"`
27}
2829// LabelOp_Operand is a "operand" in the sh.tangled.label.op schema.
+2-1
api/tangled/repoartifact.go
···25 // name: name of the artifact
26 Name string `json:"name" cborgen:"name"`
27 // repo: repo that this artifact is being uploaded to
28- Repo string `json:"repo" cborgen:"repo"`
029 // tag: hash of the tag object that this artifact is attached to (only annotated tags are supported)
30 Tag util.LexBytes `json:"tag,omitempty" cborgen:"tag,omitempty"`
31}
···25 // name: name of the artifact
26 Name string `json:"name" cborgen:"name"`
27 // repo: repo that this artifact is being uploaded to
28+ Repo string `json:"repo" cborgen:"repo"`
29+ RepoDid *string `json:"repoDid,omitempty" cborgen:"repoDid,omitempty"`
30 // tag: hash of the tag object that this artifact is attached to (only annotated tags are supported)
31 Tag util.LexBytes `json:"tag,omitempty" cborgen:"tag,omitempty"`
32}
+3-2
api/tangled/repocollaborator.go
···20 LexiconTypeID string `json:"$type,const=sh.tangled.repo.collaborator" cborgen:"$type,const=sh.tangled.repo.collaborator"`
21 CreatedAt string `json:"createdAt" cborgen:"createdAt"`
22 // repo: repo to add this user to
23- Repo string `json:"repo" cborgen:"repo"`
24- Subject string `json:"subject" cborgen:"subject"`
025}
···20 LexiconTypeID string `json:"$type,const=sh.tangled.repo.collaborator" cborgen:"$type,const=sh.tangled.repo.collaborator"`
21 CreatedAt string `json:"createdAt" cborgen:"createdAt"`
22 // repo: repo to add this user to
23+ Repo string `json:"repo" cborgen:"repo"`
24+ RepoDid *string `json:"repoDid,omitempty" cborgen:"repoDid,omitempty"`
25+ Subject string `json:"subject" cborgen:"subject"`
26}
···3334// RepoPull_Source is a "source" in the sh.tangled.repo.pull schema.
35type RepoPull_Source struct {
36- Branch string `json:"branch" cborgen:"branch"`
37- Repo *string `json:"repo,omitempty" cborgen:"repo,omitempty"`
38- Sha string `json:"sha" cborgen:"sha"`
039}
4041// RepoPull_Target is a "target" in the sh.tangled.repo.pull schema.
42type RepoPull_Target struct {
43- Branch string `json:"branch" cborgen:"branch"`
44- Repo string `json:"repo" cborgen:"repo"`
045}
···3334// RepoPull_Source is a "source" in the sh.tangled.repo.pull schema.
35type RepoPull_Source struct {
36+ Branch string `json:"branch" cborgen:"branch"`
37+ Repo *string `json:"repo,omitempty" cborgen:"repo,omitempty"`
38+ RepoDid *string `json:"repoDid,omitempty" cborgen:"repoDid,omitempty"`
39+ Sha string `json:"sha" cborgen:"sha"`
40}
4142// RepoPull_Target is a "target" in the sh.tangled.repo.pull schema.
43type RepoPull_Target struct {
44+ Branch string `json:"branch" cborgen:"branch"`
45+ Repo string `json:"repo" cborgen:"repo"`
46+ RepoDid *string `json:"repoDid,omitempty" cborgen:"repoDid,omitempty"`
47}
+33
api/tangled/reporesolveAtUri.go
···000000000000000000000000000000000
···1+// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2+3+package tangled
4+5+// schema: sh.tangled.repo.resolveAtUri
6+7+import (
8+ "context"
9+10+ "github.com/bluesky-social/indigo/lex/util"
11+)
12+13+const (
14+ RepoResolveAtUriNSID = "sh.tangled.repo.resolveAtUri"
15+)
16+17+// RepoResolveAtUri_Output is the output of a sh.tangled.repo.resolveAtUri call.
18+type RepoResolveAtUri_Output struct {
19+ Did string `json:"did" cborgen:"did"`
20+}
21+22+// RepoResolveAtUri calls the XRPC method "sh.tangled.repo.resolveAtUri".
23+func RepoResolveAtUri(ctx context.Context, c util.LexClient, atUri string) (*RepoResolveAtUri_Output, error) {
24+ var out RepoResolveAtUri_Output
25+26+ params := map[string]interface{}{}
27+ params["atUri"] = atUri
28+ if err := c.LexDo(ctx, util.Query, "", "sh.tangled.repo.resolveAtUri", params, nil, &out); err != nil {
29+ return nil, err
30+ }
31+32+ return &out, nil
33+}
+2-1
api/tangled/tangledrepo.go
···25 // labels: List of labels that this repo subscribes to
26 Labels []string `json:"labels,omitempty" cborgen:"labels,omitempty"`
27 // name: name of the repo
28- Name string `json:"name" cborgen:"name"`
029 // source: source of the repo
30 Source *string `json:"source,omitempty" cborgen:"source,omitempty"`
31 // spindle: CI runner to send jobs to and receive results from
···25 // labels: List of labels that this repo subscribes to
26 Labels []string `json:"labels,omitempty" cborgen:"labels,omitempty"`
27 // name: name of the repo
28+ Name string `json:"name" cborgen:"name"`
29+ RepoDid *string `json:"repoDid,omitempty" cborgen:"repoDid,omitempty"`
30 // source: source of the repo
31 Source *string `json:"source,omitempty" cborgen:"source,omitempty"`
32 // spindle: CI runner to send jobs to and receive results from
···1255 return err
1256 })
12571258+ orm.RunMigration(conn, logger, "add-repo-did-column", func(tx *sql.Tx) error {
1259+ _, err := tx.Exec(`
1260+ alter table repos add column repo_did text;
1261+ create unique index if not exists idx_repos_repo_did on repos(repo_did);
1262+1263+ alter table issues add column repo_did text;
1264+ alter table pulls add column repo_did text;
1265+ alter table artifacts add column repo_did text;
1266+ alter table webhooks add column repo_did text;
1267+ alter table collaborators add column repo_did text;
1268+ alter table pull_comments add column repo_did text;
1269+ alter table profile_pinned_repositories add column repo_did text;
1270+ alter table repo_issue_seqs add column repo_did text;
1271+ alter table repo_pull_seqs add column repo_did text;
1272+ alter table repo_languages add column repo_did text;
1273+ alter table repo_labels add column repo_did text;
1274+ alter table stars add column subject_did text;
1275+ `)
1276+ return err
1277+ })
1278+1279+ orm.RunMigration(conn, logger, "add-pds-rewrite-status", func(tx *sql.Tx) error {
1280+ _, err := tx.Exec(`
1281+ create table if not exists pds_rewrite_status (
1282+ id integer primary key autoincrement,
1283+ user_did text not null,
1284+ repo_did text not null,
1285+ record_nsid text not null,
1286+ record_rkey text not null,
1287+ old_repo_at text not null,
1288+ status text not null default 'pending',
1289+ updated_at text not null default (strftime('%Y-%m-%dT%H:%M:%SZ', 'now')),
1290+ unique(user_did, record_nsid, record_rkey)
1291+ );
1292+ create index if not exists idx_pds_rewrite_user on pds_rewrite_status(user_did, status);
1293+ `)
1294+ return err
1295+ })
1296+1297 return &DB{
1298 db,
1299 logger,
+12
knotserver/db/db.go
···65 primary key (rkey, nsid)
66 );
6700000000000068 create table if not exists migrations (
69 id integer primary key autoincrement,
70 name text unique
···65 primary key (rkey, nsid)
66 );
6768+ create table if not exists repo_keys (
69+ repo_did text primary key,
70+ signing_key blob not null,
71+ created_at text not null default (strftime('%Y-%m-%dT%H:%M:%SZ', 'now'))
72+ );
73+74+ create table if not exists repo_at_history (
75+ old_repo_at text primary key,
76+ repo_did text not null,
77+ created_at text not null default (strftime('%Y-%m-%dT%H:%M:%SZ', 'now'))
78+ );
79+80 create table if not exists migrations (
81 id integer primary key autoincrement,
82 name text unique
+9
lexicons/actor/profile.json
···60 "maxGraphemes": 40,
61 "maxLength": 400
62 },
00000000063 "pinnedRepositories": {
64 "type": "array",
65 "description": "Any ATURI, it is up to appviews to validate these fields.",
···60 "maxGraphemes": 40,
61 "maxLength": 400
62 },
63+ "pinnedRepositoryDids": {
64+ "type": "array",
65+ "minLength": 0,
66+ "maxLength": 6,
67+ "items": {
68+ "type": "string",
69+ "format": "did"
70+ }
71+ },
72 "pinnedRepositories": {
73 "type": "array",
74 "description": "Any ATURI, it is up to appviews to validate these fields.",
···21 "format": "at-uri",
22 "description": "The subject (task, pull or discussion) of this label. Appviews may apply a `scope` check and refuse this op."
23 },
000024 "performedAt": {
25 "type": "string",
26 "format": "datetime"
···21 "format": "at-uri",
22 "description": "The subject (task, pull or discussion) of this label. Appviews may apply a `scope` check and refuse this op."
23 },
24+ "subjectDid": {
25+ "type": "string",
26+ "format": "did"
27+ },
28 "performedAt": {
29 "type": "string",
30 "format": "datetime"
···26 "format": "at-uri",
27 "description": "repo that this artifact is being uploaded to"
28 },
000029 "tag": {
30 "type": "bytes",
31 "description": "hash of the tag object that this artifact is attached to (only annotated tags are supported)",
···26 "format": "at-uri",
27 "description": "repo that this artifact is being uploaded to"
28 },
29+ "repoDid": {
30+ "type": "string",
31+ "format": "did"
32+ },
33 "tag": {
34 "type": "bytes",
35 "description": "hash of the tag object that this artifact is attached to (only annotated tags are supported)",
+4
lexicons/repo/collaborator.json
···24 "description": "repo to add this user to",
25 "format": "at-uri"
26 },
000027 "createdAt": {
28 "type": "string",
29 "format": "datetime"