Gerrit Editing Workflow: Merging Conflicts and Reapproval

We are considering using Gerrit for a large project. At this point, it would be interesting to know how people face merging conflicts of approved changes.

Imagine that many changes of different sizes are checked at the same time, and they are checked and checked gradually. Since some of them can modify the same code, conflicts are inevitable. This is not a problem if the β€œintegrator” accepts the patches manually in a simple workflow, small conflicts can be resolved along the way, but things are different with Gerrit. When the change has been revised and approved, in the event of a merger conflict, as I understand it, it will need to be reinstalled by the author and clicked again to review, in which case the review process will start again. In relatively active projects, when more than 50 external contributors are committed per week, this can turn into a nightmare if revision of the same patch may be required several times due to refusal to merge after each approval and submission, which seems to be ineffective.

Questions:

  • I will correct that Gerrit is not a way to promote large and active material, where a large number of merge conflicts are expected?

  • Some merge conflicts may be trivial, is there a way to resolve them without having to bother the author to confirm the change?

  • If the change should be addressed to stable branches (branches), I think that a separate change for each branch should be pushed for review, even if the cherry-pick is clean.

General comments on your Gerrit workflow are also welcome.

+7
source share
4 answers
  • Gerrit is used by some really massive projects like Android and its associated bsp, kernel repositories, etc. These projects receive more than 50 external transactions per week. I think Qualcomm will have several thousand transactions around this time.

  • Gerrit has a setting to automatically merge trivial conflicts. This can be set for each repository. If this parameter is set, the change is combined according to your sending strategy (cherry pick, merge, if necessary) after the change has been verified and verified, and the user clicks the "Submit" button. The best documentation I can find for this is here http://gerrit-documentation.googlecode.com/svn/Documentation/2.3/cmd-create-project.html#_options in the -use-content-merge option.

  • Yes, usually we do things. There are other options (bypassing the review, merging branches, etc.), but the selection of cherries in the desired branches and review of the work is good.

+7
source

We want to keep our story clean and clear, and therefore fairly linear. Therefore, we configured Gerrit to use only fast merge. The only visible merges are for the release and support branches (we use git -flow), which greatly simplifies understanding.

However, we have a plugin with a trivial update, so the previous review status is automatically applied to the changed change. This happens regardless of whether a reboot is performed in Gerrit (using the Rebase button) or when the developer reboots locally and then clicks on the change again.

In our experience, merge conflicts are actually less common in a large project due to the much larger number of source files. We have about 16,000 files in the repo and 30 full-time or part-time developers, so the likelihood of editing the same file is pretty low.

In any case, if two developers make changes to the same part of the same file, they really should talk to each other. If the project architecture requires frequent changes in one file (for example, some kind of registration table), you need to change the architecture, use something like dependency injection, or automatically generate this source file from fragments as part of the assembly.

+4
source

When we encounter a merger problem in our company, the developer reinstalls and migrates to gerrit. If the merger was minimal, he allowed (by agreement) the LGTM to reinstall and ship.

We are still discussing whether / when developers should update updates when patches are updated. The user interface gets confused when comparing between patches when changing the parent element.

+2
source

I use it for several weeks after using mercurial for several years, when the function branch is merged into default mode, and I hate gerrit. I find myself with a lot of overhead, resolving trivial conflicts that are automatically resolved by merging to mercurial or git in non-gerrit mode. Then everyone uses the argument android uses gerrit ergo gerrit, this is good and should work for everyone.

0
source

All Articles