Page MenuHomePhabricator

Override new GlobalBlocking messages on WikimediaMessages
Closed, ResolvedPublic2 Estimated Story Points

Description

Background

After T317308: GlobalBlocking should specify block error message key, new messages are added in the GlobalBlocking extension to replace the following, because of a need to change the order in which the parameters are passed in:

  • Globalblocking-ipblocked replaced by Globalblocking-blockedtext-ip
  • Globalblocking-ipblocked-range replaced by Globalblocking-blockedtext-range
  • Globalblocking-ipblocked-xffreplaced by Globalblocking-blockedtext-xff

These messages are used when a user can't do something because their IP address is globally blocked.

The older messages all have overrides in the WikimediaMessages extension, e.g.: https://gerrit.wikimedia.org/g/mediawiki/extensions/WikimediaMessages/+/37e3df5cf0997a53d5df5324f14279b161cfbe62/i18n/wikimedia/en.json#275

The new messages should be overridden on WikimediaMessages too.

Acceptance criteria
Notes

For details of why we need new messages, see the conversation on T317308: GlobalBlocking should specify block error message key.

Event Timeline

TThoabala set the point value for this task to 2.Oct 26 2022, 4:31 PM

Change 851678 had a related patch set uploaded (by Tchanders; author: Tchanders):

[mediawiki/extensions/WikimediaMessages@master] Add overrides for new messages in the GlobalBlocking extension

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

Tchanders renamed this task from Update WikimediaMessages param order for GlobalBlocking message overrides to Override new GlobalBlocking messages on WikimediaMessages.Nov 3 2022, 8:35 PM

Change 851678 merged by jenkins-bot:

[mediawiki/extensions/WikimediaMessages@master] Add overrides for new messages in the GlobalBlocking extension

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

Testing notes

The tests steps are adapted from https://phabricator.wikimedia.org/T317308 (testing notes bullet point 3)

With WikimediaMessages enabled, run the following steps...

  • Globally block your IP address. (Make sure there are no local blocks or other local blocks against your IP address.)
  • Log out and visit Special:Upload
  • The blocked message should be wikimedia--globalblocking-blockedtext-ip

