Page MenuHomePhabricator

Merge wikibase.api.RepoApi and wikibase.api.getLocationAgnosticMwApi
Closed, ResolvedPublic

Description

They are being depend on a lot (basically everywhere) but their dependencies are the same. Since this is in lib, the improvement will be pretty big.

Details

Related Gerrit Patches:
mediawiki/extensions/Wikibase : masterDrop getLocationAgnosticMwApi
mediawiki/extensions/WikibaseLexeme : masterDrop getLocationAgnosticMwApi
mediawiki/extensions/WikibaseMediaInfo : masterUse wikibase.api.RepoApi instead of getLocationAgnosticMwApi
mediawiki/extensions/Wikibase : masterAdd getLocationAgnosticMwApi to wikibase.api.RepoApi

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 18 2019, 1:06 PM

Change 538056 had a related patch set uploaded (by Ladsgroup; owner: Ladsgroup):
[mediawiki/extensions/Wikibase@master] Add getLocationAgnosticMwApi to wikibase.api.RepoApi

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

Change 538058 had a related patch set uploaded (by Ladsgroup; owner: Ladsgroup):
[mediawiki/extensions/WikibaseLexeme@master] Drop getLocationAgnosticMwApi

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

Change 538060 had a related patch set uploaded (by Ladsgroup; owner: Ladsgroup):
[mediawiki/extensions/WikibaseMediaInfo@master] Use wikibase.api.RepoApi instead of getLocationAgnosticMwApi

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

Change 538061 had a related patch set uploaded (by Ladsgroup; owner: Ladsgroup):
[mediawiki/extensions/Wikibase@master] Drop getLocationAgnosticMwApi

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

Ladsgroup moved this task from Backlog to Peer Review on the RL Module Terminators Trailblazing board.
Restricted Application added a project: User-Ladsgroup. · View Herald TranscriptSep 19 2019, 5:06 PM

Change 538056 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Add getLocationAgnosticMwApi to wikibase.api.RepoApi

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

Change 538058 merged by jenkins-bot:
[mediawiki/extensions/WikibaseLexeme@master] Drop getLocationAgnosticMwApi

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

Change 538060 merged by jenkins-bot:
[mediawiki/extensions/WikibaseMediaInfo@master] Use wikibase.api.RepoApi instead of getLocationAgnosticMwApi

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

Change 538061 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Drop getLocationAgnosticMwApi

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

Ladsgroup closed this task as Resolved.Oct 4 2019, 10:59 AM

I was using this RL and it just got disappear and broke gadgets that use it.
This breaks again wikidata usage, after "wikibase.client.getMwApiForRepo" was removed not long ago.

For the next refactor - I suggest to first defined the end goal - so all gadgets can adapt to it and properly announce it.

I understand this might be frustrating but there are some points to consider:

  • you should avoid depending on the wikibase frontend code (according to public interface policy, they are considered unstable and prone to change at any time without prior warning). You should depend on hooks instead and if the hook for what you want doesn't exist, make a ticket and we address it.
  • These changes are important for performance on network level (just this ticket, drops 30 GB/day. TBs for users every month). Cleaner RL modules makes the code more understandable to outside users (and provide tighter encapsulation) and even it reduces the time to load every item in wikidata (I estimate it will be between half a second to a second in total in every page view).
  • I understand the request for providing end results beforehand but the problem with this enormous codebase is that it was impossible to get end results (or goals) when we started. The dependency graph of the modules when we started was this:


(click on it to see, 4MB)
It was so complicated that we ended up writing graph analysis tools to find dead modules, unused modules, "entry point" modules or modules that can be merged. We continue to make it better but the graph is slightly cleaner now but we still try to merge a module and we end up not doing it.
HTH

Thanks Amir for the explanation. I understand the reason for refactoring the Wikibase modules, and this is good direction in general.

I just ask for a stable way to access wikibase so it won't break every few weeks, and hooks aren't solution for wikibase clients. I opened a separate task T235913 to avoid off topic discussion here.

Maintenance_bot moved this task from In progress to Done on the User-Ladsgroup board.