api: Add status-messages to repo-updater and GraphQL API
Created by: mrnugget
This is the first part of the implementation of #4120 (closed) as described in https://github.com/sourcegraph/sourcegraph/issues/4120#issuecomment-499911568. (The second part will include the web
component, UI, and changelog entry)
- Adds a
/clone-queue-status
endpoint togitserver
that returns the current and maximum number of repositories currently being cloned in parallel - Adds a
/status-messages
endpoint torepo-updater
that returns an array of status messages. Currently only one type exists,CURRENTLYCLONING
, and that is only returned if the number of currently cloning repositories, as returned bygitserver
, is non-zero. - Adds a
statusMessages
query to thegraphqlbackend
that allows querying for status messages for site admins
The second part of this implementation will be a second PR that includes the web
component of this feature.
Note: this is the minimal-viable implementation of this feature, as described in the ticket, and returns only the number of currently-being-cloned repositories.
The big caveat is that this number is not usable to indicate progress, it indicates activity. We have to evaluate/test/discuss whether that is "minimal-viable" for site-admins. Since the number could potentially be stuck at 5
for hours at a time if the Sourcegraph instance has been configured to only clone 5 concurrently (that's the default). But that would at least be an indicator that something happen, it's just not a progress-indicator and we have to be clear about this.
(cc @christinaforney)
Test plan: go test