Page MenuHomePhabricator

MediaWiki state change events - emit global edit count
Open, Needs TriagePublic

Description

In T130439: Add an AbuseFilter variable for global edit count of the user, CentralAuth started tracking a users global edit count.

Emitting this data in events will be useful for metrics.

From @Passimacopoulos

our team more and more frequently needs to determine a user's total historical revision count at certain points (i.e. to identify if a user was a 'beginner' before attending a community editing event, and having their latest global count alongside their central_user_id would be very useful for that!)

We already emit user_central_id via CentralAuth. CentralAuth makes it easy to fetch this value.

We can use the getCountIfInitialized method to ensure we don't cause an expensive recache of global edit count in cases where it isn't set.

(Actual name of field TBD.)

Done is

  • global edit count added to mediawiki.user_change events
  • global edit count added to mediawiki.page_change events

Details

Related Changes in Gerrit:
Related Changes in GitLab:
TitleReferenceAuthorSource BranchDest Branch
Add user edit_global_count to user/change and page/change schemasrepos/data-engineering/schemas-event-primary!70ottoglobal_edit_countmaster
Customize query in GitLab

Event Timeline

Change #1307221 had a related patch set uploaded (by Ottomata; author: Ottomata):

[mediawiki/extensions/EventBus@master] Add user edit_global_count to user_change and page_change events

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

Change #1307228 had a related patch set uploaded (by Ottomata; author: Ottomata):

[integration/config@master] phan: Add CentralAuth as EventBus phan dependency

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

Change #1307228 merged by jenkins-bot:

[integration/config@master] phan: Add CentralAuth as EventBus phan dependency

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

Patches recently updated to align with T432050#12163700. Reusable entity serializers should not depend on other extensions (like CentralAuth), and relatedly user entity fragment schema should probably not include fields that would require such a dependency.

  • edit_global_count is now added in change event schemas, not entity schema fragments.
  • edit_global_count is set by change event serializers in EventBus, not entity serializers.

Later, we can do T432050: EventBus - move event producers to a different extension and move change event producer related code to WikimediaEvents.

Change #1307221 merged by jenkins-bot:

[mediawiki/extensions/EventBus@master] Add user edit_global_count to user_change and page_change events

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