Page MenuHomePhabricator

Add Reverted filter to RecentChanges Filters
Closed, ResolvedPublic

Description

NOTE: This project has received fewer contributions and is actively seeking new contributors.

It would be valuable to be able to filter out or highlight edits that have already been "rolled back" or "undone". This task is about adding a "Reverted" filter to the Tagged Edits interface in MediaWiki-Recent-changes

Recent Changes UI

We will want to identify the edit that is being reverted and tag it with a "reverted" tag.

We'll need to detect when a revision is being rolled back / undone, and then apply a tag to the revision that it is rolling back. This involves defining a tag and implementing a hook which can apply that tag in certain conditions. Potentially we will also do some work on T152434: Add method to Revision to check if it was a Revert, and whether an edit was Reverted.

Skills required

You'll need to know how to code with PHP, with a flexible range in how much knowledge you have before this project starts. There are varying levels of work that can be done to implement this project.

Mentors

@kostajh and @Catrope

Microtasks

Please see good first tasks for MediaWiki-Recent-Changes or https://www.mediawiki.org/wiki/Good_first_bugs

Related Objects

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

This can be a huge improvement for using Recent Changes as a review tool, reducing the effect of stepping into other reviewers feet (reducing frustration and saving time). During our conversations with Huggle users, evaluating a change that was already reverted was identified asa problem and they appreciated the idea of surfacing such information.

