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 changed the task status from Open to Stalled.Jul 31 2019, 10:52 AM
Jony closed this task as Invalid.
Jony updated the task description. (Show Details)
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

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 added a subscriber: MusikAnimal.

CC @MusikAnimal, who may have a better implementation idea

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 [[ https://github.com/x-tools/xtools/blob/f2b6e98cfc81d4e4fa0532b8980652fbdb00b934/src/AppBundle/Repository/AutoEditsRepository.php#L503 | AutoEditsRepository::getTags() ]], which is project-dependent. The bug seems to be due to the [[ https://github.com/x-tools/xtools/blob/f2b6e98cfc81d4e4fa0532b8980652fbdb00b934/config/semi_automated.yml#L96 | 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.

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.

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 moved this task from Pending deployment to Complete on the XTools board.