Page MenuHomePhabricator

RepoLinker should use an EntityTitleLookup to determin the URL for a given EntityId
Closed, ResolvedPublic

Description

For consistency in general, and to support foreign EntityIds specifically, RepoLinker should use a EntityTitleLookup, instead of relying on a namespace map.

When implementing this, please check if we can drop some of the client settings, such as 'repoNamespaces' or 'repoArticlePath'.

Related Objects

Event Timeline

Would this link to Special:EntityPage or would the EntityTitleLookup have a way to fetch entity namespace mappings from the repo(s) instead of configuring in the client? or other way to resolve the links? Not sure we will always have a corresponding namespace for each entity type or other ways to resolve titles for some entity types?

repoArticlePath etc. could come from the Site object for the repo, via SiteLookup, and would only need to be fetched once. (maybe still with the option of directly getting these from configs to bypass lookup, for performance reasons, and fallback to getting these from site lookup for site ids not configured)

@aude I really want to get rid of the need for clients to know about repo namespaces. I think we can do this with T153499: Create Special:EntityPage to allow addressing entity pages without knowing the appropriate namespace .

As to other per-repo config: we have the new foreignRepos setting. That's where all this info should go for now. Some of it could be taken from or moved to Sites. I'm still not sure whether I'd want to put *everything* into the site store, or whether it's better to keep extension specific per-site information separate.

Change 358365 had a related patch set uploaded (by Ladsgroup; owner: Amir Sarabadani):
[mediawiki/extensions/Wikibase@master] Link to Special:EntityData instead of getting namespace settings in RepoLinker

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

The patch still needs some work but I will get it done soon.

Patch looks good, needs manual verification.

Change 358365 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Link to Special:EntityPage instead of getting namespace settings in RepoLinker

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

Result maybe be desired in the end but with https://gerrit.wikimedia.org/r/358365 RepoLinker still does not use EntityTitleLookup, so I was not sure if this is now done, or is there still some work left.
If you say it's now all done, then cool!

I was about to comment and say "feel free to reopen if you think we need the implementation" I agree it'd be nice but not sure if we should do it now.