Remove deprecated ActorMigration usages around ContribsPager

Change-Id: I1a4224eac8bad47f7228faf68ea7f9c7d44a44ad
This commit is contained in:
Func 2023-08-25 14:40:54 +08:00
parent d713ab0716
commit 596ea5eacb
9 changed files with 2 additions and 48 deletions

View file

@ -11,7 +11,6 @@ use MediaWiki\HookContainer\HookContainer;
use MediaWiki\Linker\LinkRendererFactory;
use MediaWiki\Permissions\Authority;
use MediaWiki\Request\FauxRequest;
use MediaWiki\User\ActorMigration;
use MediaWiki\User\UserIdentity;
use Message;
use NamespaceInfo;
@ -38,9 +37,6 @@ class ContributionsLookup {
/** @var IConnectionProvider */
private $dbProvider;
/** @var ActorMigration */
private $actorMigration;
/** @var NamespaceInfo */
private $namespaceInfo;
@ -53,7 +49,6 @@ class ContributionsLookup {
* @param LinkBatchFactory $linkBatchFactory
* @param HookContainer $hookContainer
* @param IConnectionProvider $dbProvider
* @param ActorMigration $actorMigration
* @param NamespaceInfo $namespaceInfo
* @param CommentFormatter $commentFormatter
*/
@ -63,7 +58,6 @@ class ContributionsLookup {
LinkBatchFactory $linkBatchFactory,
HookContainer $hookContainer,
IConnectionProvider $dbProvider,
ActorMigration $actorMigration,
NamespaceInfo $namespaceInfo,
CommentFormatter $commentFormatter
) {
@ -72,7 +66,6 @@ class ContributionsLookup {
$this->linkBatchFactory = $linkBatchFactory;
$this->hookContainer = $hookContainer;
$this->dbProvider = $dbProvider;
$this->actorMigration = $actorMigration;
$this->namespaceInfo = $namespaceInfo;
$this->commentFormatter = $commentFormatter;
}
@ -275,7 +268,6 @@ class ContributionsLookup {
$this->linkBatchFactory,
$this->hookContainer,
$this->dbProvider,
$this->actorMigration,
$this->revisionStore,
$this->namespaceInfo,
$targetUser,

View file

@ -533,7 +533,6 @@ return [
$services->getLinkBatchFactory(),
$services->getHookContainer(),
$services->getDBLoadBalancerFactory(),
$services->getActorMigration(),
$services->getNamespaceInfo(),
$services->getCommentFormatter()
);

View file

@ -33,7 +33,6 @@ use MediaWiki\Revision\RevisionRecord;
use MediaWiki\Revision\RevisionStore;
use MediaWiki\Revision\SlotRecord;
use MediaWiki\Title\Title;
use MediaWiki\User\ActorMigration;
use MediaWiki\User\UserFactory;
use MediaWiki\User\UserRigorOptions;
use Wikimedia\ParamValidator\ParamValidator;
@ -65,9 +64,6 @@ class ApiFeedContributions extends ApiBase {
/** @var NamespaceInfo */
private $namespaceInfo;
/** @var ActorMigration */
private $actorMigration;
/** @var UserFactory */
private $userFactory;
@ -87,7 +83,6 @@ class ApiFeedContributions extends ApiBase {
* @param HookContainer $hookContainer
* @param IConnectionProvider $dbProvider
* @param NamespaceInfo $namespaceInfo
* @param ActorMigration $actorMigration
* @param UserFactory $userFactory
* @param CommentFormatter $commentFormatter
*/
@ -101,7 +96,6 @@ class ApiFeedContributions extends ApiBase {
HookContainer $hookContainer,
IConnectionProvider $dbProvider,
NamespaceInfo $namespaceInfo,
ActorMigration $actorMigration,
UserFactory $userFactory,
CommentFormatter $commentFormatter
) {
@ -113,7 +107,6 @@ class ApiFeedContributions extends ApiBase {
$this->hookContainer = $hookContainer;
$this->dbProvider = $dbProvider;
$this->namespaceInfo = $namespaceInfo;
$this->actorMigration = $actorMigration;
$this->userFactory = $userFactory;
$this->commentFormatter = $commentFormatter;
@ -188,7 +181,6 @@ class ApiFeedContributions extends ApiBase {
$this->linkBatchFactory,
$this->hookContainer,
$this->dbProvider,
$this->actorMigration,
$this->revisionStore,
$this->namespaceInfo,
$targetUser,

View file

@ -190,7 +190,6 @@ class ApiMain extends ApiBase {
'HookContainer',
'DBLoadBalancerFactory',
'NamespaceInfo',
'ActorMigration',
'UserFactory',
'CommentFormatter',
]

View file

@ -536,7 +536,6 @@ class SpecialPageFactory {
'LinkBatchFactory',
'PermissionManager',
'DBLoadBalancerFactory',
'ActorMigration',
'RevisionStore',
'NamespaceInfo',
'UserNameUtils',

View file

@ -40,7 +40,6 @@ use MediaWiki\Permissions\PermissionManager;
use MediaWiki\Revision\RevisionStore;
use MediaWiki\Specials\Contribute\ContributeFactory;
use MediaWiki\Title\Title;
use MediaWiki\User\ActorMigration;
use MediaWiki\User\UserFactory;
use MediaWiki\User\UserNamePrefixSearch;
use MediaWiki\User\UserNameUtils;
@ -72,9 +71,6 @@ class SpecialContributions extends IncludableSpecialPage {
/** @var IConnectionProvider */
private $dbProvider;
/** @var ActorMigration */
private $actorMigration;
/** @var RevisionStore */
private $revisionStore;
@ -103,7 +99,6 @@ class SpecialContributions extends IncludableSpecialPage {
* @param LinkBatchFactory|null $linkBatchFactory
* @param PermissionManager|null $permissionManager
* @param IConnectionProvider|null $dbProvider
* @param ActorMigration|null $actorMigration
* @param RevisionStore|null $revisionStore
* @param NamespaceInfo|null $namespaceInfo
* @param UserNameUtils|null $userNameUtils
@ -116,7 +111,6 @@ class SpecialContributions extends IncludableSpecialPage {
LinkBatchFactory $linkBatchFactory = null,
PermissionManager $permissionManager = null,
IConnectionProvider $dbProvider = null,
ActorMigration $actorMigration = null,
RevisionStore $revisionStore = null,
NamespaceInfo $namespaceInfo = null,
UserNameUtils $userNameUtils = null,
@ -131,7 +125,6 @@ class SpecialContributions extends IncludableSpecialPage {
$this->linkBatchFactory = $linkBatchFactory ?? $services->getLinkBatchFactory();
$this->permissionManager = $permissionManager ?? $services->getPermissionManager();
$this->dbProvider = $dbProvider ?? $services->getDBLoadBalancerFactory();
$this->actorMigration = $actorMigration ?? $services->getActorMigration();
$this->revisionStore = $revisionStore ?? $services->getRevisionStore();
$this->namespaceInfo = $namespaceInfo ?? $services->getNamespaceInfo();
$this->userNameUtils = $userNameUtils ?? $services->getUserNameUtils();
@ -949,7 +942,6 @@ class SpecialContributions extends IncludableSpecialPage {
$this->linkBatchFactory,
$this->getHookContainer(),
$this->dbProvider,
$this->actorMigration,
$this->revisionStore,
$this->namespaceInfo,
$targetUser,

View file

@ -32,7 +32,6 @@ use MediaWiki\MediaWikiServices;
use MediaWiki\Revision\RevisionRecord;
use MediaWiki\Revision\RevisionStore;
use MediaWiki\Title\Title;
use MediaWiki\User\ActorMigration;
use MediaWiki\User\UserIdentity;
use MediaWiki\User\UserRigorOptions;
use Wikimedia\IPUtils;
@ -126,9 +125,6 @@ class ContribsPager extends RangeChronologicalPager {
*/
private $templateParser;
/** @var ActorMigration */
private $actorMigration;
/** @var CommentFormatter */
private $commentFormatter;
@ -161,7 +157,6 @@ class ContribsPager extends RangeChronologicalPager {
* @param LinkBatchFactory|null $linkBatchFactory
* @param HookContainer|null $hookContainer
* @param IConnectionProvider|null $dbProvider
* @param ActorMigration|null $actorMigration
* @param RevisionStore|null $revisionStore
* @param NamespaceInfo|null $namespaceInfo
* @param UserIdentity|null $targetUser
@ -174,7 +169,6 @@ class ContribsPager extends RangeChronologicalPager {
LinkBatchFactory $linkBatchFactory = null,
HookContainer $hookContainer = null,
IConnectionProvider $dbProvider = null,
ActorMigration $actorMigration = null,
RevisionStore $revisionStore = null,
NamespaceInfo $namespaceInfo = null,
UserIdentity $targetUser = null,
@ -221,8 +215,6 @@ class ContribsPager extends RangeChronologicalPager {
$this->hideMinor = !empty( $options['hideMinor'] );
$this->revisionsOnly = !empty( $options['revisionsOnly'] );
// Needed by call to getIndexField -> getTargetTable from parent constructor
$this->actorMigration = $actorMigration ?? $services->getActorMigration();
parent::__construct( $context, $linkRenderer ?? $services->getLinkRenderer() );
$msgs = [
@ -383,13 +375,9 @@ class ContribsPager extends RangeChronologicalPager {
];
$queryInfo['conds'][] = $ipRangeConds;
} else {
// tables and joins are already handled by RevisionStore::getQueryInfo()
$conds = $this->actorMigration->getWhere( $dbr, 'rev_user', $this->targetUser );
$queryInfo['conds'][] = $conds['conds'];
$queryInfo['conds']['actor_name'] = $this->targetUser->getName();
// Force the appropriate index to avoid bad query plans (T307295)
if ( isset( $conds['orconds']['newactor'] ) ) {
$queryInfo['options']['USE INDEX']['revision'] = 'rev_actor_timestamp';
}
$queryInfo['options']['USE INDEX']['revision'] = 'rev_actor_timestamp';
}
if ( $this->deletedOnly ) {

View file

@ -7,7 +7,6 @@ use MediaWiki\Linker\LinkRenderer;
use MediaWiki\MainConfigNames;
use MediaWiki\Revision\RevisionStore;
use MediaWiki\Title\Title;
use MediaWiki\User\ActorMigration;
use MediaWiki\User\UserIdentity;
use MediaWiki\User\UserIdentityValue;
use Wikimedia\Rdbms\FakeResultWrapper;
@ -36,9 +35,6 @@ class ContribsPagerTest extends MediaWikiIntegrationTestCase {
/** @var ILoadBalancer */
private $loadBalancer;
/** @var ActorMigration */
private $actorMigration;
/** @var NamespaceInfo */
private $namespaceInfo;
@ -54,7 +50,6 @@ class ContribsPagerTest extends MediaWikiIntegrationTestCase {
$this->linkBatchFactory = $services->getLinkBatchFactory();
$this->hookContainer = $services->getHookContainer();
$this->dbProvider = $services->getDBLoadBalancerFactory();
$this->actorMigration = $services->getActorMigration();
$this->namespaceInfo = $services->getNamespaceInfo();
$this->commentFormatter = $services->getCommentFormatter();
$this->pager = $this->getContribsPager( [
@ -71,7 +66,6 @@ class ContribsPagerTest extends MediaWikiIntegrationTestCase {
$this->linkBatchFactory,
$this->hookContainer,
$this->dbProvider,
$this->actorMigration,
$this->revisionStore,
$this->namespaceInfo,
$targetUser,

View file

@ -130,7 +130,6 @@ class SpecialContributionsTest extends SpecialPageTestBase {
$services->getLinkBatchFactory(),
$services->getPermissionManager(),
$services->getDBLoadBalancerFactory(),
$services->getActorMigration(),
$services->getRevisionStore(),
$services->getNamespaceInfo(),
$services->getUserNameUtils(),