Page MenuHomePhabricator

Update GlobalBlockLookup service to support global blocks on accounts
Closed, ResolvedPublic3 Estimated Story Points

Description

The GlobalBlockLookup service needs to be updated to support looking up global blocks on accounts.

This support includes (but is not limited to):

  • Allowing the service to lookup blocks based on a registered user target
  • Making global blocks on accounts the highest priority over IP address or IP address range blocks which apply to the IP address that the user is using
  • Updating the fields that are read for a lookup

Related Objects

StatusSubtypeAssignedTask
In Progress Niharika
OpenNone
OpenNone
OpenNone
DuplicateNone
OpenSkizzerz
OpenDreamy_Jazz
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
ResolvedDreamy_Jazz
OpenNone
OpenDreamy_Jazz
OpenNone
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
Resolved Marostegui
Resolved Marostegui
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
OpenNone
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz

Event Timeline

Change 1005621 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/GlobalBlocking@master] [Very WIP] Update GlobalBlockLookup for global account blocks

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

Dreamy_Jazz set the point value for this task to 3.Feb 23 2024, 3:07 PM

Change 1008862 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Make permission checks pass for FormSpecialPageTestCase tests

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

Change 1008862 merged by jenkins-bot:

[mediawiki/core@master] Make permission checks pass for FormSpecialPageTestCase tests

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

Change 1009767 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/GlobalBlocking@master] Make LIKE condition configurable in GlobalBlockLookup

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

Change 1009767 merged by jenkins-bot:

[mediawiki/extensions/GlobalBlocking@master] Make LIKE condition configurable in GlobalBlockLookup

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

Change 1010521 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/GlobalBlocking@master] Remove error parameter from GlobalBlock constructor

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

Change 1010531 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/GlobalBlocking@master] Give result of ::checkIpsForBlock directly to ::getAppliedBlock

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

Change 1010521 merged by jenkins-bot:

[mediawiki/extensions/GlobalBlocking@master] Remove error parameter from GlobalBlock constructor

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

Change 1010531 merged by jenkins-bot:

[mediawiki/extensions/GlobalBlocking@master] Give result of ::checkIpsForBlock directly to ::getAppliedBlock

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

Change 1005621 merged by jenkins-bot:

[mediawiki/extensions/GlobalBlocking@master] Update GlobalBlockLookup for global account blocks

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

For QA I suggest doing the following:

  1. Checking out the change https://gerrit.wikimedia.org/r/c/mediawiki/extensions/GlobalBlocking/+/1009780 for the GlobalBlocking repository - This is done so that you can use Special:GlobalBlock to create global blocks on accounts
  2. Perform a couple of testing blocks where the target of the blocks are accounts - Ignore if the logs created by performing these blocks as they will be slightly broken due to changes were made to the log format in patches which https://gerrit.wikimedia.org/r/c/mediawiki/extensions/GlobalBlocking/+/1009780 depend on.
  3. Checkout the master branch (so your testing is limited to just the changes which have been merged)
  4. Try to make an edit using an account that was globally blocked and verify that you cannot do this.
  5. Load Special:Contributions for a globally blocked account and verify that it is marked as blocked
  6. Make a block on an IP address you are currently using to edit the wiki and then IP address range that includes this IP. For these blocks check the checkbox with the label Globally block anonymous users only.
  7. Test that when editing while logged out you are blocked from editing due to the block on the single IP address
  8. Locally disable the single IP address block (using Special:GlobalBlockStatus)
  9. Repeat step 7, but instead verify that the IP address range block prevents you editing
  10. Re-enable the single IP address block and modify it to target registered users too (i.e. Globally block anonymous users only should not be checked)
  11. Using a globally blocked account, try to make an edit and verify that the block shown is the block on the account
  12. Using an account which is not blocked, try to make an edit and verify that the block shown is the single IP address block
  13. Using an account with the globalblock-exempt right (you can grant this right to sysops using $wgGroupPermissions['sysop']['globalblock-exempt'] = true;), try to make an edit and verify that the edit was successfully made.

Per the ticket Description, I have verified the new code has been implemented and is functioning and displaying as expected... Good Work @Dreamy_Jazz!!!


Blocking an Account using the Username

Step 2 Blocking an Account using the Username.jpeg (722×1 px, 168 KB)


Edit page is blocked for Username

Step 4 Edit page is blocked for Username.jpeg (918×1 px, 150 KB)


Edit Source page is blocked for Username

Step 4 Edit Source page is blocked for Username.jpeg (783×1 px, 150 KB)


EmailUser Page is blocked for Username

Step 4 EmailUser Page is blocked for Username.jpeg (779×1 px, 184 KB)


Move Page is blocked for Username

Step 4 Move Page is blocked for Username.jpeg (606×1 px, 185 KB)


Username is blocked from Deleting a page

Step 4 Username is blocked from Deleting a page.jpeg (563×1 px, 139 KB)


Username is blocked from Editing its own User page

Step 4 Username is blocked from Editing its own User page.jpeg (415×1 px, 89 KB)


Username is blocked from Editing its own UserTalk page

Step 4 Username is blocked from Editing its own UserTalk page.jpeg (771×1 px, 152 KB)


Username is blocked from Undeleting a Page

Step 4 Username is blocked from Undeleting a Page.jpeg (381×1 px, 82 KB)


Username is blocked from Upload File page

image.png (592×1 px, 80 KB)


Special Contributions is blocked for Username

Step 5 Special Contributions is blocked for Username.jpeg (471×1 px, 117 KB)


IP Address Range Blocking

Step 6 IP Address Range Blocking.jpeg (755×1 px, 138 KB)


Single IP Address is blocked

Step 7 Single IP Address is blocked.jpeg (635×1 px, 166 KB)



Error Handling Validation-- Error Message when trying to block a Username that is already Blocked

image.png (884×1 px, 136 KB)