Page MenuHomePhabricator

Hard-deprecate DatabaseBlock 'byText' and 'by' with user ID
Open, Needs TriagePublic

Description

DatabaseBlock constructor accepts 'byText' property with blocker's name, and 'by' property with a blocker ID or, since I144603516b, a UserIdentity.

In cross-wiki blocking it's extremely easy to make a mistake and attribute the blocker to a local user with the same name or ID. Instead, these options for DatabaseBlock have to be hard-deprecated. The only remaining option should be providing a UserIdentity as a 'by' option.

Steps:

  1. Use codesearch to find all extensions that provide these options incorrectly. Make a list on this task. Fix extensions.
  2. Fix core.

Quick look over codesearch reveals that these options are mostly used in test codeso perhaps they can be removed without deprecation.

Event Timeline

List of extension that should be updated/fixed:

  • EntitySchema -> (RestoreSubmitActionTest.php, UndoSubmitActionTest.php, NewEntitySchemaTest.php).
  • AbuseFilter -> (AbuseFilterBlockTest.php).
  • Jade -> (EntityValidatorTest.php).
  • WikibaseLexeme -> (ApiUserBlockedTest.php, SpecialNewLexemeTest.php).
  • EventBus -> (EventFactoryTest.php).
  • Flow -> (RevisionCollectionPermissionsTest.php).
  • Thanks -> (ApiCoreThankUnitTest.php).
  • Wikibase -> (ApiUserBlockedTest.php).

Change 697421 had a related patch set uploaded (by Roman Stolar; author: Roman Stolar):

[mediawiki/extensions/EntitySchema@master] Update DatabaseBlock construct option 'by' to use User Identity only

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

Change 697427 had a related patch set uploaded (by Roman Stolar; author: Roman Stolar):

[mediawiki/extensions/AbuseFilter@master] Update DatabaseBlock construct option 'by' to use User Identity only

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

Change 697429 had a related patch set uploaded (by Roman Stolar; author: Roman Stolar):

[mediawiki/extensions/Jade@master] Update DatabaseBlock construct option 'by' to use User Identity only

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

Change 697434 had a related patch set uploaded (by Roman Stolar; author: Roman Stolar):

[mediawiki/extensions/WikibaseLexeme@master] Update DatabaseBlock construct option 'by' to use User Identity only

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

Change 697438 had a related patch set uploaded (by Roman Stolar; author: Roman Stolar):

[mediawiki/extensions/EventBus@master] Update DatabaseBlock construct option 'byText' to 'by' use User Identity only

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

Change 697439 had a related patch set uploaded (by Roman Stolar; author: Roman Stolar):

[mediawiki/extensions/Flow@master] Update DatabaseBlock construct option 'by' to use User Identity only

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

Change 697441 had a related patch set uploaded (by Roman Stolar; author: Roman Stolar):

[mediawiki/extensions/Thanks@master] Update DatabaseBlock construct option 'by' to use User Identity only

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

Change 697427 merged by jenkins-bot:

[mediawiki/extensions/AbuseFilter@master] Update DatabaseBlock construct option 'by' to use User Identity only

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

Change 697442 had a related patch set uploaded (by Roman Stolar; author: Roman Stolar):

[mediawiki/extensions/Wikibase@master] Update DatabaseBlock construct option 'by' to use User Identity only

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

Change 697429 merged by jenkins-bot:

[mediawiki/extensions/Jade@master] Update DatabaseBlock construct option 'by' to use User Identity only

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

Change 697434 merged by jenkins-bot:

[mediawiki/extensions/WikibaseLexeme@master] Update DatabaseBlock construct option 'by' to use User Identity only

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

Change 697438 merged by jenkins-bot:

[mediawiki/extensions/EventBus@master] Update DatabaseBlock construct option 'byText' to 'by' use User Identity only

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

Change 697441 merged by jenkins-bot:

[mediawiki/extensions/Thanks@master] Update DatabaseBlock construct option 'by' to use User Identity only

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

Change 697439 merged by jenkins-bot:

[mediawiki/extensions/Flow@master] Update DatabaseBlock construct option 'by' to use User Identity only

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

Change 697421 merged by jenkins-bot:

[mediawiki/extensions/EntitySchema@master] Update DatabaseBlock construct option 'by' to use User Identity only

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

Change 697727 had a related patch set uploaded (by Roman Stolar; author: Roman Stolar):

[mediawiki/core@master] Update DatabaseBlock construct option 'by' and 'byText' usage to use User Identity only

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

Change 697442 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Update DatabaseBlock construct option 'by' to use User Identity only

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

Change 697727 merged by jenkins-bot:

[mediawiki/core@master] Update DatabaseBlock construct option 'by' and 'byText' usage to use User Identity only

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

@Pchelolo I just double check in code search usage of these options, probably I will just remove them without depreciation.

Change 697936 had a related patch set uploaded (by Roman Stolar; author: Roman Stolar):

[mediawiki/core@master] Remove DatabaseBlock 'byText' and 'by' with user ID

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

Change 698160 had a related patch set uploaded (by Roman Stolar; author: Roman Stolar):

[mediawiki/core@master] Hard deprecated DatabaseBlock options 'byText' and 'by' with user ID

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

Change 698160 merged by jenkins-bot:

[mediawiki/core@master] Hard deprecated DatabaseBlock options 'byText' and 'by' with user ID

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