Content-Length: 126077 | pFad | http://phabricator.wikimedia.org/T352148

s ⚓ T352148 Block schema: add a structured category/reason_type field
Page MenuHomePhabricator

Block schema: add a structured category/reason_type field
Open, Needs TriagePublic

Description

Given the schema updates we are making to ipblocks to support T346293, I want to propose an additional field to the schema, for category or reason_type as an integer value.

The idea is to allow for structured data to associate with a particular block. The main use case I have in mind is to easily determine if the block exists to target an open proxy. Currently, the only way to figure that out is through parsing the free text reason_id field (joins to comment table) which varies by wiki, and sometimes is inconsistent depending on which user or bot added the block.

2023-11-28_10-01-53_screenshot.png (700×1 px, 85 KB)

The category / reason_type field would hard-coded, but maybe we would want to allow for configuration overrides to add additional categories over time.

Alternatively, as my primary use case is wanting to gather blocks that are associated with open proxies, we could consider a way in the UI and API to set a field in block_target for open_proxy.

Event Timeline

A hacky but easy way would be to add the reason as a log parameter or log relation (depending on how easy you want to make it to query for it), then join the block table and the log table on ls_field = 'ipb_id' AND ipb_id = ls_value.

A hacky but easy way would be to add the reason as a log parameter or log relation (depending on how easy you want to make it to query for it), then join the block table and the log table on ls_field = 'ipb_id' AND ipb_id = ls_value.

Might be worth just updating the block schema, not sure.

I imagine we'll also want to support multiple reasons (e.g. "Open proxy" and "Spam").

Where would they come from? The block reason dropdown only lets you select one option.

Where would they come from? The block reason dropdown only lets you select one option.

I think we'd want two fields:

  • checkboxes for the reasons, which replaces the current dropdown
  • comment field, for free text comment additions
kostajh added a subscriber: Dreamy_Jazz.

Doing some initial work on this at Hackathon with @Dreamy_Jazz

Change #1027154 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/core@master] SpecialBlock: Provide hook for overriding block reason edit link

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

@Urbanecm_WMF is also working on this one.

Current plan:

  • Use CommunityConfiguration via GlobalBlocking extension to provide an interface for defining a list of global reasons with stable identifiers
  • Use these reasons in local wikis, and allow local wikis to disable which reasons are shown in the UX

Change #1027189 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/core@master] blocks: Add BlockReasonsProvider service

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

Don't have time for this at the moment.









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://phabricator.wikimedia.org/T352148

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy