Page MenuHomePhabricator

Update LocalUserRegistrationProvider to support users from remote wikis
Closed, ResolvedPublic

Description

Currently, LocalUserRegistrationProvider can only return information about users from the current wiki. However, for T407889: Update UserRequirementsConditionChecker to handle target users for UserGroupAssignmentService we will need it to be able to query the same data from remote wiki database.

Note: The registration provider has "local" in its name, but it's still okay to include this logic in it, because "local" in this case means "non-global" and not "non-remote".

Acceptance criteria

  • LocalUserRegistrationProvider::fetchRegistration can be invoked with a remote user and returns the local registration timestamp from that target wiki
  • LocalUserRegistrationProvider::fetchRegistrationBatch can be invoked with users from remote wiki and returns registration timestamps from the that wiki

Details

Event Timeline

Given that the signature of IUserRegistrationProvider::fetchRegistrationBatch expects that the return type is string[]|null[] (keyed by user id), we won't be able to indicate the wiki, from which the data points were queried. Therefore, this method may accept only a set of users from the same wiki. For example, fetchRegistrationBatch( [ user1@wiki1, user2@wiki1 ] ) will be allowed, whereas fetchRegistrationBatch( [ user1@wiki1, user2@wiki2 ] ) won't, because boh user may resolve to the same id.

I've edited the acceptance criteria to take it into account.

Change #1199766 had a related patch set uploaded (by Mszwarc; author: Mszwarc):

[mediawiki/core@master] LocalUserRegistrationProvider: Support remote users

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

Change #1199766 merged by jenkins-bot:

[mediawiki/core@master] LocalUserRegistrationProvider: Support remote users

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

Test wiki created on Patch demo by Wargo using patch(es) linked to this task:
https://59d618d48b.catalyst.wmcloud.org/w/

Test wiki on Patch demo by Wargo using patch(es) linked to this task was deleted:

https://59d618d48b.catalyst.wmcloud.org/w/