Page MenuHomePhabricator

Special:Block [Codex]: Surface any range blocks that effect the target
Closed, ResolvedPublic5 Estimated Story PointsBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  1. Navigate to Special:Block.
  2. Block the IP range 1.2.3.20/30.
  3. Block the IP range 1.2.3.21/30.
  4. Once blocked, search for 1.2.3.20 or 1.2.3.21.

What happens?:
The search does not return any results for 1.2.3.20 or 1.2.3.21, even though those IPs were blocked within the specified ranges.

What should have happened instead?:

Special:Block should display the blocks associated with 1.2.3.20 and 1.2.3.21.

OS: macOS Sequoia 15.4
Browser: Chrome 134
Device: MBA
Site: https://test.wikipedia.beta.wmflabs.org/wiki/Special:Block/1.2.3.20/30

2025-03-25_11-11-29.mp4.gif (1,170×1,052 px, 2 MB)

Acceptance criteria

  • When searching for an IP or range, show an "Active range blocks" accordion and table, listing each range block that effects the target
  • If the target is itself a range which is blocked, the block is instead shown in "Active blocks"
  • The "Active range blocks" table should have only a "View" link in each row, which when clicked will change the target to that range.
  • Doing the same for the "Block log" is out of scope and not part of this task.
  • "Active range blocks" is always shown when looking up an IP or IP range, but has an empty state if there are no entries in the table

Derived Requirement

Ensure that when a user searches for an IP or IP range on Special\:Block, any active range blocks affecting the target are surfaced under an "Active range blocks" accordion, with a table listing the matching range blocks and a "View" link for each. If the searched target is itself a range that is blocked, it should instead appear under "Active blocks". The range blocks section must appear consistently, with an empty state shown when applicable.

Test Steps

Test Case 1: Display #Active range blocks when a single IP is covered by a blocked range

  1. Navigate to Special\:Block.
  2. Block the range 1.2.3.20/30.
  3. In the Special\:Block input field, enter the IP 1.2.3.21 and load the page.
  4. ✅❓❌⬜ AC1: Confirm that an "Active range blocks" accordion appears below the input field.
  5. ✅❓❌⬜ AC2: Confirm that the accordion contains a table entry showing the 1.2.3.20/30 range block.

Test Case 2: Clicking 'View' updates target to blocked range

  1. From the "Active range blocks" table, click the "View" link next to the range block.
  2. ✅❓❌⬜ AC3: Confirm that the page updates and shows 1.2.3.20/30 as the target.

Test Case 3: Blocked range target appears under 'Active blocks'

  1. Go to Special\:Block and enter the IP range 1.2.3.20/30.
  2. ✅❓❌⬜ AC4: Confirm that this range appears in the "Active blocks" section and not in the "Active range blocks" section.

Test Case 4: Verify empty state of #Active range blocks

  1. Go to Special\:Block and search for an IP or range that is not covered by any existing range block (e.g., 8.8.8.8).
  2. ✅❓❌⬜ AC5: Confirm that the "Active range blocks" section is still shown but displays an appropriate empty state (e.g., "No range blocks found").

QA Results - Test Wiki Beta

Event Timeline

GMikesell-WMF updated the task description. (Show Details)
GMikesell-WMF updated the task description. (Show Details)
JWheeler-WMF updated the task description. (Show Details)
JWheeler-WMF set the point value for this task to 5.
MusikAnimal updated Other Assignee, removed: MusikAnimal.

Change #1133233 had a related patch set uploaded (by MusikAnimal; author: MusikAnimal):

[mediawiki/core@master] SpecialBlock [Codex]: Include an 'Active range blocks' table for IPs

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

MusikAnimal renamed this task from Blocks for Overlapping IP Ranges Not Displayed in Special:Block Search to Special:Block [Codex]: Surface any range blocks that effect the target.Apr 1 2025, 8:13 PM
MusikAnimal updated the task description. (Show Details)

