gitserver: Support MigrateFrom in RepoUpdateRequest
Created by: indradhanush
Issue created from discussion #26416.
We would like to clone a repo from one gitserver instance to another as part of the repo migration to the new hashing scheme. The first step towards this will be to add the ability to send a clone request to gitserver with the config to clone from another gitserver instance instead of the upstream repo URL of the external service. To do this, add:
-
A MigrateFrom
string attribute togitserver.protocol.RepoUpdateRequest
-
A MigrateFrom
string attribute togitserver.server.cloneOptions
And finally modify:
-
gitserver.server.handleRepoUpdate
to parseprotocol.RepoUpdateRequest.MigrateFrom
and set it toserver.cloneOption.MigrateFrom
so that in a subsequent PR we can make the decision to clone from a gitserver if this attribute is a non zero string.