Commit graph

17 commits

Author SHA1 Message Date
James D. Forrester
9e5c1e8ac7 Add namespace to IDBAccessObject and DBAccessObjectUtils
Bug: T353458
Change-Id: I23cf7991f8792d4d000d1780463d8ce76dc0aee0
2024-09-27 16:19:10 -04:00
Ebrahim Byagowi
560c0d9a96 Add namespace and deprecation alias to RenameUserJob
This patch introduces a namespace declaration for the
MediaWiki\RenameUser to RenameUserJob and establishes a class
alias marked as deprecated since version 1.43.

Bug: T353458
Change-Id: Ibf7d6d54e0047c6c298c02926d8a811d26f6361c
2024-05-17 14:21:12 +03:30
Tim Starling
a5372218b7 block: Deprecate and stop using $wgBlockTargetMigrationStage
* Deprecate and stop using $wgBlockTargetMigrationStage. Remove
  block_target migration code.
* Make the $schema parameters to DatabaseBlockStore methods default to
  SCHEMA_BLOCK. Avoid passing these parameters where possible.
* Remove cleanupBlocks.php
* Deprecate DatabaseBlock static methods which try to present the old
  schema for b/c.

Bug: T362133
Change-Id: I845bad8cc09a4528fef46a6f9d490ebdec881d99
2024-05-10 15:54:17 +10:00
jenkins-bot
8f8e1d6f85 Merge "Change more uses of getDBLoadBalancerFactory() to getConnectionProvider()" 2024-01-23 17:59:21 +00:00
Bartosz Dziewoński
4aebcfe097 Change more uses of getDBLoadBalancerFactory() to getConnectionProvider()
Some less trivial cases. Also update variable names.

This doesn't really change anything, but I hope it helps promote
getConnectionProvider() as the common way to do this.

Follow-up to 8604c384f6.

Change-Id: I6657d783375fac5c7fa856b884ff1fb09285e94c
2024-01-23 16:34:45 +01:00
Amir Sarabadani
014bc61006 Remove more indirect calls to IDBAccessObject::READ_* constants
Found via (?<!IDBAccessObject)::READ_

We are planning to deprecate and remove implementing IDBAccessObject
interface just to use the constants.

Bug: T354194
Change-Id: I89d442fa493b8e5332ce118e5bf13f13b8dd3477
2024-01-23 15:42:38 +01:00
Tim Starling
d6727856fd Support new block schema
Support migration stages when reading and writing blocks.

I tried to set it up for an easy next stage, in which support for the
old schema is removed. I tried to avoid factoring out of shared code
between the two schemas, so that the old schema cases can simply be
deleted without the need to revert unnecessary abstractions.

However, I added HideUserUtils to factor out ipb_deleted queries. Code
review showed that this was already quite complex, with multiple
approaches to the problem, so it benefits from refactoring even without
the schema abstraction.

HideUserUtils is a service rather than a standalone class to support
unit tests, since unit tests do not allow global config access. When
the migration stage config is removed, it will be a service with no
constructor parameters -- an unnecessary abstraction which should
ideally be resolved at that time.

When interpreting result rows, it is possible to share code by using
field aliases. But when constructing WHERE conditions, the actual field
names need to be used, so the migration is more intrusive in
ApiQueryBlocks and SpecialBlockList, where complex conditions are used.

Bug: T346293
Bug: T51504
Bug: T349883
Change-Id: I408acf7a57b0100fe18c455fc13141277a598925
2023-11-29 13:31:42 +11:00
Amir Sarabadani
5c92332b01 RenameUser: Migrate from ILB to ICP
Bug: T330641
Change-Id: I1fd84461d8eb2ccd686c5462255c7690d2103b82
2023-10-31 13:58:13 +01:00
Reedy
e5f61c1d79 RenameuserSQL: Minor tweaks and updates
Change-Id: Ic34877c3d337935f868ce397823c78186fa1ffe6
2023-10-19 13:17:19 +00:00
jenkins-bot
4d1e278105 Merge "Migrate another major batch to SelectQueryBuilder" 2023-09-20 13:39:17 +00:00
Amir Sarabadani
44a6dd21b3 Migrate another major batch to SelectQueryBuilder
I fixed some edge cases in the script that migrates to SQB and it
managed to fix these now.

Bug: T344971
Change-Id: I00cc9a6660d9bd4c64c976121b2121ccd7aae1f0
2023-09-20 13:32:09 +02:00
James D. Forrester
1d0b7ae1e2 Namespace User under \MediaWiki\User
Bug: T166010
Change-Id: I7257302b485588af31384d4f7fc8e30551f161f1
2023-09-19 19:18:16 +00:00
James D. Forrester
711295fb5d Namespace SpecialL* under \MediaWiki\Specials
Plus two redirect specials.

Change-Id: Ie56f96894f6bfbdb9bc093fce8b72b18f8adce86
2023-05-04 19:27:38 +00:00
Amir Sarabadani
412bdc8eb2 Migrate several $db->update() calls to UpdateQueryBuilder
Bug: T330640
Change-Id: I85f94e4bab28348e48a32974389bf18b4700bdd3
2023-04-21 10:52:27 +02:00
Tim Starling
9e534bd0d8 Renameuser: tweaks and followups
* Use IConnectionProvider
* Inject services into the job
* Use JobSpecification to avoid unnecessary service construction

Bug: T27482
Change-Id: I75ac8c53b874742a3a54526692767d0f549e5259
2023-03-13 09:20:53 +11:00
Tim Starling
0175458f55 Renameuser: refactoring round 1
* Use dependency injection or centralize access to the service
  container.
* Remove code from RenameUserJob which was obsoleted by the actor table
  migration. This job class is not used to update revision or logging
  anymore.

Bug: T27482
Change-Id: I2bbea713f4c68a15e22e5c3f64d8decbd0b0a9de
2023-03-10 11:07:45 +11:00
Tim Starling
7efc7f7518 Copy the Renameuser extension into core
Copy the Renameuser extension into core, with minimal code changes. The
hook handlers are inlined into Article, SpecialLog and
SpecialContributions.

Bug: T27482
Change-Id: I314021f4138773df6aaf2753b33ab8283cd16974
2023-03-03 09:39:39 -05:00