Need to determine whether to handle manual reverts (that do an exact revert, but don't use explicit undo or rollback functionality). See scenarios at T152434: Add method to Revision to check if it was a Revert, and whether an edit was Reverted.

T161671 may not be as relevant anymore, but tagging here as I'm removing its reference from the task description.

kostajh renamed this task from Add 'Reverted' filter to RC Filters to Add Reverted filter to RecentChanges Filters.Feb 14 2020, 2:17 PM
kostajh updated the task description. (Show Details)

Hi,

I'm a contributor to Wikipedia articles (Malayalam, English) and I feel this would help improve Wikipedia in fighting against spam and vandalism. I would like to work on this as a GSoC project. I've previously contributed to Mediawiki in Google Code In 2013 and 2016. I'll try to get familiar with Recent Changes module and fix some bugs.

I have one doubt : Does the current edit model have a field to identify whether the edit is a revert ? Or does that need to be implemented ? From reading this, I understand that only a method needs to be implemented to know it, and that the model already has a field to know what is the edit type (revert or not) ?

I have one doubt : Does the current edit model have a field to identify whether the edit is a revert ? Or does that need to be implemented ? From reading this, I understand that only a method needs to be implemented to know it, and that the model already has a field to know what is the edit type (revert or not) ?

Yes and no.

If the user uses the "rollback" or "undo" links to make the edit, then yes we know that it was a revert and we know which edit it reverted(*). We use this information to apply change tags to the edit that was a rollback/undo (example, example), and to send a notification to the user whose edit was reverted. So a (relatively) easy way to start this task would be to tag the reverted edit in cases where we already know it. One issue is that right now, this logic isn't necessarily in a central place, too much of it is in various hooks in Echo (EchoHooks.php). As part of this project we'd want you to clean that up and make it nicer.

However, if the user does a manual revert, we don't currently detect that. Usually these are done by opening an old revision in the editor and then saving it, so a new revision is saved that is identical to an old revision. Detecting this would probably be doable, but we don't currently try. This is what the "manual" cases in T152434 are about. As part of this project, you could work on that.

(*) This doesn't work well when using "undo" to revert multiple edits, see T153570. Someone submitted patches to fix this 3 years ago, but they involved a large refactor and were never reviewed. As part of this project we could, potentially, think about whether there's a simpler way to do this.

So, in summary, this project would involve:

  • Definitely: create a "reverted" tag
  • Definitely: apply the "reverted" tag to edits reverted using rollback/undo
  • Probably: try to figure out if we can make tagging work for rollback/undo operations that revert multiple edits
  • Possibly: detect more kinds of reverts, per T152434

We use this information to apply change tags to the edit that was a rollback/undo (example, example), and to send a notification to the user whose edit was reverted.

So, in these examples, the revision on the left should be tagged with reverted, right ?

Definitely: apply the "reverted" tag to edits reverted using rollback/undo

Just to confirm, does this mean a database migration script needs to be created and apply the new reverted tags to all edits in a future mediawiki upgrade procedure ?

So, in these examples, the revision on the left should be tagged with reverted, right ?

Yes, that's right.

Just to confirm, does this mean a database migration script needs to be created and apply the new reverted tags to all edits in a future mediawiki upgrade procedure ?

I don't think that would be in the scope of this project but we could definitely sketch out some of the requirements for that script.

Trizek-WMF subscribed.

When this will be ready for release, it would worth a line into Tech News.

Checked in testwiki wmf.8

So, in summary, this project would involve:

Definitely: create a "reverted" tag
Definitely: apply the "reverted" tag to edits reverted using rollback/undo
Probably: try to figure out if we can make tagging work for rollback/undo operations that revert multiple edits
Possibly: detect more kinds of reverts, per T152434

(1)

Definitely: create a "reverted" tag

the documentation page is created - Manual:Reverts, although the info on mw-reverted tag probably should be there.
(2)

Definitely: apply the "reverted" tag to edits reverted using rollback/undo

Verified.
Rollback diff:

Screen Shot 2020-09-08 at 2.58.05 PM.png (461×1 px, 106 KB)

Undo diff:
Screen Shot 2020-09-08 at 3.40.51 PM.png (483×1 px, 85 KB)

(3)

Probably: try to figure out if we can make tagging work for rollback/undo operations that revert multiple edits

Tested with up to 6 rollbacks - works as expected

(4)

Possibly: detect more kinds of reverts, per T152434

Reviewed and below are my Notes

  • there is a natural discrepancy between the number of tags applied according to Special:Tags (<a href="/w/index.php?title=Special:RecentChanges&amp;tagfilter=mw-reverted") and Special:RecentChanges page that will display only the changes for a selected time interval (but no farther back than 30 days).

So, reverted action attributed to the time of the revision creation date (not to the time when that revision was reverted). I do not expect that to be an actual issue though.

  • when multiple reverts occur, they are all listed as separate items on RecentChanges, e.g.

Screen Shot 2020-09-08 at 4.08.18 PM.png (180×1 px, 89 KB)

Checked for #Reverted tag filter on testwiki wmf.8 - looks good.

MMiller_WMF added subscribers: Tgr, MMiller_WMF.

@kostajh @Catrope @Tgr -- because @Etonkovidova has completed testing, and @Trizek-WMF is ready to add to Tech News, we can flip on this feature in entirety in all wikis.

Let's deploy and announce, so that users can immediately try it. When would it be live on all wikis?

Change 627526 had a related patch set uploaded (by Ostrzyciel; owner: Ostrzyciel):
[operations/mediawiki-config@master] Enable the reverted tag on all wikis

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

Change 627526 merged by jenkins-bot:
[operations/mediawiki-config@master] Enable the reverted tag on all wikis

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

Mentioned in SAL (#wikimedia-operations) [2020-09-15T18:08:55Z] <urbanecm@deploy1001> Synchronized wmf-config/InitialiseSettings.php: 79004b7e503c7274fa56d2699b423b6919fbc869: Enable the reverted tag on all wikis (T164307) (duration: 00m 56s)

This was just deployed :-).

Checked in testwiki - seems to be fine.

MMiller_WMF claimed this task.

@Ostrzyciel thank you for working on this useful feature! I think community members are going to be excited about this and use it. I expect to use it to facilitate the Growth team's reporting, allowing us to easily track the revert rate of edits made through our features.