GitLab/Hosting a project on GitLab

= Meta =

WMF Release Engineering is collecting notes here on migrating a project from Gerrit, GitHub, and other systems. This is intended as user-facing documentation, although parts of it may become a basis for automating some of the process.

See also: draft.

= Migrating a project =

Where should your project live?
Generally, GitLab projects live in a group named for the functional area of code, under the top-level /repos. This gives access to a shared pool of CI runners.

Users should typically be added to the project's group with an appropriate access level, rather than to the specific project.

There are some exceptions to this layout, where there are differences in policy around project trust: First, check the list of subgroups under repos to see if an appropriate group already exists. Most of the existing ones correlate to WMF teams or affiliate organizations, but in future they will likely include large functional areas like MediaWiki.
 * /toolforge-repos
 * /cloudvps-repos

If you see an existing group that seems to be a match, view the group and click on "Subgroup information" in the upper lefthand corner. Then navigate to "Members" to see existing members of the group. Ask one of them to invite you to the group. (TODO: What's the best general contact mechanism here? Phabricator form?)

If you do not find an appropriate group but think one should be created please use this form to request a new group.

You can also create repos without being added to any group but will be limited to a personal user name space. This is usually not recommended. Though existing repos can also be moved under a different group (namespace).

TODO:
 * Phab form: transactions/editengine/maniphest.task/view/105/
 * TODO: Group settings

Mirroring a project to GitLab

 * Always use  for primary branch: See T281593
 * TODO: How to rename branches
 * Don't use issues - these will be automatically disabled anyway
 * Don't use wikis - these will be automatically disabled anyway
 * TODO: Project settings
 * TODO: Copying the repo over (including review metadata with ).
 * TODO: Copying the repo over (including review metadata with ).

Enabling GitLab CI for a project

 * TODO: This is likely a guide unto itself
 * TODO: Adding

Archiving the old project on Gerrit, GitLab, or Phabricator

 * TODO: Remove from CI
 * TODO: Update Phabricator mirroring?
 * TODO: Updating external references and docs
 * TODO: Mirroring to GitHub
 * TODO: Changing remotes on existing clones