search: alert on structural search for unindexed repos
Created by: rvantonder
Currently structural search will return no results for unindexed repos. This is a silent behavior and can confuse users. This PR raises an alert when unindexed repos are searched. Here's what the current message looks like on sourcegraph.com (casual users who may want to try self-install):
Here's what it looks like on non-sourcegraph.com (e.g., fo admins or self-installers)
Notes:
-
I couldn't find a way to selectively create indexed and unindexed repos (to see whether partial results are shown). I only set
"search.index.enabled": false
in the config to see that the messages are shown. If you have an idea how, please comment. -
The only real mechanism to raise an alert without doing a substantial rewrite is to return an error in
doResults
and then promote it to an alert. I really don't like this but a substantial rewrite will be involved. -
Test pending. Putting this up now so that I can get feedback on the above points, and the message phrasing.