Page MenuHomePhabricator

[Task] Replace base classes ApiWikibase, ModifyEntity, ModifyClaim, etc. with composable objects.
Closed, DeclinedPublic

Description

Our API modules depend on subclassing for common operations. This makes it hard to mix and match, and makes it virtually impossible to mock all services used by a given API module (see T57516).

To fix this, we should create helper classes for specific aspects of API operations (e.g. finding entities, saving entities, etc), and use them in the concrete modules via composition.

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:27 AM
bzimport set Reference to bz69001.
bzimport added a subscriber: Unknown Object (MLST).
Lydia_Pintscher removed a subscriber: Unknown Object (MLST).
Lydia_Pintscher removed a subscriber: Unknown Object (MLST).

Change 222928 had a related patch set (by Addshore) published:
Get rid of ApiWikibase!!!!

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

Change 222928 merged by jenkins-bot:
Get rid of ApiWikibase!!!!

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

Jonas renamed this task from Replace base classes ApiWikibase, ModifyEntity, ModifyClaim, etc. with composable objects. to [Task] Replace base classes ApiWikibase, ModifyEntity, ModifyClaim, etc. with composable objects..Aug 13 2015, 10:28 AM
Jonas updated the task description. (Show Details)
Jonas set Security to None.
Jonas subscribed.

Is this done?

Nope, ApiWikibase is gone.
ModifyEntity and ModifyClaim still exist

Change 232045 had a related patch set uploaded (by Addshore):
Push isWriteMode and needsToken methods down the API

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

Change 232052 had a related patch set uploaded (by Addshore):
WIP Kill ModifyClaim base class

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

Change 232045 merged by jenkins-bot:
Push isWriteMode and needsToken methods down the API

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

Change 232052 abandoned by Addshore:
WIP Kill ModifyClaim base class

Reason:
It will be easier to start a fresh patch to achieve this in the future...

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

Change 266798 had a related patch set uploaded (by Addshore):
Kill ModifyClaim base class

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

Once the above patch is merged only ModifyEntity will remain...

Change 266798 merged by jenkins-bot:
Kill ModifyClaim base class

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

We will progressively move away from the old Action API toward a REST API which will be constructed differently.