Page MenuHomePhabricator

[Federated Values] Investigate if we can merge getEntity and fetchEntity
Closed, ResolvedPublicSpike

Description

Description

Presently, the RemoteEntityLookup class (implemented in repo/includes/RemoteEntity/RemoteEntityLookup.php) includes both a fetchEntity($conceptUri) method and a getEntity($conceptUri) method. fetchEntity fetches the value (first checking the local cache, then fetching from remote) without saving it to the local cache. getEntity fetches the value (first checking the local cache, then fetching from remote) and then saves it to the local cache.

Obviously, there is some overlapping code that could be replaced with a call to fetchEntity from within getEntity, but the question is do we need fetchEntity at all? Is RemoteEntityLookup following suit to some other lookup class that also implements both? Or can we (please) just do something like getEntity($conceptUri, bool $save = false)?

Acceptance Criteria

  • Investigate and answer the above questions
  • Write a follow-up implementation ticket

Event Timeline

conny-kawohl_WMDE renamed this task from [Spike] Investigate if we can merge getEntity and fetchEntity to [Federation] Investigate if we can merge getEntity and fetchEntity.Mar 6 2026, 11:45 AM
conny-kawohl_WMDE edited projects, added Federation; removed Wikibase Suite Team.
RickiJay-WMDE renamed this task from [Federation] Investigate if we can merge getEntity and fetchEntity to [Spike] Investigate if we can merge getEntity and fetchEntity.Mar 6 2026, 11:49 AM
RickiJay-WMDE updated the task description. (Show Details)
Leif_WMDE renamed this task from [Spike] Investigate if we can merge getEntity and fetchEntity to [Federation] Investigate if we can merge getEntity and fetchEntity.Mar 11 2026, 6:16 PM
Leif_WMDE changed the subtype of this task from "Task" to "Spike".

Update: T419792 involved tweaking the getEntity function anyway, so I implemented this change

We fully can - implemented as part of T419792

Leif_WMDE renamed this task from [Federation] Investigate if we can merge getEntity and fetchEntity to [Federated Values] Investigate if we can merge getEntity and fetchEntity.Thu, Apr 16, 8:29 AM