google / zoekt

Fast trigram based code search
1.69k stars 113 forks source link

Option to mirror multiple repos/users on GitHub mirror #71

Closed nikos912000 closed 5 years ago

nikos912000 commented 5 years ago

Currently it's not possible to mirror multiple organisations or users using the GitHub mirror (correct me if I'm wrong!).

Briefly, the changes needed for this are the following:

I believe it's better to give flexibility to users so that they can mirror both users and orgs at the same time, i.e. this should be an if instead of an else.

@hanwen Let me know if this sounds good to you and I can raise a PR.

hanwen commented 5 years ago

are you sure? It seems to work just fine, see https://github.com/hanwen/zoekt-config/blob/master/mirror.json

nikos912000 commented 5 years ago

Huh, I'd better read the docs more carefully, totally missed it. Yes, works fine when passing it in the expected format.

Out of curiosity, I see that by setting GithubUser we can mirror orgs as well? So, no need for a GithubOrg as I mentioned in my first point?

If this is the case, do we need the concept of an org and as a result its logic, i.e. getOrgRepos?

hanwen commented 5 years ago

I don't know, tbh. The GitHub API has separate endpoints/fields for User and Organization, but it seems they are mostly the same in practice. If you can figure out if we need to care about the difference , then that would be great.

nikos912000 commented 5 years ago

Cool, I'll take a look once I find some time. Since this is not strictly related to the issue I'm closing it. Thanks a lot for pointing me to the right direction!