Page MenuHomePhabricator

extensions/Wikibase - Use UserGroupManager instead of User group methods
Closed, ResolvedPublic

Description

T275148: Prepare User group methods for hard deprecation will deprecate various user group methods, some of which WIkibase uses in tests

public function getGroups()
public function getGroupMemberships()
public function getEffectiveGroups()
public function getAutomaticGroups()
public function getFormerGroups()
public function addGroup()
public function removeGroup()
public function addAutopromoteOnceGroups()

(Check parent task to ensure this list is up to date)

https://codesearch.wmcloud.org/extensions/?q=(getGroups%7CgetGroupMemberships%7CgetEffectiveGroups%7CgetAutomaticGroups%7CgetFormerGroups%7CaddGroup%7CremoveGroup%7CaddAutopromoteOnceGroups)&i=nope&files=&excludeFiles=&repos=Extension:Wikibase,Extension:WikibaseLexeme,Extension:WikibaseManifest,Extension:WikibaseQualityConstraints

These will need to be replaced with corresponding UserGroupManager methods.
You can obtain UserGroupManager via MediaWikiServices::getInstance()->getUserGroupManager().

We should check in which MW versions the methods were introduced, as we want to keep master compatible with the latest 1_36 branch of MediaWiki.
If we need to create a compat layer this could be a good opportunity to also create an abstraction layer.

Acceptance Criteria:🏕️🌟

  • The methods listed to be deprecated are not used in Wikibase code.

Event Timeline

Addshore renamed this task from Use UserGroupManager instead of User group methods in Wikibase to extensions/Wikibase - Use UserGroupManager instead of User group methods.May 4 2021, 11:36 AM
Addshore updated the task description. (Show Details)
Addshore added subscribers: Vlad.shapik, jeena, Pchelolo.

I am going to work on the ticket.
The methods were introduced in 1.35 version. Since Wikibase extension requires 1.37+, I can easily replace uses of User group methods.

Vlad.shapik triaged this task as Medium priority.

Change 688924 had a related patch set uploaded (by Vlad.shapik; author: Vlad.shapik):

[mediawiki/extensions/Wikibase@master] Replace deprecated User group methods

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

Change 688924 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Replace deprecated User group methods

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

Vlad.shapik updated the task description. (Show Details)