Page MenuHomePhabricator

Add MCR slot information to revision-create events
Closed, ResolvedPublic

Description

As a consumer of the mediawiki.revision-create events I want to know what slots are available in the revision being created so that I can properly filter the revisions I want to track without calling the MW api.

Actual usecase is tracking the mediainfo changes similar to how Wikidata Query Service is tracking the changes to wikibase entities. The main difference here is that the wikibase entity data is not on the main slot and thus can be nonexistent.
Adding the information related to the slots available in a particular revision would ease such process permitting to only track revisions that have the required slot.

Ideally the information available per slot should be:

  • role
  • content model
  • content format
  • sha1
  • origin revision (does not seem to be available through the action API?)

AC:

  • the mediawiki.revision-create schema is adapted to contain this information
  • good to have: the mediawiki.page-[delete|suppress|undelete] schema have such information
  • EventBus emits the modified events

Event Timeline

Change 731006 had a related patch set uploaded (by DCausse; author: DCausse):

[schemas/event/primary@master] Add fragment/mediawiki/revision/slot

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

Change 731105 had a related patch set uploaded (by DCausse; author: DCausse):

[mediawiki/extensions/EventBus@master] Add MCR slot records information to revision-create events

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

The two patches are up for discussions and add a new array field (not a big fan of this but could not find a better way to model this) named rev_slots with the list of slot record informations:

  • rev_slot_role
  • rev_slot_contentmodel
  • rev_slot_sha1
  • rev_slot_size
  • rev_slot_contentformat: mime-type of the content (optional as per the MW code but not particularly important I suppose? Consumers should know what to expect based on the role/content model I suppose)
  • rev_slot_origin: revision at which this slot was created/modified (optional as per MW code as well because it might not be set on unsaved content, I hope it'll be always set when entering EventBus because this field is very valuable)

@Cparle I remember you worked on MCR slot filtering on RecentChanges, please let us know if you have suggestions on this approach which share somewhat the same overarching goal. (track changes to file pages with mediainfo data).

ftr MCR stands for Multi Content Revisions.

odimitrijevic moved this task from Incoming to Event Platform on the Analytics board.

This is blocked on https://gerrit.wikimedia.org/r/c/analytics/refinery/source/+/629406 which is required to support the new pattern (additionalProperties + properties). @Ottomata is there anything we could do help unblock the work on your refinery patch?

I was about to merge that today but then thought that your suggestion to ensure that properties validate with the additionalProperties stuff would be good to add first. Sooooo you could implement that :D :D

I was about to merge that today but then thought that your suggestion to ensure that properties validate with the additionalProperties stuff would be good to add first. Sooooo you could implement that :D :D

Sure! I took a look and will amend your patch :)

Change 731006 merged by Ottomata:

[schemas/event/primary@master] Add fragment/mediawiki/revision/slot

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

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

[eventgate-wikimedia@master] Bump schema repos to get mediawiki/revision/create slot change

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

Change 735995 merged by Ottomata:

[eventgate-wikimedia@master] Bump schema repos to get mediawiki/revision/create slot change

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

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

[operations/deployment-charts@master] eventgate-main - Bump image versino to get mediawiki/revision/create slot change

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

Change 735996 merged by Ottomata:

[operations/deployment-charts@master] eventgate-main - Bump image versino to get mediawiki/revision/create slot change

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

Change 731105 merged by jenkins-bot:

[mediawiki/extensions/EventBus@master] Add MCR slot records information to revision-create events

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