Page MenuHomePhabricator

EntityChange in lib depends on EntityContent in repo
Open, MediumPublic

Description

EntityChange::setRevisionInfo uses EntityContent. EntityChangeTest even constructs an ItemContent, which executes a substantial amount of code in WikibaseRepo.


Version: master
Severity: normal

Details

Reference
bz73643

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:56 AM
bzimport set Reference to bz73643.
bzimport added a subscriber: Unknown Object (MLST).
Lydia_Pintscher removed a subscriber: Unknown Object (MLST).
Lydia_Pintscher removed a subscriber: Unknown Object (MLST).Dec 1 2014, 2:29 PM
Lydia_Pintscher set Security to None.
Lydia_Pintscher added subscribers: daniel, aude, JanZerebecki.

This is still true, and definitely needs fixing.

Seems like task has incomplete description.
I cannot understand what the problem is and also what needs to be changed and how.
Can anyone provide more info?

@Aleksey_WMDE, the problem is this line: https://phabricator.wikimedia.org/diffusion/EWBA/browse/master/lib/includes/Changes/EntityChange.php;52253d5b116df36849b2c44f787cbe3f256fedd2$201 This is code in lib, but it type hints against EntityContent and calls EntityContent::getEntityId, which is code in repo. This means lib depends on repo, right?

My 2¢ on this: ChangeFactory should be split into a general factory in lib (defining the newForChangeType methods), and a RepoChangeFactory in the repo component, that has knowledge about EntityContent, Revision, etc. Any code that needs services or knowledge about repo concepts should be extracted into RepoChangeFactory.