Page MenuHomePhabricator

Hard-deprecate IDatabase parameter for UserIdentity:getActorId()
Closed, ResolvedPublic

Description

User::getActorId() currently can take an IDatabase as a parameter. If it is provided and if the actor ID is not yet set, it will use the IDatabase to create an actor. This side effect causes complications now that UserIdentity supports foreign wikis. In some cases, UserIdentityValue::getActorId() has been passed an IDatabase as well.

Replace all occurrences of calling UserIdentity::getActorId() with an IDatabase (codesearch):

  • core
  • UserMerge
  • SocialProfile (not Wikimedia deployed)
  • Comments (not Wikimedia deployed)
  • VoteNY (not Wikimedia deployed)
  • WikiForum (not Wikimedia deployed)
  • Hard deprecate calling UserIdentity::getActorId() with an IDatabase

The replacement is relatively simple: MediaWikiServices::getInstance()->getActorNormalization()->acquireActorId( $user ) if the call is done in the context of the local wiki. For foreign wikis if's more complex - but let's first survey if it's ever needed.

Event Timeline

Pchelolo triaged this task as Medium priority.Feb 2 2021, 5:52 AM

Can't quite do it before we have registerActor from T272689 completed.

daniel raised the priority of this task from Medium to High.Feb 3 2021, 5:43 PM
daniel lowered the priority of this task from High to Medium.Feb 3 2021, 10:29 PM
Pchelolo renamed this task from Do not call UserIdentity:getActorId() with an IDatabase parameter to Hard-deprecate IDatabase parameter for UserIdentity:getActorId().Feb 5 2021, 3:48 PM
Pchelolo updated the task description. (Show Details)
daniel raised the priority of this task from Medium to High.Feb 10 2021, 12:18 PM

Change 664358 had a related patch set uploaded (by Cicalese; owner: Cicalese):
[mediawiki/extensions/UserMerge@master] Hard-deprecate IDatabase parameter for UserIdentity:getActorId()

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

Change 664361 had a related patch set uploaded (by Cicalese; owner: Cicalese):
[mediawiki/core@master] Hard-deprecate IDatabase parameter for UserIdentity:getActorId()

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

Change 664364 had a related patch set uploaded (by Cicalese; owner: Cicalese):
[mediawiki/extensions/SocialProfile@master] Hard-deprecate IDatabase parameter for UserIdentity:getActorId()

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

Change 664358 merged by jenkins-bot:
[mediawiki/extensions/UserMerge@master] Replace User::getActorId($dbw) with ActorNormalization::acquireActorId()

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

Change 664361 merged by jenkins-bot:
[mediawiki/core@master] Hard-deprecate IDatabase parameter for UserIdentity:getActorId()

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

Change 664954 had a related patch set uploaded (by Cicalese; owner: Cicalese):
[mediawiki/extensions/Comments@master] Replace User::getActorId($dbw) with ActorNormalization::acquireActorId()

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

Change 664955 had a related patch set uploaded (by Cicalese; owner: Cicalese):
[mediawiki/extensions/VoteNY@master] Replace User::getActorId($dbw) with ActorNormalization::acquireActorId()

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

Change 664958 had a related patch set uploaded (by Cicalese; owner: Cicalese):
[mediawiki/extensions/WikiForum@master] Replace User::getActorId($dbw) with ActorNormalization::acquireActorId()

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

Change 664364 merged by jenkins-bot:
[mediawiki/extensions/SocialProfile@master] Replace User::getActorId($dbw) with ActorNormalization::acquireActorId()

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

Change 664955 merged by jenkins-bot:
[mediawiki/extensions/VoteNY@master] Replace User::getActorId($dbw) with ActorNormalization::acquireActorId()

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

Change 664958 merged by jenkins-bot:
[mediawiki/extensions/WikiForum@master] Replace User::getActorId($dbw) with ActorNormalization::acquireActorId()

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

Change 664954 merged by jenkins-bot:
[mediawiki/extensions/Comments@master] Replace User::getActorId($dbw) with ActorNormalization::acquireActorId()

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