Repeat this, but in the first 2 steps:

  • block an IP range covering your IP address.The message should be wikimedia-globalblocking-blockedtext-range.
  • change your XFF header using a extension such as [[ chrome://extensions/?id=hkghghbnihliadkabmlcmcgmffllglin | this one ]] , and block that IP address. The message should be wikimedia-globalblocking-blockedtext-xff.

@Tchanders @TThoabala I have been testing this locally (with WikimediaMessages installed) and on beta commons.

I am not seeing the wikimedia- messages on Special:Upload. Instead, I am still seeing globalblocking-blockedtext-ip, globalblocking-blockedtext-range and globalblocking-blockedtext-xff.

On the other hand, when attempting to edit I see wikimedia-globalblocking-ipblocked, wikimedia-globalblocking-ipblocked-range, etc.

Change 854567 had a related patch set uploaded (by Tchanders; author: Tchanders):

[mediawiki/extensions/WikimediaMessages@master] Fix override messages for GlobalBlocking

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

@Tchanders @TThoabala I have been testing this locally (with WikimediaMessages installed) and on beta commons.

I am not seeing the wikimedia- messages on Special:Upload. Instead, I am still seeing globalblocking-blockedtext-ip, globalblocking-blockedtext-range and globalblocking-blockedtext-xff.

On the other hand, when attempting to edit I see wikimedia-globalblocking-ipblocked, wikimedia-globalblocking-ipblocked-range, etc.

Thanks, @dom_walden - the new patch should fix this.

Testing notes

The tests steps are adapted from https://phabricator.wikimedia.org/T317308 (testing notes bullet point 3)

With WikimediaMessages enabled, run the following steps...

  • Globally block your IP address. (Make sure there are no local blocks or other local blocks against your IP address.)
  • Log out and visit Special:Upload
  • The blocked message should be wikimedia--globalblocking-blockedtext-ip

Repeat this, but in the first 2 steps:

  • block an IP range covering your IP address.The message should be wikimedia-globalblocking-blockedtext-range.
  • change your XFF header using a extension such as [[ chrome://extensions/?id=hkghghbnihliadkabmlcmcgmffllglin | this one ]] , and block that IP address. The message should be wikimedia-globalblocking-blockedtext-xff.

For the wikimedia-globalblocking-blockedtext-xff, also make sure that:
there is no other block or global block
$wgCdnServers is not overridden in LocalSettings.php

Change 854567 merged by jenkins-bot:

[mediawiki/extensions/WikimediaMessages@master] Fix override messages for GlobalBlocking

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

@Tchanders @AGueyte I'm not seeing the wikimedia- messages on Special:Upload as seen in the screenshots for globalblocking-blockedtext-ip, globalblocking-blockedtext-range, and globalblocking-blockedtext-xff.

Test Environment: Beta
Browser: Chrome

globalblocking-blockedtext-ip:FAIL

T321574_GB_IP_Chrome_Fail.png (753×2 px, 227 KB)

globalblocking-blockedtext-range:FAIL

T321574_GB_IPRange_Chrome_Fail.png (725×2 px, 222 KB)

globalblocking-blockedtext-xff:FAIL

T321574_GB_XFF_Chrome_Fail.png (720×2 px, 218 KB)

Thanks @GMikesell-WMF. This may be because beta is not configured as specified in T321574#8386663.

I see that @dom_walden tested locally for T317308#8373209. Would you be able to do that?

Thanks @GMikesell-WMF. This may be because beta is not configured as specified in T321574#8386663.

I see that @dom_walden tested locally for T317308#8373209. Would you be able to do that?

If I am reading the code correctly, WikimediaMessages only overrides globalblocking-ipblocked, globalblocking-ipblocked-range and globalblocking-ipblocked-xff.

I cannot see where globalblocking-blockedtext-ip, globalblocking-blockedtext-range and globalblocking-blockedtext-xff get overridden.

Is there a reason we have those two different sets of messages?

Thanks @GMikesell-WMF. This may be because beta is not configured as specified in T321574#8386663.

I see that @dom_walden tested locally for T317308#8373209. Would you be able to do that?

If I am reading the code correctly, WikimediaMessages only overrides globalblocking-ipblocked, globalblocking-ipblocked-range and globalblocking-ipblocked-xff.

I cannot see where globalblocking-blockedtext-ip, globalblocking-blockedtext-range and globalblocking-blockedtext-xff get overridden.

globalblocking-blockedtext-ip etc are overridden by being defined in the WikimediaMessages extension here: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/WikimediaMessages/+/854567/1/i18n/wikimediaoverrides/en.json#21 and included in this list: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/WikimediaMessages/+/854567/1/includes/Hooks.php#111

The older messages, globalblocking-ipblocked etc, are overridden by GlobalBlocking firing a hook, which I believe was necessary at the time when those messages were added.

Is there a reason we have those two different sets of messages?

Unfortunately both are being used at the moment, The older ones are being used by the pathways that we didn't touch, and the newer ones are being used by the new hook handler we added. We needed to add the newer ones because they need to take the message parameters in a certain order.

@Tchanders @AGueyte I'm not seeing the wikimedia- messages on Special:Upload as seen in the screenshots for globalblocking-blockedtext-ip, globalblocking-blockedtext-range, and globalblocking-blockedtext-xff.

Looking again locally, I think everything is working as expected, and these messages are being overridden. However, using the uselang=qqx param, the name of the message does not have the wikimedia- prefix. This is just a quirk of how the messages are being overridden. I think the best way to confirm this would be to check that the message translations are the same ones defined in the WikimediaMessages language files: https://gerrit.wikimedia.org/g/mediawiki/extensions/WikimediaMessages/+/1c7b073f838c893576462c5df88950ad0979e0c1/i18n/wikimediaoverrides/en.json#21

Looking again locally, I think everything is working as expected, and these messages are being overridden. However, using the uselang=qqx param, the name of the message does not have the wikimedia- prefix. This is just a quirk of how the messages are being overridden. I think the best way to confirm this would be to check that the message translations are the same ones defined in the WikimediaMessages language files: https://gerrit.wikimedia.org/g/mediawiki/extensions/WikimediaMessages/+/1c7b073f838c893576462c5df88950ad0979e0c1/i18n/wikimediaoverrides/en.json#21

@Tchanders Updated the en.json with "Test<info>" at the beginning to for globalblocking-blockedtext-ip, globalblocking-blockedtext-range, and globalblocking-blockedtext-xff to see if it would show up, which it did as seen in the screenshot. This validates the content for each GlobalBlock in Local.

Can we move this to Done now?

Test Environment: Local
Browser: Chrome

T321574_Local_GB_IP_Chrome.png (509×1 px, 149 KB)

T321574_Local_GB_IP_Chrome_Testjson.png (559×1 px, 254 KB)