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
+7 -3
Interdiff #11 #12
api/tangled/actorprofile.go

Failed to calculate interdiff for this file.

api/tangled/cbor_gen.go

Failed to calculate interdiff for this file.

api/tangled/feedstar.go

Failed to calculate interdiff for this file.

api/tangled/gitrefUpdate.go

Failed to calculate interdiff for this file.

api/tangled/repoartifact.go

Failed to calculate interdiff for this file.

api/tangled/repocollaborator.go

Failed to calculate interdiff for this file.

api/tangled/repocreate.go

Failed to calculate interdiff for this file.

api/tangled/repoissue.go

Failed to calculate interdiff for this file.

api/tangled/repopull.go

Failed to calculate interdiff for this file.

api/tangled/tangledpipeline.go

Failed to calculate interdiff for this file.

api/tangled/tangledrepo.go

Failed to calculate interdiff for this file.

lexicons/actor/profile.json

This file has not been changed.

lexicons/feed/star.json

This file has not been changed.

lexicons/git/refUpdate.json

This file has not been changed.

lexicons/issue/issue.json

This file has not been changed.

lexicons/pipeline/pipeline.json

This file has not been changed.

lexicons/pulls/pull.json

This file has not been changed.

lexicons/repo/artifact.json

This file has not been changed.

lexicons/repo/collaborator.json

This file has not been changed.

lexicons/repo/create.json

This file has not been changed.

lexicons/repo/repo.json

This file has not been changed.

spindle/models/clone_test.go

This file has not been changed.

spindle/models/pipeline_env_test.go

This file has not been changed.

+7 -3
knotmirror/knotstream/slurper.go
··· 272 272 func (s *KnotSlurper) ProcessLegacyGitRefUpdate(ctx context.Context, evt *LegacyGitEvent) error { 273 273 knotstreamEventsReceived.Inc() 274 274 275 - curr, err := db.GetRepoByName(ctx, s.db, syntax.DID(evt.Event.RepoDid), evt.Event.RepoName) 275 + repoDid := "" 276 + if evt.Event.RepoDid != nil { 277 + repoDid = *evt.Event.RepoDid 278 + } 279 + curr, err := db.GetRepoByName(ctx, s.db, syntax.DID(repoDid), evt.Event.RepoName) 276 280 if err != nil { 277 - return fmt.Errorf("failed to get repo '%s': %w", evt.Event.RepoDid+"/"+evt.Event.RepoName, err) 281 + return fmt.Errorf("failed to get repo '%s': %w", repoDid+"/"+evt.Event.RepoName, err) 278 282 } 279 283 if curr == nil { 280 284 // if repo doesn't exist in DB, just ignore the event. That repo is unknown. ··· 284 288 // But we want to store that in did/rkey in knot-mirror. 285 289 // Therefore, we should ignore when the repository is unknown. 286 290 // Hopefully crawler will sync it later. 287 - s.logger.Warn("skipping event from unknown repo", "did/repo", evt.Event.RepoDid+"/"+evt.Event.RepoName) 291 + s.logger.Warn("skipping event from unknown repo", "did/repo", repoDid+"/"+evt.Event.RepoName) 288 292 knotstreamEventsSkipped.Inc() 289 293 return nil 290 294 }

History

14 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 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