With T194697: Multiblocks — Allow for multiple, simultaneous blocks with different expiration dates on the near horizon, we will want to be prepared from a technical standpoint.
Questions to answer:
- What is our proposed database change + API implementation?
- What unknowns about the UX design do we need to answer before finalizing our technical plans?
- All other unknowns are unknown unknowns.
- Update the RFC T199917 to include information about multi-blocks. Deadline: August 20 End-of-day
- Done! ✅
- Do we need DBA approval?
- Yes
Acceptance criteria
- The questions above are answered + documented on Phabricator
- yes
- Needed Phabricator tasks and sub-tasks are created
- We have decided not to create Phabrictor tasks until after T199917 is completed.
- The RFC process is started/updated
- yep
Plan
Here's the plan we have come up with, assuming that T199917 has no changes.
Related Tickets:
T2674: Allow users to be blocked from editing a specific article or all articles inside a namespace
Structural Changes:
- Draft a proposal for mutliblocks table schema(s) and get consensus T202322
- Create Migration Plan from old schem to new schema (add links to ticket)
- Create New schema for multiblocks
- Create new classes in order to work with Multiblock in an abstracted way (and ensure all the existing tests pass)
- Idea: Create BlockTarget that gets a block a target with all of the blocks.
- Idea: Block "entry" is an existing Block class
- Idea: Create a MergedBlock that returns all of the block entries merged together
- New classes must understand and respond to current "Is this user blocked?" kind of request
- There are two kinds of requests that do this: Pre-flight check or hard check.
Implementation Changes:
- Update block notices (desktop, mobile, etc.)
- Might be merged and then give more details (split into seperate entries), etc.
- Update Special:BlockList with Block Entries
- Update Block APIs
- UserInfo should return a merged block
- Blocks should return all of the block entries, perhaps in an order where the first one is the most restrictive (i.e. a sitewide block)? or perhaps the order doesn't matter
- Update PHP APIs to create Multiblocks
- Update API:Block to set Multiblocks
- Update Special:Block and Special:Unblock to set and unset Multiblocks
- Ensure that Autoblocks work properly
- Copy all of the block settings?
- New Target?
- Update block logs with mutliblock details
- Add Links to Special:Block (and the block notices?) to edit specific Block Entry on Special:Block
- Remove old schema for single block
References:
- (DB migration) https://github.com/wikimedia/mediawiki/blob/e2a0b34b7f7e9ea11ceee9c5fa21aef8662615d7/includes/Defines.php#L294-L319
- userCan vs quickUserCan https://github.com/wikimedia/mediawiki/blob/352854ee0f82758e9c0fce2b8f44cfe01de9150d/includes/Title.php#L2129-L2162
- and getUserPermissionsErrorsInternal https://github.com/wikimedia/mediawiki/blob/352854ee0f82758e9c0fce2b8f44cfe01de9150d/includes/Title.php#L2762-L2829