repos: Remove repo-updater RepoLookup
Created by: tsenart
-
backend.Repos.GetByName only adds new repos lazily, it doesn't update them since it loads from DB first
-
Lazy updating is actually done through other repoupdater.Client.RepoLookup call sites cmd/frontend/graphqlbackend/externallink/repository.go|119 col 41| info, err := repoupdater.DefaultClient.RepoLookup(ctx, protocol.RepoLookupArgs{ cmd/frontend/graphqlbackend/repository_mirror.go|96 col 44| result, err := repoupdater.DefaultClient.RepoLookup(ctx, repoupdaterprotocol.RepoLookupArgs{ cmd/frontend/graphqlbackend/set_user_public_repos.go|106 col 40| res, err := repoupdater.DefaultClient.RepoLookup(
-
We should remove these RepoLookup calls since they are not needed:
- Links can be a pure function over a repo loaded from the DB, no need to RPC to repo-updater get that info.
- CloneURL can be retrieved from repo.Sources.
-
For each backend.Repos.GetByName:
- Ask: Do we actually need lazy syncing (adding AND updating) in this code path?
- Yes: Keep using backend.Repos.GetByName after changing it to actually always update (either via repo-updater, or by using repos.Syncer.SyncRepo directly)
- No: Change to using database.ReposStore.GetByName which doesn't do any syncing