User:Ostrzyciel/GSoC 2020

This is the page for documenting my internship at Wikimedia during Google Summer of Code 2020.

Project description
A valuable addition to the RecentChanges filtering interface would be a filter that would show edits that were "reverted" or "undone". The task is about adding such a filter. 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.

Bi-weekly reports

 * Week 2, May 20th
 * Week 4, June 3rd
 * Week 6, June 17th
 * Week 8, July 1st
 * Week 10, July 15th
 * Week 12, July 29th

The things I should probably do

 * ✅ Establish the definition of a "reverted" edit. Initial technical research.
 * Implement the reverted tag.
 * ✅ Create the EditResult class
 * ✅ Implement marking reverts based on undo and rollback actions
 * ✅ Write tests
 * ✅ Refactor hooks used in PageUpdater to use the new data
 * Main core patch
 * AbuseFilter
 * PageTriage
 * ✅ Update hook's documentation
 * ✅ Fix issues with the undoafter param
 * ✅ Handle undos in action=mcrundo properly
 * ✅ Fix EditPage's handling of undos (crazy!)
 * ✅ Implement SHA1-based revert detection
 * ✅ Actual revert detection code
 * ✅ Mark manual reverts with a change tag
 * ✅ Fix issues with null edits
 * Implement the reverted edit tag and mark reverted edits
 * ✅ Implement RevisionStore::getRevisionIdsBetween
 * Save additional information about the revert in the edit tag
 * Protect the reverted edits feature from abuse
 * ✅ Don't mark "dirty" undos as undos
 * Develop a method for extensions to temporarily stop reverted tag update
 * Deprecate RollbackComplete hook
 * Write a maintenance script for back-filling the reverted tag
 * Write documentation
 * very rough notes

The things that would be nice to do

 * Think about how the docs on dependency injection pattern can be improved
 * ✅ Identify reverts in EventBus data
 * ✅ Add revert-related fields to event schema
 * ✅ Update EventBus PageSaveComplete to save revert data
 * Update the Echo extension to use the new functionality and remove redundant code.
 * It seems ProcrastinatingReader beat me to that :)
 * Figure out what is going on with the new REST API and its reverted filter on history view.
 * The REST API when asked for reverted revisions of Cat returns for example this, not the previous edit, which is clearly wrong and inconsistent with what we're trying to do here. That would probably need to be fixed.