Monorepo for Tangled tangled.org

lexicons, api/tangled: add repoDid field to all repo-scoped lexicons #1134

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/3mgprvt2e3b22
+92 -26
Diff #11
api/tangled/actorprofile.go

This is a binary file and will not be displayed.

api/tangled/cbor_gen.go

This is a binary file and will not be displayed.

api/tangled/feedstar.go

This is a binary file and will not be displayed.

api/tangled/gitrefUpdate.go

This is a binary file and will not be displayed.

api/tangled/repoartifact.go

This is a binary file and will not be displayed.

api/tangled/repocollaborator.go

This is a binary file and will not be displayed.

api/tangled/repocreate.go

This is a binary file and will not be displayed.

api/tangled/repoissue.go

This is a binary file and will not be displayed.

api/tangled/repopull.go

This is a binary file and will not be displayed.

api/tangled/tangledpipeline.go

This is a binary file and will not be displayed.

api/tangled/tangledrepo.go

This is a binary file and will not be displayed.

+9
lexicons/actor/profile.json
··· 60 60 "maxGraphemes": 40, 61 61 "maxLength": 400 62 62 }, 63 + "pinnedRepositoryDids": { 64 + "type": "array", 65 + "minLength": 0, 66 + "maxLength": 6, 67 + "items": { 68 + "type": "string", 69 + "format": "did" 70 + } 71 + }, 63 72 "pinnedRepositories": { 64 73 "type": "array", 65 74 "description": "Any ATURI, it is up to appviews to validate these fields.",
+4 -1
lexicons/feed/star.json
··· 10 10 "record": { 11 11 "type": "object", 12 12 "required": [ 13 - "subject", 14 13 "createdAt" 15 14 ], 16 15 "properties": { ··· 18 17 "type": "string", 19 18 "format": "at-uri" 20 19 }, 20 + "subjectDid": { 21 + "type": "string", 22 + "format": "did" 23 + }, 21 24 "createdAt": { 22 25 "type": "string", 23 26 "format": "datetime"
+6 -2
lexicons/git/refUpdate.json
··· 11 11 "required": [ 12 12 "ref", 13 13 "committerDid", 14 - "repoDid", 15 14 "repoName", 16 15 "oldSha", 17 16 "newSha", ··· 29 28 "description": "did of the user that pushed this ref", 30 29 "format": "did" 31 30 }, 32 - "repoDid": { 31 + "ownerDid": { 33 32 "type": "string", 34 33 "description": "did of the owner of the repo", 35 34 "format": "did" 36 35 }, 36 + "repoDid": { 37 + "type": "string", 38 + "description": "DID of the repo itself", 39 + "format": "did" 40 + }, 37 41 "repoName": { 38 42 "type": "string", 39 43 "description": "name of the repo"
+5 -1
lexicons/issue/issue.json
··· 9 9 "key": "tid", 10 10 "record": { 11 11 "type": "object", 12 - "required": ["repo", "title", "createdAt"], 12 + "required": ["title", "createdAt"], 13 13 "properties": { 14 14 "repo": { 15 15 "type": "string", 16 16 "format": "at-uri" 17 17 }, 18 + "repoDid": { 19 + "type": "string", 20 + "format": "did" 21 + }, 18 22 "title": { 19 23 "type": "string" 20 24 },
+5 -1
lexicons/pipeline/pipeline.json
··· 66 66 "required": [ 67 67 "knot", 68 68 "did", 69 - "repo", 70 69 "defaultBranch" 71 70 ], 72 71 "properties": { ··· 77 76 "type": "string", 78 77 "format": "did" 79 78 }, 79 + "repoDid": { 80 + "type": "string", 81 + "description": "DID of the repo itself", 82 + "format": "did" 83 + }, 80 84 "repo": { 81 85 "type": "string" 82 86 },
+8 -1
lexicons/pulls/pull.json
··· 65 65 "target": { 66 66 "type": "object", 67 67 "required": [ 68 - "repo", 69 68 "branch" 70 69 ], 71 70 "properties": { ··· 73 72 "type": "string", 74 73 "format": "at-uri" 75 74 }, 75 + "repoDid": { 76 + "type": "string", 77 + "format": "did" 78 + }, 76 79 "branch": { 77 80 "type": "string" 78 81 } ··· 96 99 "repo": { 97 100 "type": "string", 98 101 "format": "at-uri" 102 + }, 103 + "repoDid": { 104 + "type": "string", 105 + "format": "did" 99 106 } 100 107 } 101 108 }
+4 -1
lexicons/repo/artifact.json
··· 11 11 "type": "object", 12 12 "required": [ 13 13 "name", 14 - "repo", 15 14 "tag", 16 15 "createdAt", 17 16 "artifact" ··· 26 25 "format": "at-uri", 27 26 "description": "repo that this artifact is being uploaded to" 28 27 }, 28 + "repoDid": { 29 + "type": "string", 30 + "format": "did" 31 + }, 29 32 "tag": { 30 33 "type": "bytes", 31 34 "description": "hash of the tag object that this artifact is attached to (only annotated tags are supported)",
+4 -1
lexicons/repo/collaborator.json
··· 11 11 "type": "object", 12 12 "required": [ 13 13 "subject", 14 - "repo", 15 14 "createdAt" 16 15 ], 17 16 "properties": { ··· 24 23 "description": "repo to add this user to", 25 24 "format": "at-uri" 26 25 }, 26 + "repoDid": { 27 + "type": "string", 28 + "format": "did" 29 + }, 27 30 "createdAt": { 28 31 "type": "string", 29 32 "format": "datetime"
+23 -1
lexicons/repo/create.json
··· 10 10 "schema": { 11 11 "type": "object", 12 12 "required": [ 13 - "rkey" 13 + "rkey", 14 + "name" 14 15 ], 15 16 "properties": { 16 17 "rkey": { 17 18 "type": "string", 18 19 "description": "Rkey of the repository record" 19 20 }, 21 + "name": { 22 + "type": "string", 23 + "description": "Name of the repository" 24 + }, 20 25 "defaultBranch": { 21 26 "type": "string", 22 27 "description": "Default branch to push to" ··· 24 29 "source": { 25 30 "type": "string", 26 31 "description": "A source URL to clone from, populate this when forking or importing a repository." 32 + }, 33 + "repoDid": { 34 + "type": "string", 35 + "format": "did", 36 + "description": "Optional user-provided did:web to use as the repo identity instead of minting a did:plc." 37 + } 38 + } 39 + } 40 + }, 41 + "output": { 42 + "encoding": "application/json", 43 + "schema": { 44 + "type": "object", 45 + "properties": { 46 + "repoDid": { 47 + "type": "string", 48 + "format": "did" 27 49 } 28 50 } 29 51 }
+5
lexicons/repo/repo.json
··· 60 60 "format": "at-uri" 61 61 } 62 62 }, 63 + "repoDid": { 64 + "type": "string", 65 + "format": "did", 66 + "description": "DID of the repo itself, if assigned" 67 + }, 63 68 "createdAt": { 64 69 "type": "string", 65 70 "format": "datetime"
+13 -11
spindle/models/clone_test.go
··· 8 8 "tangled.org/core/workflow" 9 9 ) 10 10 11 + func sp(s string) *string { return &s } 12 + 11 13 func TestBuildCloneStep_PushTrigger(t *testing.T) { 12 14 twf := tangled.Pipeline_Workflow{ 13 15 Clone: &tangled.Pipeline_CloneOpts{ ··· 26 28 Repo: &tangled.Pipeline_TriggerRepo{ 27 29 Knot: "example.com", 28 30 Did: "did:plc:user123", 29 - Repo: "my-repo", 31 + Repo: sp("my-repo"), 30 32 }, 31 33 } 32 34 ··· 85 87 Repo: &tangled.Pipeline_TriggerRepo{ 86 88 Knot: "example.com", 87 89 Did: "did:plc:user123", 88 - Repo: "my-repo", 90 + Repo: sp("my-repo"), 89 91 }, 90 92 } 91 93 ··· 112 114 Repo: &tangled.Pipeline_TriggerRepo{ 113 115 Knot: "example.com", 114 116 Did: "did:plc:user123", 115 - Repo: "my-repo", 117 + Repo: sp("my-repo"), 116 118 }, 117 119 } 118 120 ··· 143 145 Repo: &tangled.Pipeline_TriggerRepo{ 144 146 Knot: "example.com", 145 147 Did: "did:plc:user123", 146 - Repo: "my-repo", 148 + Repo: sp("my-repo"), 147 149 }, 148 150 } 149 151 ··· 173 175 Repo: &tangled.Pipeline_TriggerRepo{ 174 176 Knot: "localhost:3000", 175 177 Did: "did:plc:user123", 176 - Repo: "my-repo", 178 + Repo: sp("my-repo"), 177 179 }, 178 180 } 179 181 ··· 203 205 Repo: &tangled.Pipeline_TriggerRepo{ 204 206 Knot: "example.com", 205 207 Did: "did:plc:user123", 206 - Repo: "my-repo", 208 + Repo: sp("my-repo"), 207 209 }, 208 210 } 209 211 ··· 234 236 Repo: &tangled.Pipeline_TriggerRepo{ 235 237 Knot: "example.com", 236 238 Did: "did:plc:user123", 237 - Repo: "my-repo", 239 + Repo: sp("my-repo"), 238 240 }, 239 241 } 240 242 ··· 259 261 Repo: &tangled.Pipeline_TriggerRepo{ 260 262 Knot: "example.com", 261 263 Did: "did:plc:user123", 262 - Repo: "my-repo", 264 + Repo: sp("my-repo"), 263 265 }, 264 266 } 265 267 ··· 292 294 Repo: &tangled.Pipeline_TriggerRepo{ 293 295 Knot: "example.com", 294 296 Did: "did:plc:user123", 295 - Repo: "my-repo", 297 + Repo: sp("my-repo"), 296 298 }, 297 299 } 298 300 ··· 321 323 Repo: &tangled.Pipeline_TriggerRepo{ 322 324 Knot: "example.com", 323 325 Did: "did:plc:user123", 324 - Repo: "my-repo", 326 + Repo: sp("my-repo"), 325 327 }, 326 328 } 327 329 ··· 350 352 Repo: &tangled.Pipeline_TriggerRepo{ 351 353 Knot: "example.com", 352 354 Did: "did:plc:user123", 353 - Repo: "my-repo", 355 + Repo: sp("my-repo"), 354 356 }, 355 357 } 356 358
+6 -6
spindle/models/pipeline_env_test.go
··· 18 18 Repo: &tangled.Pipeline_TriggerRepo{ 19 19 Knot: "example.com", 20 20 Did: "did:plc:user123", 21 - Repo: "my-repo", 21 + Repo: sp("my-repo"), 22 22 DefaultBranch: "main", 23 23 }, 24 24 } ··· 81 81 Repo: &tangled.Pipeline_TriggerRepo{ 82 82 Knot: "example.com", 83 83 Did: "did:plc:user123", 84 - Repo: "my-repo", 84 + Repo: sp("my-repo"), 85 85 }, 86 86 } 87 87 id := PipelineId{ ··· 113 113 Repo: &tangled.Pipeline_TriggerRepo{ 114 114 Knot: "example.com", 115 115 Did: "did:plc:user123", 116 - Repo: "my-repo", 116 + Repo: sp("my-repo"), 117 117 }, 118 118 } 119 119 id := PipelineId{ ··· 168 168 Repo: &tangled.Pipeline_TriggerRepo{ 169 169 Knot: "example.com", 170 170 Did: "did:plc:user123", 171 - Repo: "my-repo", 171 + Repo: sp("my-repo"), 172 172 }, 173 173 } 174 174 id := PipelineId{ ··· 204 204 Repo: &tangled.Pipeline_TriggerRepo{ 205 205 Knot: "localhost:3000", 206 206 Did: "did:plc:user123", 207 - Repo: "my-repo", 207 + Repo: sp("my-repo"), 208 208 }, 209 209 } 210 210 id := PipelineId{ ··· 239 239 Repo: &tangled.Pipeline_TriggerRepo{ 240 240 Knot: "example.com", 241 241 Did: "did:plc:user123", 242 - Repo: "my-repo", 242 + Repo: sp("my-repo"), 243 243 }, 244 244 } 245 245 id := PipelineId{

History

12 rounds 2 comments
sign up or login to add to the discussion
1 commit
expand
lexicons, api/tangled: add repoDid field to all repo-scoped lexicons
no conflicts, ready to merge
expand 0 comments
1 commit
expand
lexicons, api/tangled: add repoDid field to all repo-scoped lexicons
expand 0 comments
1 commit
expand
lexicons, api/tangled: add repoDid field to all repo-scoped lexicons
expand 2 comments

repoDid should be considered completly optional at this point and not to replace repoAt yet. In other words, fields using AT-URI are still required. While we want new records to all migrate over to new schema, internal appview logic can't force that until enough amount of records are migrated. So repoAt is still required with optional repoDid. Appview should store additional repoDid for each records in DB, but don't actually use it. This constraint in appview should affect lexicons too.

Once we have enough records migrated to repoDid, only then we can finally make it hard requirement & completely drop repoAt. While migrating, we should still have repoAt, even for new records, we will just drop them after migration is complete.

I mean I've just made the application layer prefer DIDs at the edges, in routing, rbac, pds records, knot comms - while keeping at_uri as the appview db backbone. I wouldn't call it "stored but unused", maybe a "dual-track system" for now until the deadline of having switched all knots over.

1 commit
expand
lexicons, api/tangled: add repoDid field to all repo-scoped lexicons
expand 0 comments
1 commit
expand
lexicons, api/tangled: add repoDid field to all repo-scoped lexicons
expand 0 comments
1 commit
expand
lexicons, api/tangled: add repoDid field to all repo-scoped lexicons
expand 0 comments
1 commit
expand
lexicons, api/tangled: add repoDid field to all repo-scoped lexicons
expand 0 comments
1 commit
expand
lexicons, api/tangled: add repoDid field to all repo-scoped lexicons
expand 0 comments
1 commit
expand
lexicons, api/tangled: add repoDid field to all repo-scoped lexicons
expand 0 comments
1 commit
expand
lexicons, api/tangled: add repoDid field to all repo-scoped lexicons
expand 0 comments
1 commit
expand
lexicons, api/tangled: add repoDid field to all repo-scoped lexicons
expand 0 comments
1 commit
expand
lexicons, api/tangled: add repoDid field to all repo-scoped lexicons
expand 0 comments