status-indicator: Show actual cloning state
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:
-
the metrics for the new ListAllRepoNames
don't show up inrepo-updater
's/metrics
endpoint -
the code in the gitserver.Client
methodAreReposCloned
is duplicated fromRepoInfo
since it needs to use the same sharding logic. This should probably be refactored -
No tests