Glasgow Haskell Compiler (GHC) migration to GitLab
# Background
The [Glasgow Haskell Compiler](https://ghc.haskell.org/) is planning a migration to GitLab. GHC's infrastructure is currently:
* Trac for ticket tracking and wiki
* gitolite and a variety of custom tooling for repository hosting
* Phabricator for code review
* a mix of CircleCI (for Linux, macOS) and Appveyor (for Windows) for CI
Those responsible for GHC's infrastructure has been in touch with GitLab (namely @dplanella).
# Goals
The main goals for a successful migration would be:
* More accessible infrastructure for contributors
* Code review integration with git
* Reliable and maintainable multi-platform continuous integration
* Streamlined infrastructure and tooling
* Good relationship and open communication channel with upstream (GitLab in this case)
# Discussion
Currently the migration is underway. [Tools](https://github.com/bgamari/trac-to-remarkup/tree/master/src/Trac) for migrating Trac tickets and the wiki into GitLab are largely complete. A staging installation can be found [here](https://gitlab.staging.haskell.org/).
## GitLab replacements
| Tool | Feature | GitLab feature | GitLab edition |
|:----------- |:---------------------------------- |:---------------------------------- |:--------------- |
| Gitolite | GitHub -> Git mirroring | Repository mirroring | EE |
| Gitolite | Git -> GitHub mirroring | Repository mirroring | EE |
| Trac | Tickets | Issues | CE |
| Trac | [Ticket lists](https://ghc.haskell.org/trac/ghc/wiki/Status/GHC-8.6.3) | Issue boards | CE |
| Trac | Ticket notifications mailing list | ? | ? |
| Trac | Ticket priority | Issue weight | EE |
| Trac | Wiki | Wiki | CE |
| Phabricator | Herald for automatic reviewer assignment | Code owners | EE |
| Phabricator | Code review | Discussions | CE |
| Phabricator | Continuous integration | Pipelines | CE |
| CircleCI | Continuous integration | Pipelines with [custom CircleCI bridge tool](https://gitlab.staging.haskell.org/alp/ghc-ci) | CE |
| Appveyor | Continuous integration | Pipelines and Appveyor's GitLab integration | CE |
# Outstanding issues
## Blockers
* [x] Issues/API: Import difficulties due to gitlab-ce#46980
* [x] Issues: Commit notes aren't created if ticket is created after commit is pushed (gitlab-ce#56943; worked around).
## Urgent
* [ ] Difficult to run certain CI jobs only on merge requests (gitlab-ce#56418)
* [x] Gitaly loses its mind on an otherwise normal repository (gitlab-ce#57067)
* [x] Functional `gitlab-runner` support on Windows. This might be either accomplished by
* fixing https://gitlab.com/gitlab-org/gitlab-runner/issues/3856,
* following through on https://gitlab.com/gitlab-org/gitlab-runner/issues/2609. It looks like there is motion along these lines on https://gitlab.com/groups/gitlab-org/-/epics/535
* [x] Functional artifact uploads on Windows (gitlab-runner#3035)
* [ ] Approvers are spammed with large quantities of email (gitlab-ee#4816)
## Important but not urgent
* `gitlab-runner`
* [ ] `gitlab-runner` fails to heartbeat while running a job on Windows (https://gitlab.com/gitlab-org/gitlab-runner/issues/3854)
* [ ] `gitlab-runner` support for AArch64: https://gitlab.com/gitlab-org/gitlab-runner/merge_requests/725, https://gitlab.com/gitlab-org/gitlab-runner/issues/2137
* [ ] `gitlab-runner` support for msys2 (https://gitlab.com/gitlab-org/gitlab-runner/issues/1699)
* [ ] `gitlab-runner` leaves old Docker volumes around (gitlab-runner#2980)
* Issues:
* [ ] Closed milestones not shown in milestones line (gitlab-ce#25091)
* [x] Issues are incorrectly closed by commits containing `doesn't fix #NNNN` in their commit message (gitlab-ce#55970)
* [ ] Issue search via issue number is broken (gitlab-ce#30974)
* Code review:
* [x] Send one email notification per published code review gitlab-ee#4326.
* [ ] Finding changes between merge request revisions is quite difficult (gitlab-ce#51336)
* [ ] Very difficult to orient oneself in long reviews (gitlab-ce#52485)
* [ ] Finding new inline comments is quite hard (gitlab-ce#56481)
* [ ] Automatically rebase stale MRs marked as "merge when pipelines pass" (&521)
* [ ] Attach non-inline comments to transactional reviews (gitlab-ee#8225)
## Important but not prioritized by GitLab
* [ ] Pipelines: No way to build all commits (gitlab-ce#53799)
* [ ] Wiki: Non-developers can't view wiki history (gitlab-ce#14620)
## Nice to have
* [ ] Issues: Issue search autocompletion should be less selective (gitlab-ce#57249)
* [ ] Code review: Comments not allowed on unchanged lines (gitlab-ce#51823)
* [x] Code review: file tree (gitlab-ce#46474)
* [x] Pipelines: Need to custom bridge tool to integrate with CircleCI (need mitigated by migration away from CircleCI)
* [ ] Pipelines: Difficulty of managing builder images, no story for Docker on Windows. Potentially helped by gitlab-runner!464, gitlab-runner#2885
* [ ] Pipelines: No way to query triggered pipeline status (gitlab-ee#5096)
* [ ] gitlab-runner: `extends` keywords is broken in some cases (gitlab-runner#3794)
* [ ] gitlab-runner: `gitlab-runner` violates the principle of least privilege (gitlab-runner#3188)
* [ ] Issues: Label namespace clutter due to lack of custom fields (https://gitlab.com/gitlab-org/gitlab-ee/issues/1906, &235)
* [ ] Issues: Better handling of duplicate and blocking ticket relationships (gitlab-ce#47007, gitlab-ce#39751)
* [x] Repository mirror: Crash (gitlab-ce#55350)
* [ ] Code review: Convenient way to fold all resolved discussions (gitlab-ce#55747)
* [ ] Code review: Allow user to rewrite commit message while squashing during merge (gitlab-ee#1510)
* [ ] Code review: Button to toggle visibility of all discussions (gitlab-ce#19149)
* [ ] Search: Be more clever in identifying user intent for searching on IDs (gitlab-ce#56967)
* [x] Poor search relevance: fix ElasticSearch support (gitlab-ee#9633)
# Status
The migration effort is on a fairly aggressive timeline due to various considerations. The plan is to switch over to GitLab by December 18. There is a test instance [here](https://gitlab.staging.haskell.org/). This is a self-hosted GitLab Ultimate installation provided through the [GitLab FOSS initiative](https://gitlab.com/gitlab-com/marketing/community-relations/opensource-program/gitlab-oss/merge_requests/217) which includes an import of GHC's Trac tickets and users from a few months ago.
After migration there are a
# Collaborators
* @bgamari
* @dplanella
issue