Page MenuHomePhabricator

cleanupSpam.php: mark edits/actions as 'bot'
Closed, ResolvedPublic

Description

Currently when we run cleanupSpam.php the User:MediaWiki spam cleanup user is used to attribute the script operations. As it happens with MediaWiki default it may be a good idea to set that account to become a bot or mark its edits as bot (without assigning local groups) so we don't clutter RecentChanges.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 19 2017, 11:08 AM

@matmarex has helped me with P6027 and a nice IRC chat :)

MarcoAurelio renamed this task from cleanupSpam.php: on creation or running, 'bot' to cleanupSpam.php: mark edits/actions as 'bot'.Sep 19 2017, 7:55 PM
MarcoAurelio triaged this task as Normal priority.

Change 379003 had a related patch set uploaded (by MarcoAurelio; owner: MarcoAurelio):
[mediawiki/core@master] Update cleanupSpam.php to hide its activity from RecentChanges

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

@Krinkle I tested the current code (not the yet merged one) on an account with bot flag, and while deletions are being hidden from RecentChanges, its edits are not. Maybe we still need a FORCE_EDIT_BOT / EDIT_SUPPRESS_RC / EDIT_FORCE_MINOR to actually make it work as desired?

Apparently the script does not mark the edits as minor or bot:

{
    "revid": 6853,
    "parentid": 6851,
    "user": "MediaWiki spam cleanup",
    "userid": 2111,
    "timestamp": "2017-09-20T11:11:40Z",
    "size": 0,
    "sha1": "da39a3ee5e6b4b0d3255bfef95601890afd80709",
    "contentmodel": "wikitext",
    "comment": "All revisions contained links to *.loginprofessor.org, blanking",
    "parsedcomment": "All revisions contained links to *.loginprofessor.org, blanking",
    "tags": [],
    "contentformat": "text/x-wiki",
    "*": ""
},

Change 379003 merged by jenkins-bot:
[mediawiki/core@master] Update cleanupSpam.php to hide its activity from RecentChanges

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

Mentioned in SAL (#wikimedia-releng) [2017-09-29T14:09:58Z] <tabbycat> maurelio@deployment-tin:~$ mwscript cleanupSpam.php --wiki=deploymentwiki *.loginpartner.org --delete ( testing T176206 / 7f842058602c )

maurelio@deployment-tin:~$ mwscript cleanupSpam.php --wiki=deploymentwiki *.loginpartner.org --delete
Found 5 articles containing *.loginpartner.org
5_Tips_About_At_T_Wireless_Login_You_Can_t_Afford_To_Miss ...deleting
Citicards_Login_It_s_Easy_If_You_Do_It_Smart ...deleting
How_To_Teach_My_Ebay_Summary_Better_Than_Anyone_Else ...deleting
5_Must-haves_Before_Embarking_On_Etrade.login ...deleting
The_Ultimate_Guide_To_Facebook_Login ...deleting
Done
maurelio@deployment-tin:~$

So the script works and logs are being hidden from recent changes as expected. Now I'll run without the --delete option and see if the edits are indeed being hidden from RecentChanges.

Mentioned in SAL (#wikimedia-releng) [2017-09-29T14:15:11Z] <tabbycat> maurelio@deployment-tin:~$ mwscript cleanupSpam.php --wiki=deploymentwiki *.logininput.org ( testing w/o delete T176206 / 7f842058602c )

MarcoAurelio closed this task as Resolved.Sep 29 2017, 2:16 PM
MarcoAurelio claimed this task.
MarcoAurelio added a subscriber: Legoktm.
maurelio@deployment-tin:~$ mwscript cleanupSpam.php --wiki=deploymentwiki *.logininput.org
Found 1 articles containing *.logininput.org
What_s_Really_Happening_With_Webmail.aol.com ...blanking
Done

The script blanked the page as ordered and the edit didn't show up in RecentChanges as this ticket aimed to do.

Thanks @matmarex for the help and to @Legoktm for his review and +2ing the patch.

Closing as resolved.

Restricted Application added a project: User-MarcoAurelio. · View Herald TranscriptSep 29 2017, 2:16 PM