Page MenuHomePhabricator

mediawiki/page/change event schema - Use single array field for user attributes instead of boolean fields
Closed, DeclinedPublic

Description

Context:
https://phabricator.wikimedia.org/T336176#8844637

Because we haven't yet released the new mediawiki.page_change stream, we have a chance to make this backwards incompatible change now and still say at schema version 1.0.0.

Done is:
  • mediawiki/page/change event schema modified
  • EventBus extension code producing new schema

Event Timeline

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

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

[schemas/event/primary@master] mediawiki/page/change - Use single array field for user attributes

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

Ottomata updated the task description. (Show Details)

Had a little brain bounce with @Milimetric today about this. He convinced me that while an array of values would work, it would be less obvious to users what are valid combinations of values. Examples:

  • registered == not anonymous, so 'registered' and 'anonymous' are exclusive
  • temp users are always 'registered' users, in that they have a real user record, so 'temp' must always also include 'registered', and if it doesn't something is wrong.

Also, having the values in a list hides some the information about possible values. As mediawiki code changes, it might be difficult to reason from data alone what values to check for. For example, 'temp' is going to be a new value, and it is possible that 'anonymous' will one day no longer be used. So, when querying across a historical dataset, a future user will have to know that they need to filter for 'anonymous' users in the distant past, but 'temp' users in the recent past. The boolean fields make this need more apparent. E.g. WHERE is_registered == false OR is_temp == true would be an affective 'anonymous or non named user' query.

Another reason I'm hesitating making this change: what the heck should we call this proposed user_types field?! Are these 'types'? MW may choose to not call them this.

I think this argument boils down to the same Tim gave here.

I don't think it's future-proof to add user_type since if we decide we want such a concept in MW core, the details may differ from what you decide on here.

So, I'm currently back on the 'let's just keep the booleans' side of the waffle fence.

Discussed this with the Event Platform team today, and while we are all still a little waffley, we based on ^^ we decided to stick with the booleans for now. I will decline this ticket and proceed to release mediawiki.page_change.v1 stream as is.

Change 919106 abandoned by Ottomata:

[schemas/event/primary@master] mediawiki/page/change - Use single array field for user attributes

Reason:

Declined the task

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