Page MenuHomePhabricator

Gerrit marks patches as having merge conflicts after their parent is merged
Open, Needs TriagePublic

Description

PS5 of https://gerrit.wikimedia.org/r/c/mediawiki/extensions/wikihiero/+/1293182 was marked as having a merge conflict before I rebased it through the gerrit UI. At https://gerrit.wikimedia.org/r/q/project:mediawiki/extensions/wikihiero+is:merged, you can see that only the two parent patches were merged recently, but nothing else. According to the commit message, the patch was rebased on a53c4998 when it was marked as having conflicts, which was the latest version of the parent patch before it was merged into master, so it doesn't make a lot of sense for the patch to have conflicts.

The same happened in https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1284048 (I broke the relation chain when rebasing, but it used to have a parent) and https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1293784, both of which had to be rebased through the gerrit UI and resubmitted because they were marked as having conflicts immediately after their parents were merged.

I feel like there must be a regression in Gerrit's merge conflict detection, or some other bug, as I've never seen this happen before until recently.

Event Timeline

This is the result of the merge strategy changed some time ago, which makes it harder for relation chaines to merge (T390719: Change Gerrit default submit strategy to 'Rebase if Necessary' and allowing content merge).

Only when the new parent merged as fast-forwarded all it childs in the chain can merge as well.

What happens?
The parent https://gerrit.wikimedia.org/r/c/mediawiki/extensions/wikihiero/+/1293181 has the manage "Change has been successfully rebased and submitted as 7815896cfad58e339c17e0ba7546be6d1afeb486", that result in a new patch set PS4 (+2 is on PS3) there and https://gerrit.wikimedia.org/r/c/mediawiki/extensions/wikihiero/+/1293182 is no longer a direct child and it needs rebase as well. With the old merge strategy no new PS were created.

That change was deployed 11 months ago though, and I've only noticed the bug very recently (in the last two weeks). It's also possible that I missed it before though, did anybody else ever notice this bug?

I think I've been noticing this for a longer time. Noticed it with https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1222740 today (which was a child of https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1222739). PS12 was marked as having a merge conflict. There weren't actually any conflicts. Gerrit itself recognized PS13 as a rebase-only change.