I changed one thing from what we discussed:

The Active range blocks table should ONLY appear if the target has an active range block against it.

This can be done but it was an easier implementation to just give the table an empty state, just like we do for "Active blocks". In my opinion having the empty state is actually good; It very clearly shows the target has no range blocks effecting it. Remember that before, this was something admins had to look up manually, so even just saying there are "no active range blocks" is useful. I assume this is OK, cc @JWheeler-WMF

Change #1133233 merged by jenkins-bot:

[mediawiki/core@master] SpecialBlock [Codex]: Include an 'Active range blocks' table for IPs

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

@MusikAnimal I am not sure about the logic of when a range block is included in the Active blocks table vs the Active range blocks table.

Going to https://test.wikipedia.beta.wmflabs.org/wiki/Special:Block and entering 23EC:288F:C700::/40, 23ec:288f:c762:b770:f357:bbc0:ede5:138b/40 or 23ec:288f:c700:0:0:0:0:0/40, they are included in the Active range blocks:

active_range_blocks.png (1,096×657 px, 68 KB)

If instead I enter 23EC:288F:C700:0:0:0:0:0/40 they are included in the Active blocks table:

active_blocks.png (1,108×720 px, 66 KB)

@MusikAnimal I am not sure about the logic of when a range block is included in the Active blocks table vs the Active range blocks table.

Good catch! This should be fixed now following T391144.

@MusikAnimal Confirmed that range blocks are now working as designed for this task, except for the other issues that are on another task. I also created another separate task in T393956 regarding flash message when blocking overlapping normalized IP range. I will mark this as Resolved. Thanks for all your work!

Test Result - Test Wiki Beta

Status: ✅ PASS
Environment: Test Wiki Beta
OS: macOS Sequoia 15.4.1
Browser: Chrome 135
Device: MBA
Emulated Device: NA

Test Artifact(s):

Special:Block

Test Steps

Test Case 1: Display #Active range blocks when a single IP is covered by a blocked range

  1. Navigate to Special\:Block.
  2. Block the range 1.2.3.20/30.
  3. In the Special\:Block input field, enter the IP 1.2.3.21 and load the page.
  4. AC1: Confirm that an "Active range blocks" accordion appears below the input field.

2025-05-12_14-10-54.mp4.gif (1,294×888 px, 1 MB)

  1. AC2: Confirm that the accordion contains a table entry showing the 1.2.3.20/30 range block.

See AC1

Test Case 2: Clicking 'View' updates target to blocked range

  1. From the "Active range blocks" table, click the "View" link next to the range block.
  2. AC3: Confirm that the page updates and shows 1.2.3.20/30 as the target in Active blocks.

2025-05-12_14-13-00.mp4.gif (1,288×882 px, 879 KB)

Test Case 3: Blocked range target appears under 'Active blocks'

  1. Go to Special\:Block and enter the IP range 1.2.3.20/30.
  2. AC4: Confirm that this range appears in the "Active blocks" section and not in the "Active range blocks" section.

See AC3

Test Case 4: Verify empty state of #Active range blocks

  1. Go to Special\:Block and search for an IP or range that is not covered by any existing range block (e.g., 8.8.8.8).
  2. AC5: Confirm that the "Active range blocks" section is still shown but displays an appropriate empty state (e.g., "No range blocks found").

2025-05-12_14-35-36.mp4.gif (1,290×880 px, 786 KB)

T389987#10716587
IP Ranges are now shown in Active blocks

2025-05-12_14-39-18.mp4.gif (1,288×888 px, 3 MB)

T392049- will be fixed in the latest patch

GMikesell-WMF updated the task description. (Show Details)
GMikesell-WMF updated Other Assignee, added: GMikesell-WMF.
GMikesell-WMF updated the task description. (Show Details)
GMikesell-WMF updated Other Assignee, removed: GMikesell-WMF.