Page MenuHomePhabricator

Write an algorithm that can detect a resolution suggestion
Closed, ResolvedPublic2 Estimated Story Points

Description

If there is exactly one conflicting change on the page that consists of an addition from both conflicting users and the page is a discussion page and the changes were attempted to be at the exact same spot it should be easy to merge it. So in that case we can suggest a resolution in a reduced interface.

The relevant line of code in the existing code is where a new \Diff() is created and processed in LineBasedUnifiedDiffFormatter::format(). The detection algorithm would do something very similar:

  • Create two of these Diff objects, one from the base to the first edit, another one from the same base to the conflicting edit.
  • Compare the two Diff. Both must start with a "copy" block that does have the exact same content (same number of lines), followed by an "add" block (doesn't matter how long it is), followed by another "copy" block (must be identical again).

( from T239792#5785392 )

Event Timeline

Change 563493 had a related patch set uploaded (by Andrew-WMDE; owner: Andrew-WMDE):
[mediawiki/extensions/TwoColConflict@master] [WIP][POC] Algorithm for auto-resolving certain conflicts

https://gerrit.wikimedia.org/r/563493

The current practice of preforming merges silently is a problem, and I would say this particular talk-case case increases the priority on T76997 Edit conflict automatic resolution can silently produce unexpected results. If I edit-conflict at same spot in a discussion I want to either approve the proposed merge, or at minimum be shown the other person's content after the auto-merge. It's possible for this sort of merge to badly distort the apparent context and meaning of a comment.

thiemowmde added a subscriber: Andrew-WMDE.
thiemowmde set the point value for this task to 5.Feb 4 2020, 2:10 PM

Change 579511 had a related patch set uploaded (by WMDE-Fisch; owner: Andrew-WMDE):
[mediawiki/extensions/TwoColConflict@master] [WIP][POC] Algorithm to suggest a resolution for certain conflicts

https://gerrit.wikimedia.org/r/579511

WMDE-Fisch renamed this task from Write an algorithm that can detect what's possible to auto-resolve to Write an algorithm that can detect a resolution suggestion.Mar 13 2020, 10:50 AM
WMDE-Fisch changed the point value for this task from 5 to 2.Mar 18 2020, 10:44 AM

Change 581062 had a related patch set uploaded (by Thiemo Kreuz (WMDE); owner: Thiemo Kreuz (WMDE)):
[mediawiki/extensions/TwoColConflict@master] Inline separate "can suggest resolution" check

https://gerrit.wikimedia.org/r/581062

Change 579511 merged by jenkins-bot:
[mediawiki/extensions/TwoColConflict@master] Algorithm to suggest a resolution for certain talk page conflicts

https://gerrit.wikimedia.org/r/579511

Change 563493 abandoned by Awight:
[WIP][POC] Algorithm for auto-resolving certain conflicts

Reason:
Most of this was implemented in I60ba8129415706. There was a tiny bit more UI that we might carry over into another patch.

https://gerrit.wikimedia.org/r/563493

Change 581062 merged by jenkins-bot:
[mediawiki/extensions/TwoColConflict@master] Inline separate "can suggest resolution" check

https://gerrit.wikimedia.org/r/581062