Page MenuHomePhabricator

Don't use wfDiff() in Echo
Closed, ResolvedPublic

Description

Shelling out to /usr/bin/diff and then parsing its output by hand in DiffParser sounds too complicated in addition to being slowww, just use DiffEngine to get the list of changes directly. Also, I'm deprecating wfDiff().

Event Timeline

MaxSem raised the priority of this task from to Needs Triage.
MaxSem updated the task description. (Show Details)
MaxSem added a project: Notifications.
MaxSem subscribed.
ori set Security to None.

I'd rather say don't call external processes at all :)

Legoktm subscribed.
In T93625#1311400, @ori wrote:

Done in Ia5239c1e7.

I think that's supposed to be rOMWC4f333a850fe9: Unset $wgDiff, so we stop shelling out to diff, but that still doesn't fix this bug, which is to not use wfDiff().

A volunteer wants to wfDeprecate() it, thus Echo's unit tests migh break if diffing is tested at all.

Change 335791 had a related patch set uploaded (by Legoktm):
Use internal diff engine

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

Change 335791 merged by jenkins-bot:
Use internal diff engine

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

After Echo, there is one usage left in Wikimedia Git (not counting unit tests and maintenance scripts).

wikimedia/mediawiki-extensions-AbuseFilter – AFComputedVariable.php
157					$text2 = $vars->getVar( $text2Var )->toString() . "\n";
158					$result = wfDiff( $text1, $text2 );
Aklapper added a subscriber: ori.

After Echo, there is one usage left in Wikimedia Git (not counting unit tests and maintenance scripts). wikimedia/mediawiki-extensions-AbuseFilter

I created T158850: Don't use wfDiff() in AbuseFilter for AbuseFilter.

So this task T93625 could get closed as resolved?

Legoktm renamed this task from Don't use wfDiff() to Don't use wfDiff() in Echo.Feb 24 2017, 11:15 AM

Change 339622 had a related patch set uploaded (by WMDE-Fisch):
Remove test for internal diff engine acceptance

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

Change 339622 merged by jenkins-bot:
Remove test for internal diff engine acceptance

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