When moving repos to GitLab, we need a standard process for how to handle their old location on Gerrit. I need to do things in the phabricator/ namespace, and decided to script something for future use. Paired on this with @jeena yesterday. What we have so far is:
https://gitlab.wikimedia.org/repos/releng/gerrit-migrate
Assumptions were that we should do something like here:
https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/tools/scap/+/refs/heads/master
Which means deleting all files on the primary branch, replacing the README with one that points to the new location, and updating the description to include "[MOVED TO GITLAB]".
After discussion with @thcipriani, it seems like a better idea might be:
- Point HEAD to a new branch, something like MOVED_TO_GITLAB, which is empty and contains only a README that describes the new location
- Delete old primary branch
The rationale here is that:
- There's code in puppet (and maybe elsewhere) which automatically fetches various things.
- It's a safe bet this happens in places that the person migrating a given repository won't know about.
- A fetch that silently deletes all files could lead to a serious outage.
- A fetch that fails with an error is more likely to alert than to cause public-facing breakage.
- This matters less, but it's kind of weird to have divergent history between the Gerrit repo's version of e.g. master or wmf/stable and the new GitLab repo.