Page MenuHomePhabricator

Move WikibaseRepo ItemLookup to service container
Closed, ResolvedPublic

Description

Can be done after T278926: Move WikibaseRepo EntityLookup to service container, and will need similar backwards compatibility for the $cacheMode argument as in that task, I assume.

Event Timeline

Well…

  • getItemLookup() is called:
    • twice with LOOKUP_CACHING_RETRIEVE_ONLY
    • never with LOOKUP_CACHING_ENABLED (the default)
  • getPropertyLookup() is called:
    • twice with LOOKUP_CACHING_RETRIEVE_ONLY
    • once with LOOKUP_CACHING_DISABLED
    • once with LOOKUP_CACHING_ENABLED (the default)

So it seems kind of pointless to move a default version of the ItemLookup service to the service container when that default version is never used – and really, both of those services are barely used at all.

And seeing as they’re both very simple wrappers around EntityLookup (using the LegacyAdapterItemLookup and LegacyAdapterPropertyLookup classes, respectively), maybe the easiest way forward is to just inline those methods into their few callers, and have those callers create those wrappers directly?

(We could also maybe reconsider if we really need those ItemLookup and EntityLookup interfaces separate from EntityLookup, but that’s a topic for another day, I think.)

Result from a call with @ItamarWMDE: yes, let’s inline getItemLookup() and getPropertyLookup().

Change 677612 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] repo: remove getItemLookup() from WikibaseRepo

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

Change 677615 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] repo: remove getPropertyLookup() from WikibaseRepo

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

Change 677612 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] repo: remove getItemLookup() from WikibaseRepo

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