Page MenuHomePhabricator

Enable reverting of edits in Automoderator
Closed, ResolvedPublic

Description

For the purposes of this task, we just want to build the components which are capable of reverting an edit. We're not concerned with revert risk scores or thresholds.

A placeholder edit summary can be used.

Acceptance criteria

  • Automoderator has the functionality to revert an edit.
  • Automoderator should not use the Bot flag when making its edit.

Details

TitleReferenceAuthorSource BranchDest Branch
Naive reverts based on revertrisk scorejsn/automoderator!1jsnJsn.sherman/T352439main
Customize query in GitLab

Event Timeline

Samwalton9-WMF renamed this task from Automoderator should monitor recent edits and revert those which meet a Revert Risk model threshold score to Enable reverting of edits in Automoderator.Dec 5 2023, 2:17 PM
Samwalton9-WMF updated the task description. (Show Details)

Change 992534 had a related patch set uploaded (by Jsn.sherman; author: Jsn.sherman):

[mediawiki/extensions/AutoModerator@master] Naive reverts based on revertrisk score

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

apologies for the bot spam, I've been playing in gitlab and didn't consider the noise it might generate in phabricator.

Okay, I believe I have achieved this goal (and somewhat overshot it) here:
https://gerrit.wikimedia.org/r/992534

I still need to add a test for the revert action.

I updated my patch to setup a system account in a similar manner to Abuse filter. I haven't fully implemented it as a localizable message, as that's a bit out of scope for this. It is now pretty easy to see what the extension has been up to:

image.png (825×1 px, 242 KB)

Right now, it is does a check to the language agnostic revert risk model after an edit is saved. It tags the revision based on passing/failing the check.

If the check fails, it creates a simple revert edit that changes the content back to the parent revision and sets a custom edit summary.

If a user manually replaces the content back to the reverted version, we skip the check on that revision to avoid an edit war.

image.png (815×1 px, 211 KB)

I still need to implement some revert testing.

It turns out that the page updater class lets me specify how to classify revert edits. I've set it to undo based on feedback.

image.png (301×1 px, 59 KB)

Test wiki created on Patch demo by JSherman (WMF) using patch(es) linked to this task:
https://patchdemo.wmflabs.org/wikis/cf2b47d888/w

Change 992534 merged by jenkins-bot:

[mediawiki/extensions/AutoModerator@master] Naive reverts based on revertrisk score

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