org special casing in repositoryQuery should ignore / fallback for users
Created by: keegancsmith
When updating our dogfood instance's external service I got the follow error message:
External service updated, but we encountered a problem while validating the external service: 1 error occurred:
* request to http://127.0.0.1:3180/orgs/slimsag/repos?sort=pushed&page=1&per_page=100 returned status 404: Not Found
We had as repository queries the following:
"repositoryQuery": [
"org:sourcegraph archived:no",
"org:slimsag"
],
This is because we special case queries like org:NAME
. The repositoryQuery works as you expects, it returns a list of all repos belonging to slimsag. However, he is a user not an org. So when you directly use the org API it 404s.
We need to either fallback to repositoryQuery / user API. The user is likely preferable. We just use user if org 404s.