Page MenuHomePhabricator

Clean up MobileSite services
Open, Needs TriagePublic

Description

In the context of T324991: Make Wikibase not rely on the ResourceLoader target system, we added new services WikibaseClient.MobileSite/WikibaseRepo.MobileSite and used them statically throughout Wikibase. This was done for the sake of a fast feedback cycle on this. We should revisit these places and properly inject them, as well as covering them by tests where applicable.
Also, the tests for these services should exercise them properly.

Acceptance criteria:

  • The services are injected with Dependency Injection as usual everywhere
  • The services are unit-tested with all code paths/branches exercised and asserted

Event Timeline

Michael renamed this task from Inject MobileSite services to Clean up MobileSite services.May 9 2023, 12:10 PM
Michael updated the task description. (Show Details)

Change 917869 had a related patch set uploaded (by Michael Große; author: Michael Große):

[mediawiki/extensions/Wikibase@master] Expand ServiceWiringTestCase to cover ->has('Service.Name') as well

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

Wikibase*.MobileSite should be used at most as a temporary stopgap measure (although I’m still not convinced it should be used at all). Instead of spending effort on refactoring the code, effort should be spent on removing calls to it, at least in the vast majority of cases. If there are a few cases here and there that should really depend on the MobileFrontend status, and not on the skin, not on the actual device properties like screen size or input method, not on anything else (which I doubt), those may need to be refactored.

Change 928850 had a related patch set uploaded (by Michael Große; author: Michael Große):

[mediawiki/extensions/Wikibase@master] Add tests for MobileSite service on both client and repo

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

Change 928853 had a related patch set uploaded (by Michael Große; author: Michael Große):

[mediawiki/extensions/Wikibase@master] Inject Wikibase.MobileView service instead of static calls

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

Change 917869 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Expand ServiceWiringTestCase to cover ->has('Service.Name') as well

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

Change 928850 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Add tests for MobileSite service on both client and repo

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

Change 928853 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Inject Wikibase.MobileView service instead of static calls

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