status-indicator: Show actual cloning state
There are no commits yet
Push commits to the source branch or add previously merged commits to review them.
Created by: mrnugget
This changes the status indicator from reporting whether the repositories are updating to including their actual cloning status.
This is an experiment, since the cloning status is computed with every request, every 5 seconds, by loading the complete list of repository names from the database and asking the gitserver shards whether they are cloned. Each gitserver instance then has to do a maximum of 2 os.Stat
calls per repository name.
The big upside is that this reports the actual "is this repository cloned" status. A tiny asterisk: just because a repository is currently not cloned doesn't mean it's cloning. But that could be fixed by request a new update for each uncloned repository we come across.
Questions/TODOs:
ListAllRepoNames
don't show up in repo-updater
's /metrics
endpointgitserver.Client
method AreReposCloned
is duplicated from RepoInfo
since it needs to use the same sharding logic. This should probably be refactored
Push commits to the source branch or add previously merged commits to review them.