Page MenuHomePhabricator

Allow WikiPageEntityRevisionLookup to work with foreign repos
Closed, ResolvedPublic

Description

WikiPageEntityRevisionLookup loads entity data directly from a mediawiki database. It already supports accessign a "foreign" wiki database (not the local wiki). It now needs to support foreign entity IDs. To achieve this, we must do two things:

  • check that the EntityId used to request the desired entity revision belongs to the correct repository. That is, EntityId::getRepositoryName should return the name of the repo to corresponds to the database name used by the WikiPageEntityRevisionLookup. Note that repo name and database name are usually but not necessarily the same. We can assume that the repo name is the same as the global site ID. Note: checking this should happen already in WikiPageEntityMetaDataAccessor.
  • the factory logic that instantiates the WikiPageEntityRevisionLookup must make sure to provide a EntityContentDataCodec that uses a Deserializer that is configured to apply the correct ID prefix mapping for the given foreign repo. We may want to introduce a ForeignEntityRevisionLookupFactory for this purpose, which can be used to acquire an EntityRevisionLookup for a given repo. Creating that interface should be tracked in a separate task.

Related Objects

StatusSubtypeAssignedTask
Declineddchen
OpenNone
OpenNone
DuplicateNone
OpenFeatureNone
OpenFeatureNone
DuplicateNone
ResolvedNone
ResolvedNone
ResolvedNone
OpenNone
OpenNone
StalledNone
ResolvedLydia_Pintscher
ResolvedLydia_Pintscher
ResolvedLydia_Pintscher
ResolvedLydia_Pintscher
ResolvedWMDE-leszek
ResolvedWMDE-leszek
ResolvedWMDE-leszek

Event Timeline

daniel triaged this task as Medium priority.Oct 31 2016, 4:12 PM

Change 319321 had a related patch set uploaded (by WMDE-leszek):
Check if the EntityId belongs to the right repository in WikiPageEntityRevisionLookup

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

Change 320588 had a related patch set uploaded (by WMDE-leszek):
Strip foreign repository prefix when looking up an entity revision in WikiPageEntityRevisionLookup

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

While discussing https://gerrit.wikimedia.org/r/#/c/319321 @thiemowmde suggested to move checking that entity id belongs to the repository the lookup instance has been configured for down to WikiPageEntityMetaDataAccessor, instead of doing it in WikiPageEntityRevisionLookup.
We will do it as suggested. Note: I think this check should be only in "first-level" implementations of WikiPageEntityMetaDataAccessor interface, ie. in WikiPageEntityMetaDataLookup but not in PrefetchingWikiPageEntityMetaDataAccessor.

Change 319321 merged by jenkins-bot:
Check if the EntityId belongs to the right repository in WikiPageEntityMetaDataLookup

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

Change 320588 merged by jenkins-bot:
Strip foreign repository prefix when looking up an entity revision in WikiPageEntityMetaDataLookup

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