Extension:WikimediaEditorTasks

The WikimediaEditorTasks extension supports the Suggested Edits project of the Wikimedia Apps team. It provides an interface for defining specialized counters that tally edits per user with the desired characteristics. For example, a counter may be defined to count a user's edits via the wbsetdescription API module where the User-Agent begins with.

If  is , the extension will also keep track of "streaks" for each counter, i.e., consecutive days in which the contributor has made a qualifying edit.

These counts are exposed through the wikimediaeditortaskscounts API module.

Config
[    [         'class' => 'MediaWiki\\Extension\\WikimediaEditorTasks\\WikipediaAppDescriptionEditCounter', 'counter_key' => 'app_description_edits', ],    [         'class' => 'MediaWiki\\Extension\\WikimediaEditorTasks\\WikipediaAppCaptionEditCounter', 'counter_key' => 'app_caption_edits', ],    [         'class' => 'MediaWiki\\Extension\\WikimediaEditorTasks\\WikipediaAppImageDepictsEditCounter', 'counter_key' => 'app_depicts_edits', ], ],
 * : The database cluster in which the tables can be found. If, use the cluster of the current wiki. At Wikimedia, this is set to  . (Default:  )
 * : The database in which the tables can be found. If, use the current wiki database. At Wikimedia, this is set to  . (Default:  )
 * : List of enabled counter definitions, instantiated on demand by ObjectFactory. (Default: )
 * Wikimedia's current configuration, for example:
 * : Feature flag for edit streak counting. (Default: )
 * : Feature flag for revert counting. (Default: )

Development
The recommended development environment for WikimediaEditorTasks is MediaWiki-Vagrant (see "Installation" below). The  role pulls in the   and   roles, thereby automating a considerable amount of setup. (Note: A full development environment for Wikimedia requires setting up CentralAuth, WikibaseMediaInfo (Vagrant role ), and Wikidata. This requires either setting up the full environment manually, following the instructions for each extension, or hacking around conflicts between the   and   Vagrant roles.)

Conceptually, the extension is very simple: it provides an abstract  base class that developers can subclass to implement logic defining whether to keep count of a given revision (and reverts to such revisions) per user. Counters may be registered in. On PageSaveComplete, WikimediaEditorTasks iterates through each registered counter and determines whether the user's count should be iterated. If the new revision undoes another revision, the undone revision is examined to see if the undone revision author's count should be decremented. Revisions are also evaluated for possible decrementing for each registered counter on RollbackComplete.

The extension provides a few  counters implementing the specific logic required by Android Suggested Edits. Each is a subclass of the abstract  class, which in turn subclasses.


 * : Counts Wikidata description edits from the Wikipedia app per user. In technical terms, it counts revisions created through the wbsetdescription API module where the User-Agent begins with.
 * : Counts structured image caption edits from the Wikipedia app per user. In technical terms, it counts revisions created through the wbsetlabel API module where the User-Agent begins with.
 * : Counts Wikidata Depicts (P180) statements added from the Wikipedia app per user. In technical terms, it counts revisions where the User-Agent begins with   and the revision results from either a wbsetclaim request concerning P180 or a wbeditentity request adding a Depicts statement.