Page MenuHomePhabricator

Special:BlockedExternalDomains should make use of Community Configuration
Closed, ResolvedPublic

Description

Background

@Ladsgroup introduced (T337431, T279275) Special:BlockedExternalDomains during Wikimedia-Hackathon-2023. The special page manages spam blacklists at individual wikis. It stores the list of blocked domains on-wiki as JSON, see https://cs.wikipedia.org/wiki/MediaWiki:BlockedExternalDomains.json as an example.

Problem

Special:BlockedExternalDomains predates CommunityConfiguration the extension by a year or so. Hence, it includes its own implementation of the wiki page integration. In addition to that, Special:BlockedExternalDomains does not appear in https://en.wikipedia.org/wiki/Special:CommunityConfiguration, reducing its discoverability.

Solution

Integrate Special:BlockedExternalDomains with CommunityConfiguration. This should be fairly straightforward, given there is already a JSON document on the wikis. In addition to helping with discoverability, it would also simplify the code in AbuseFilter.

Event Timeline

Change #1140993 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/CommunityConfiguration@master] refactor: Make AbstractProvider more abstract

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

Change #1141012 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/AbuseFilter@master] WIP: Integrate with CommunityConfiguration

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

Change #1141037 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[integration/config@master] [Zuul] Add CommunityConfiguration as a dependency for AbuseFilter

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

Change #1141043 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/AbuseFilter@master] refactor: Namespace blocked domains

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

This should be documented at https://www.mediawiki.org/wiki/Extension:AbuseFilter. Please note AbuseFilter is currently bundled in MediaWiki, but CommunityConfiguration is not (T392042: Bundle CommunityConfiguration with MediaWiki core).

Change #1141043 merged by jenkins-bot:

[mediawiki/extensions/AbuseFilter@master] refactor: Namespace blocked domains

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

Change #1140993 merged by jenkins-bot:

[mediawiki/extensions/CommunityConfiguration@master] refactor: Make AbstractProvider more abstract

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

Change #1141431 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/AbuseFilter@master] refactor: Check whether BlockedDomain should be enabled in ServiceWiring

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

Change #1141037 merged by jenkins-bot:

[integration/config@master] Zuul: [AbuseFilter] Add CommunityConfiguration as a Phan dependency

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

