sourcegraph / sourcegraph-public-snapshot

Code AI platform with Code Search & Cody
https://sourcegraph.com
Other
10.1k stars 1.27k forks source link

Rename External Code Host #2021

Open terinjokes opened 5 years ago

terinjokes commented 5 years ago

Feature request description

If Sourcegraph is configured to synchronize with a self-hosted code host, it's possible for the code host to change domain names, whilst still containing the same repositories. There is currently no way to rename a code host without creating entirely new repositories (and then manually deleting the repositories from the old name)

For example, a Sourcegraph installation may be configured to use Atlassian Stash at stash.example.com. When the customer upgrades to Atlassian Bitbucket Server, they moved the instance to bitbucket.example.com.

Is your feature request related to a problem? If so, please describe.

There's a related, but different, discussion for renaming individual repositories in #914. This does not discuss renaming whole code hosts, however.

Describe alternatives you've considered.

Additional context

Some users may have saved searches that reference the old code host name. While it would be nice to also automatically update these, it's not as much of a blocker.

keegancsmith commented 5 years ago

I don't think this is something that is reasonable to solve without an admins intervention. We uniquely identify a repository by the pair (code_host_url, id_on_code_host). I think the best solution here is a guide for administrators which includes only updating the repos and external service table directly? Then in conjunction with our aliases work everything else should fall in to place.

However, this seems like a very rare thing to happen. So I'd only consider this if it became an important customer request.