[go: up one dir, main page]

Include suggested procedure for creating EE branch for conflicting CE MR

When a pipeline on CE Merge Request is run, it also includes rake ee_compat_check job that checks if branch for MR cleanly applies to EE project as well, if it involves any conflicts, we include a concise log with handy list of commands that can be used to create EE branch that rake ee_compat_check can use later when CE MR is updated and pipeline is running.

Let's say you were working on a CE MR with branch name 123-my-issue-fix, in case rake ee_compat_check fails, you'll see log as follows;

=================================================================
💥  Oh no! 💥

The 123-my-issue-fix branch does not apply cleanly to the current
EE/master, and no 123-my-issue-fix-ee branch was found in the EE repository.

Please create a 123-my-issue-fix-ee branch that includes changes from
123-my-issue-fix but also specific changes than can be applied cleanly
to EE/master.

There are different ways to create such branch:

1. Create a new branch based on the CE branch and rebase it on top of EE/master

  # In the EE repo
  $ git fetch https://gitlab.com/gitlab-org/gitlab-ce.git 123-my-issue-fix
  $ git checkout -b 123-my-issue-fix-ee FETCH_HEAD

  # You can squash the 123-my-issue-fix commits into a single "Port of 123-my-issue-fix to EE" commit
  # before rebasing to limit the conflicts-resolving steps during the rebase
  $ git fetch origin
  $ git rebase origin/master

  At this point you will likely have conflicts.
  Solve them, and continue/finish the rebase.

  You can squash the 123-my-issue-fix commits into a single "Port of 123-my-issue-fix to EE".

2. Create a new branch from master and cherry-pick your CE commits

  # In the EE repo
  $ git fetch origin
  $ git checkout -b 123-my-issue-fix-ee origin/master
  $ git fetch https://gitlab.com/gitlab-org/gitlab-ce.git 123-my-issue-fix
  $ git cherry-pick SHA # Repeat for all the commits you want to pick

  You can squash the 123-my-issue-fix commits into a single "Port of 123-my-issue-fix to EE" commit.

Don't forget to push your branch to https://gitlab.com/gitlab-org/gitlab-ee.git:

  # In the EE repo
  $ git push origin 123-my-issue-fix-ee

You can then retry this failed build, and hopefully it should pass.

Stay 💪 !
=================================================================

Now those commands are life saver for first time contributor, and it would be nice to have that in our official Limit EE Conflicts documentation.