Page MenuHomePhabricator

Remove the circular dependency between EntitySavingHelper/EntityLoadingHelper and Wikibase "Action API" classes
Closed, ResolvedPublic5 Estimated Story Points

Description

As of March 2021 EntitySavingHelper (and respectively its "parent" EntityLoadingHelper) class, which is meant as a "helper" service for API classes, knows - in the form of dependency - about the Action API "module" (i.e. PHP class) that uses the helper service.

This is not a good design: It creates a circular dependency. "Helper" service should not know where is being use - dependency should only be from API class depending on the service.

It seems that the "helper" classes use the API module to get some details about the API endpoint (apiModule->isWriteMode()), or to get the parameters of the particular API request (apiModule->extractRequestParams).

Acceptance criteria⛺✨ :

  • EntitySavingHelper and EntityLoadingHelper do not know about/do not depend on the API module that uses them. Dependency only goes from the API class to the "helper" service

Event Timeline

Change 682612 had a related patch set uploaded (by Michael Große; author: Michael Große):

[mediawiki/extensions/Wikibase@master] Remove circular dependency in API helper

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

Change 682664 had a related patch set uploaded (by Michael Große; author: Michael Große):

[mediawiki/extensions/Wikibase@master] Remove cyclic dependency from EntitySavingHelper

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

Change 682612 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Remove circular dependency in EntityLoadingHelper

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

Change 682664 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Remove circular dependency from EntitySavingHelper

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

Addshore added a subscriber: Addshore.

Glancing at the patches this looks good!