Geo: Project remotes are not updated when changed
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
This is related to https://gitlab.com/gitlab-org/gitlab-ce/issues/50562.
Right now when the URL changes for a project mirror (push or pull), the old remote is removed, and the new one is added.
Currently on GitLab.com, all the repositories currently have a remote name geo, which is the fixed name used by Geo. If GitLab.com for some reason changed to a Geo secondary, the existing geo remote wouldn't be overwritten. In fact, the current remote would be wrong until manual intervention.
What we probably need to do:
- Check that the remote name matches the intended URL.
- If it does not, remove it and add a new remote.
This will require Gitaly support (e.g. gitaly#1316 (closed)).
A similar issue exists for mirrors. If a user changes the remote name, we may need to reflect that the old one is gone and remove it (https://gitlab.com/gitlab-org/gitlab-ee/blob/fdaeeec0f8323c0d5e5d2d6bb31535759adf1f8a/app/models/remote_mirror.rb#L28-29). We may need to consider creating events to indicate "Remote name X deleted" and "Remove name X added".