Page MenuHomePhabricator

Research to create service for DoubleRedirectJob::fixRedirects
Open, Needs TriagePublic

Description

The function DoubleRedirectJob::fixRedirects needs some services

https://codesearch.wmcloud.org/search/?q=DoubleRedirectJob&i=nope&files=&repos=

Event Timeline

Change 933899 had a related patch set uploaded (by D3r1ck01; author: Derick Alangi):

[mediawiki/core@master] DoubleRedirectJob: Inject appropriate service into job p.1

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

@Umherirrender, we have only 2 callers - https://codesearch.wmcloud.org/search/?q=DoubleRedirectJob%3A%3AfixRedirects&files=&excludeFiles=&repos=, I'm wondering if doing weak DI here is worth it? Since we always get a fresh instance from the global DI container and the method is static, should we still do this? Also, I've made a first parse to do a strong DI in the constructor for other methods within the class.

This task was created while injecting services into all special pages. Special:MovePage cannot give it's services to the DoubleRedirectJob as a static function is used. Maybe a service is to much, but it should be possible to inject services into that function and pass it to the job to avoid the global state.

Change 933899 merged by jenkins-bot:

[mediawiki/core@master] DoubleRedirectJob: Inject appropriate service into job p.1

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