EntityChange::setRevisionInfo uses EntityContent. EntityChangeTest even constructs an ItemContent, which executes a substantial amount of code in WikibaseRepo.
Version: master
Severity: normal
EntityChange::setRevisionInfo uses EntityContent. EntityChangeTest even constructs an ItemContent, which executes a substantial amount of code in WikibaseRepo.
Version: master
Severity: normal
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Declined | None | T75863 [Task] Split wikibase.git | |||
Open | None | T75643 EntityChange in lib depends on EntityContent in repo |
Noted this in the last code review thing: https://wmde.github.io/code-analysis/Wikidata/2014-MarchReview/slides/#/6/2
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.