Move towards a single codebase for CE and EE
CE and EE are currently two separate repositories, with EE both adding to and modifying code from CE. This leads to merge conflicts, which complicate the development cycle. A previous "solution" to this was the periodic CE to EE merge request. These merge requests could take hours or even days to resolve. In response to this we created the Merge Train, which merges changes automatically and resolves conflicts by throwing away CE changes in favour of EE changes. This works if developers set up EE MRs whenever there is a conflict, but there are quite a few issues with this (more on this below).
At it's core, the problem is that we have two different repositories with similar (but not identical) code. As long as this split exists, getting your CE changes into EE is painful and time consuming. As such we need to move towards a single codebase for both CE and EE, and preferably also a single Git repository. There are a variety of challenges that need to be resolved to allow this, which are outlined below.
Challenges
- We need to come up with a licensing scheme in which CE code is FOSS, and EE (everything in
ee/
) is proprietary. - EE changes to CE files need to be moved out of the CE code, and into the
ee/
directory. - We need to determine how this will affect contributions, and how we can make it as easy as possible for contributors to make CE specific changes, without having to worry about EE licensing.
- With the merge, the repository would have to be renamed. This means we may need to move issues, issue boards, etc around.
- Obviously this needs to be approved by upper management
Problems with Merge Train
- Changes to
locale/gitlab.pot
in CE sometimes require you to regenerate this file for EE. Right now this is handled by requiring EE MRs, but it's very annoying and time consuming: https://gitlab.com/gitlab-org/gitlab-ce/issues/55379 - Throwing away CE changes in favour of the EE changes is risky, and can sometimes lead to weird cases: https://gitlab.com/gitlab-org/release/framework/issues/105#note_128983501.
- Every 15-20 minutes we pull a cached clone of both CE and EE, which we then update. This is around 1GB of data, excluding the various dependencies the container itself might need. While the costs of this may be very low, it's still a waste of both bandwidth and time. Worse, it means we can't run the job more than every 10 minutes or so (taking into account the time it takes to perform the work itself).
- Due to the time between changes landing in CE
master
and being merged into EEmaster
, merging changes into a stable branch could result in CE having changes not yet present in EE; without this being obvious. This could result to us announcing feature X, only to realise it's not available in EE.