Skip to content

repo-updater: Add debug endpoint to get gitserver repo status

Administrator requested to merge rs/clone-error-status into main

Created by: ryanslade

We expose a debug endpoint that will return, in JSON format, the current status on gitserver of a repo by name.

For example, locally:

https://sourcegraph.test:3443/-/debug/proxies/repo-updater-127.0.0.1/gitserver-repo-status?repo=github.com/sourcegraph/sourcegraph

{
  "RepoID": 16,
  "ShardID": "127.0.0.1:3178",
  "CloneStatus": "cloned",
  "LastError": "",
  "LastFetched": "2022-02-21T16:30:18.785482Z",
  "LastChanged": "2022-02-21T16:30:20.201032Z",
  "UpdatedAt": "2022-02-21T16:30:20.272283Z"
}

This should make it easier for us to get this information from customers and customer support without dropping down to the DB.

Test plan

Tested manually on my local instance, see output above.

Merge request reports

Loading