Something went wrong while fetching comments. Please try again.
Created by: vrto
gitserver: Add support for repository pinning
This adds a new site config option to configure pinned repositories. An admin can manually specify which git repositories will be pinned to gitserver instances.
Example config:
"experimentalFeatures": {
"gitServerPinnedRepos": {
"github.com/hashicorp/go-multierror": "127.0.0.1:3502",
}
Please note that for now, this feature is experimental. The pinning works, but we'll need to follow up for janitor code that will smoothly migrate the cloned repo to another gitserver instance (so we avoid an additional re-clone). This is currently in progress. After a conversation with @asdine, we agreed that it's easier to reuse this code once ready (instead of developing the same thing twice).
https://user-images.githubusercontent.com/3193149/159436694-c383c147-e94e-42e1-8a81-04f5572561a5.mp4
GitServerAddresses
struct to group the hostnames with pinned repos (so they're always accessed and processed together)AddrForRepo
avoids calling the hashing function (for computing gitserver address) when the repo in question is pinnedpinned
repos are observed, the ClientImplementor
fetches a fresh copy from conf (so we don't have to watch for changes and sync state)watchForPinned
hook available and will use the repo migration logic once ready (see the Description section above)Related to #32319 (closed)