google / zoekt

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

Feature request: Index all repos in a GitHub Enterprise instance #84

Closed nikos912000 closed 5 years ago

nikos912000 commented 5 years ago

Was trying to find a way to index all repos on a GitHub Enterprise instance without the need to specify an org or user. Based on this don't think that's possible.

Current implementation Currently the GitHub mirror is retrieving user repos by calling the List method of the go-github client. When a user is passed, this calls the /users/:username/repos endpoint otherwise it falls back to /user/repos endpoint which lists all repos on which the authenticated user has at least read permissions. Since we don't allow an empty user string to be passed this always calls /users/:username/repos.

Future implementation Although we could allow an empty user string and still call the List method (which in its turn would call /user/repos), I believe it'd be better in that case to call the /repositories endpoint to list all public repos. This can be called through the ListAll method of the github client.