Mentioned in SAL (#wikimedia-releng) [2025-05-04T08:59:18Z] <James_F> Zuul: [AbuseFilter] Add CommunityConfiguration as a Phan dependency, for T393240

Change #1141431 merged by jenkins-bot:

[mediawiki/extensions/AbuseFilter@master] refactor: Check whether BlockedDomain should be enabled in ServiceWiring

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

Change #1141508 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/AbuseFilter@master] refactor: Factor BlockedDomainValidator out of the storage

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

Change #1141511 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/AbuseFilter@master] refactor: Add support for multiple blocked domain storages

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

Change #1141519 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/AbuseFilter@master] refactor: Switch IBlockedDomainStorage to Authority

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

Change #1141547 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/AbuseFilter@master] refactor: Factor most of BlockedExternalDomains into an editor class

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

Change #1141200 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/AbuseFilter@master] WIP: Enable BlockedExternalDomains in CC interface

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

Change #1142508 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/VisualEditor@master] refactor: Adapt to new AbuseFilter class names

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

Change #1141508 merged by jenkins-bot:

[mediawiki/extensions/AbuseFilter@master] refactor: Factor BlockedDomainValidator out of the storage

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

Change #1141511 merged by jenkins-bot:

[mediawiki/extensions/AbuseFilter@master] refactor: Add support for multiple blocked domain storages

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

Change #1145168 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/CommunityConfiguration@master] AbstractProvider: Ensure config is validated

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

Change #1145168 merged by jenkins-bot:

[mediawiki/extensions/CommunityConfiguration@master] AbstractProvider: Ensure config is validated

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

Change #1142508 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] refactor: Adapt to new AbuseFilter class names

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

Change #1141519 merged by jenkins-bot:

[mediawiki/extensions/AbuseFilter@master] refactor: Switch IBlockedDomainStorage to Authority

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

Change #1141547 merged by jenkins-bot:

[mediawiki/extensions/AbuseFilter@master] refactor: Factor most of BlockedExternalDomains into an editor class

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

Change #1141012 merged by jenkins-bot:

[mediawiki/extensions/AbuseFilter@master] Integrate with CommunityConfiguration

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

Change #1141200 merged by jenkins-bot:

[mediawiki/extensions/AbuseFilter@master] Enable BlockedExternalDomains in CC interface

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

This seems Tech-News worthy.

To User-notice: This adds a link to the blocked external domains editor to Special:CommunityConfiguration. This can be tested via beta (see example), and will be deployed within the wmf.15 train. Functionally-wise, blocked external domains should work as before, just under the arms of CommunityConfiguration. In the future, this should allow us to simplify AbuseFilter's code (as previously, it needed to know how to load the list from a wiki page), but that benefit is in the far distant future, and might not be worth mentioning.

Let me know if you have any questions!

Thanks for the suggestion and draft! A few suggestions/questions:
(1) Content: Is this rewrite accurate and good, or tweakable to something good?

  • Administrators can now access the Special:BlockedExternalDomains page from the Special:CommunityConfiguration list page. This makes it easier to find.

Are there any other technical aspects/changes that need to be mentioned? -- I.e. I'm uncertain whether we need to mention anything about "Functionally-wise, blocked external domains should work as before" -- from a glance comparison (of Beta Cluster versus MediaWikiwiki), it seems like the features are identical from a user-perspective.

(2) Timing: As this is not crucial for editors to learn ahead-of-time, I suggest postponing this entry until the following week's edition, so that the feature-update will be immediately available to everyone on the Monday/Tuesday that Tech News is published. -- However, if you would prefer it to be included in this next edition, we can do so, and I'd just tweak the entry to start with "Later this week, ....".

Etonkovidova subscribed.

Thanks for the suggestion and draft! A few suggestions/questions:
(1) Content: Is this rewrite accurate and good, or tweakable to something good?

  • Administrators can now access the Special:BlockedExternalDomains page from the Special:CommunityConfiguration list page. This makes it easier to find.

Are there any other technical aspects/changes that need to be mentioned? -- I.e. I'm uncertain whether we need to mention anything about "Functionally-wise, blocked external domains should work as before" -- from a glance comparison (of Beta Cluster versus MediaWikiwiki), it seems like the features are identical from a user-perspective.

Yes, the testing showed that the functionality is identical.

(2) Timing: As this is not crucial for editors to learn ahead-of-time, I suggest postponing this entry until the following week's edition, so that the feature-update will be immediately available to everyone on the Monday/Tuesday that Tech News is published. -- However, if you would prefer it to be included in this next edition, we can do so, and I'd just tweak the entry to start with "Later this week, ....".

The deploy tag is wmf.15 - so, it'd be out this week. I have couple of really minor notes on UX, I'm moving the task to Blocked/Needs Work (and pinging @Urbanecm_WMF) for visibility.

(really minor issues) tested on enwiki beta
(1) The form https://en.wikipedia.beta.wmcloud.org/wiki/Special:CommunityConfiguration/BlockedDomain doesn't inform a user that editing is available only for admins, like other forms do:

Special:CommunityConfiguration/BlockedDomainSpecial:CommunityConfiguration/Babel
Screenshot 2025-08-18 at 5.10.56 PM.png (1×2 px, 379 KB)
Screenshot 2025-08-18 at 5.12.42 PM.png (1×2 px, 192 KB)

(2) there is no confirmation upon saving, like on other forms, below is the confirmation for saving on :

Screenshot 2025-08-18 at 5.29.07 PM.png (404×3 px, 62 KB)

(3) other forms display Editing in the title for admins:

Screenshot 2025-08-18 at 5.31.27 PM.png (1×3 px, 184 KB)
Screenshot 2025-08-18 at 5.33.11 PM.png (1×2 px, 256 KB)

I saw the new page on frwiki, but it does not work for me.
When I click on "View form", the page is just reloaded and nothing happens. I can still edit MediaWiki:BlockedExternalDomains.json manually without issue.

I am interface admin and not admin.

I am interface admin and not admin.

Thanks! I'm checking now whether or not the form works for Interface admin. If a user is able to edit MediaWiki:BlockedExternalDomains.json, then, logically, the Special:CommunityConfiguration/BlockedDomain form should be editable.

I am interface admin and not admin.

Thanks! I'm checking now whether or not the form works for Interface admin. If a user is able to edit MediaWiki:BlockedExternalDomains.json, then, logically, the Special:CommunityConfiguration/BlockedDomain form should be editable.

Looking at the history of MediaWiki:BlockedExternalDomains.json, it seems that no edit made by an interface admin has a formatted diff comment, so it was probably already the case that only admins can use the form, although interface admins can edit the list manually.

@Escargot_rouge - thanks for verifying it. According to https://www.mediawiki.org/wiki/Growth/Community_Configuration both interface-admin and sysops should be able to edit forms on Special:CommunityConfiguration and MediaWiki json pages. It seems that the issue needs more investigation.

The issue has been confirmed -if a user has only interface-admin rights, such users cannot edit Special:CommunityConfiguration/BlockedDomain.

Other forms, e.g. Special:CommunityConfiguration/GrowthSuggestedEdits, can be edited by interface-admin, as expected.

I’m not sure if it’s caused by these changes, but the timing is suspicious: please take a look at https://en.wikipedia.org/w/index.php?title=MediaWiki:BlockedExternalDomains.json&diff=1307447522 – the page turned from a JSON array into a JSON object. This made this particular edit much larger than necessary, and it’ll make any future deletions also much larger than necessary, since all domains following the deleted one will get renumbered. Can someone please fix it so that the page is again a JSON array?

Edit: I tested it locally, and as soon as I disable the CommunityConfiguration extension (and thus edit the page on Special:BlockedExternalDomains instead of Special:CommunityConfiguration/BlockedDomain), the special page starts to write arrays, and I cannot even save the page with the object version (if I try to edit the page directly). So it’s definitely caused by the CommunityConfiguration integration.

Thank you all for the reports. I'll investigate this issue and fix it as soon as possible. For some reason, this was completely missed during development.

Change #1192891 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/CommunityConfiguration@master] Move sorting values into DataProvider

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

Urbanecm_WMF moved this task from Doing to QA on the Growth-Team (Current Sprint) board.