Page MenuHomePhabricator

AutoEdits: single_tag should ignore PHP7 tags
Closed, ResolvedPublic

Description

On www.wikidata.org Brror has done 40 mw-undo edits, but XTools (Semi-)automated edits summary showing only 4 edits. Of the 40 undos made, only 4 were not tagged as PHP7 - those 4 were the only ones that were shown

Event Timeline

Jony created this task.Jul 31 2019, 8:51 AM
Jony changed the task status from Open to Stalled.Jul 31 2019, 10:52 AM
Jony closed this task as Invalid.
Jony reopened this task as Open.Jul 31 2019, 12:11 PM
Jony updated the task description. (Show Details)
DannyS712 moved this task from Inbox to Automated Edits on the XTools board.Jul 31 2019, 9:07 PM
DannyS712 renamed this task from Request to fix mw-undo to AutoEdits summary to AutoEdits: Edits tagged as both PHP7 and mw-undo aren't counted as undos.Jul 31 2019, 9:10 PM
DannyS712 added a project: User-DannyS712.
DannyS712 updated the task description. (Show Details)

This is caused by single_tag: true being specified - only edits where mw-undo is the only tag are counted. While this makes sense generally, the PHP7 tag should be ignored for all automated edits, not just undo

DannyS712 renamed this task from AutoEdits: Edits tagged as both PHP7 and mw-undo aren't counted as undos to AutoEdits: single_tag should ignore PHP7 tags.Jul 31 2019, 9:14 PM
DannyS712 added a comment.EditedJul 31 2019, 9:43 PM

The relevant code:

AutoEditsRepository.php
if ($this->usesSingleTag($project, $tool)) {
               // Only show edits made with the tool that don't overlap with other tools.
               // For instance, Huggle edits are also tagged as Rollback, but when viewing
               // Rollback edits we don't want to show Huggle edits.
               $condsTool[] = "
                   EXISTS (
                       SELECT COUNT(ct_tag_id) AS tag_count
                       FROM $tagTable
                       WHERE ct_rev_id = revs.rev_id
                       HAVING tag_count = 1 AND ct_tag_id = $tagIds
                   )";

Different sites have different ids for the new PHP7, so it may need to be filtered based on the change_tag_def for each site

DannyS712 moved this task from Unsorted to X-tools on the User-DannyS712 board.Jul 31 2019, 9:47 PM
DannyS712 added a subscriber: MusikAnimal.

CC @MusikAnimal, who may have a better implementation idea

DannyS712 removed DannyS712 as the assignee of this task.Aug 1 2019, 3:03 AM

Sorry, didn't mean to click that - I just had an idea, but I'm not advanced enough to know how to do this

The tag IDs come from AutoEditsRepository::getTags(), which is project-dependent. The bug seems to be due to the singe_tag option, where there are a bunch of edits with the PHP7 tag which aren't getting counted. The reasoning is to not attribute say Huggle edits as Undo or Rollback, since you'd probably only want to see native undo/rollback edits. This logic is clearly broken.

I'm wondering if the whole single_tag thing is even that great of an idea. It seems error-prone; for example say there is an AbuseFilter that adds a tag to someone's Undo edit. The single_tag means it won't get counted, even though it is in fact still Undo. We can exclude certain tags, and I think that is probably enough.

MusikAnimal added a comment.EditedAug 1 2019, 2:29 PM

Ah, see DannyS712 already identified the issue with single_tag (thank you!). I saw this task via email when it was still under the old title :) Anyway, this is pretty complicated, so don't expect a quick fix.

Jony added a comment.Aug 1 2019, 3:08 PM

Ah, see DannyS712 already identified the issue with single_tag (thank you!). I saw this task via email when it was still under the old title :) Anyway, this is pretty complicated, so don't expect a quick fix.

Thanks @MusikAnimal and @DannyS712

MusikAnimal closed this task as Resolved.Aug 8 2019, 6:22 PM
MusikAnimal moved this task from Pending deployment to Complete on the XTools board.