Page MenuHomePhabricator

Use non-legacy log parameters for log entries for global blocking and unblocking
Closed, ResolvedPublic2 Estimated Story Points

Description

The GlobalBlockManager service makes log entries for globally blocking, modifying a global block, and removing a global block. These log entries are created using LogPage which means that the entries use the legacy format.

However, once global blocks on accounts can be performed, the target of the block may need to be hidden from the user viewing Special:Log because the given account may be blocked with hideuser or the equivalent from MediaWiki-extensions-CentralAuth. As such, the logs created by the GlobalBlockManager need to be rendered using a log formatter. While this is being done it makes sense to convert the log parameters to no longer use the legacy format and avoid using content language text in the log parameters which makes i18n difficult.

Acceptance criteria
  • Convert the log entries created for globally blocking, modifying a global block, and removing a global block to no longer use legacy log parameters
  • Make these logs hide the target user if it is hidden from the current user
  • Add GENDER support for the target of the block

Related Objects

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

Event Timeline

Note accounts that are (locally) blocked and with the "suppress user name from edits and lists" checkbox ticked are logged in the suppression log; no entry is added to the block log. Global account suppression does not add local block log entry either.

There are currently no way to hide a local user without suppression (i.e. also suppress all affected edits and logs automatically).

Dreamy_Jazz renamed this task from Convert global block log entries to hide the target of the block if it is hidden to Use non-legacy log parameters for log entries for global blocking and unblocking.Mar 1 2024, 2:06 PM

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

[mediawiki/extensions/GlobalBlocking@master] Use ManualLogEntry to create gblock, modify, and gunblock entries

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

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

[integration/config@master] Zuul: [mediawiki/extensions/GlobalBlocking] Add CentralAuth dependency

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

Change 1007949 merged by jenkins-bot:

[integration/config@master] Zuul: [mediawiki/extensions/GlobalBlocking] Add CentralAuth dependency

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

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

[mediawiki/extensions/GlobalBlocking@master] Add CentralAuth to phan config

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

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

[mediawiki/extensions/GlobalBlocking@master] Use ManualLogEntry to create gunblock entries

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

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

[mediawiki/extensions/GlobalBlocking@master] Appropriately hide the target of the global block log entries

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

Change 1009772 merged by jenkins-bot:

[mediawiki/extensions/GlobalBlocking@master] Add CentralAuth to phan config

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

Change 1007909 merged by jenkins-bot:

[mediawiki/extensions/GlobalBlocking@master] Use ManualLogEntry to create gblock and modify entries

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

Change 1009774 merged by jenkins-bot:

[mediawiki/extensions/GlobalBlocking@master] Use ManualLogEntry to create gunblock entries

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

Change 1009776 merged by jenkins-bot:

[mediawiki/extensions/GlobalBlocking@master] Appropriately hide the target of the global block log entries

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

Suggested QA steps (designed for a local wiki or beta wikis):

  1. If using a local wiki and you don't already have log entries for GlobalBlocking in Special:Log, then do the following:
    1. On version 73ec2a8652e41357bc955d0c920282aec5cea35b or before, use Special:GlobalBlock to perform a few global blocks, remove at least one of these blocks, modify at least one of these blocks, and disable and then re-enable at least one of these blocks
    2. Switch to the latest version of the code (i.e. the master branch)
  2. If using beta wikis, I would suggest testing using https://en.wikipedia.beta.wmflabs.org/w/index.php?title=Special:Log&type=gblblock&wpFormIdentifier=logeventslist&offset=&limit=500
  3. Load Special:Log and filter for Global block log logs and verify that no exception is thrown by loading the page
  4. Verify that the target of the blocks are linked to the contributions page IP addresses and ranges, and linked to the userpage of the blocked user if the target is a username. Alongside the link should be a talk page link (but no block link), and if the target is a username there should also be a contribs link. For example:

image.png (55×222 px, 3 KB)

image.png (69×301 px, 5 KB)

  1. Inspect logs made before March 13th and verify that they are not broken. For example, the global block log entry should display the expiration in parentheses.
  2. Perform a global block on account
  3. Locally block the account you globally blocked in step 6 with the hideuser (Hide username from edits and lists) setting enabled.
  4. Open Special:Log while logged-out and verify that you cannot see the username of the target of the global block performed in step 6.

@Dreamy_Jazz If I hide or suppress the log entry target, if I login as another user who only has local sysop rights I still see the link to local status which includes the hidden username/IP. This user would not normally have the right to see hidden/suppressed entries (they aren't a suppressor).

local_sysop.png (98×977 px, 26 KB)

Similarly, if the user has only global sysop rights, they see the remove and modify links which also include the username/IP.

global_sysop.png (92×958 px, 27 KB)

This is testing on enwiki beta.

@Dreamy_Jazz If I hide or suppress the log entry target, if I login as another user who only has local sysop rights I still see the link to local status which includes the hidden username/IP. This user would not normally have the right to see hidden/suppressed entries (they aren't a suppressor).

local_sysop.png (98×977 px, 26 KB)

Similarly, if the user has only global sysop rights, they see the remove and modify links which also include the username/IP.

global_sysop.png (92×958 px, 27 KB)

This is testing on enwiki beta.

These links were added in T359584, so this should probably cause QA to fail for that ticket. This ticket didn't add these links, so you could probably ignore them for the purposes of QA'ing this ticket.

I have checked that new and legacy global block log entries appear correctly (e.g. links correct, information displayed). I have tested for IPs, named accounts and temporary accounts.

I have tested different visibility settings for new and legacy entries, including suppressing users.

I tested that the correct gendered word appeared by testing log entries for changes to local status in Russian and log entries for block creation in Serbian Cyrillic.

I briefly tested some of the search filters (although I don't think this change should affect those).

The only observations I have are for temporary users.

On wikis with temporary accounts enabled, entries for temporary users are of the form <temporary username> (talk | contribs) where both the <temporary username> and contribs are links to Special:Contributions. This seems redundant.

See for example https://de.wikipedia.beta.wmflabs.org/wiki/Spezial:Logbuch?type=gblblock&user=&page=%7E2024-7332&wpdate=&tagfilter=&subtype=&wpFormIdentifier=logeventslist.

On wikis without temporary accounts enabled, entries for temporary users are like those of IPs. They are of the form <temporary username> (talk) where <temporary username> is a link to Special:Contributions. This seems reasonable to me.

Example https://en.wikipedia.beta.wmflabs.org/wiki/Special:Log?type=gblblock&user=&page=%7E2024-7332&wpdate=&tagfilter=&subtype=&wpFormIdentifier=logeventslist.

Test environments: https://en.wikipedia.beta.wmflabs.org and https://de.wikipedia.beta.wmflabs.org GlobalBlocking – (5c38b4b) 07:17, 27 March 2024.

Thanks for the thorough QA.