Page MenuHomePhabricator

Get rid of $wg = $wmg hack for extensions that have been converted to using extension.json
Open, LowPublic

Description

The $wgFoo = $wmgFoo hack was needed for extensions because InitialiseSettings.php would run before extensions were loaded, so the extension defaults would overwrite the wanted values. But extension.json doesn't unconditionally set defaults if they're already set, so we don't need this hack anymore!

Example change: https://gerrit.wikimedia.org/r/#/c/237686/

This will reduce the amount of globals we use, and hopefully will help a little with T103886.

Details

Related Gerrit Patches:
operations/mediawiki-config : masterCommonSettings: Stop using wmg variables for Score extension
operations/mediawiki-config : masterUse extension registration for CategoryTree
operations/mediawiki-config : masterUse extension registration for GlobalBlocking
operations/mediawiki-config : masterUse extension registration for Gadgets
operations/mediawiki-config : masterUse extension registration for ProofreadPage
operations/mediawiki-config : masterUse extension registration for Quiz
operations/mediawiki-config : masterUse extension registration for MwEmbedSupport
operations/mediawiki-config : masterUse extension registration for SpamBlacklist
operations/mediawiki-config : masterUse extension registration for ExtensionDistributor
operations/mediawiki-config : masterUse extension registration for FundraisingTranslateWorkflow
operations/mediawiki-config : masterUse extension registration for TitleBlacklist
operations/mediawiki-config : masterUse extension registration for LabeledSectionTransclusion
operations/mediawiki-config : masterUse extension registration for SpamBlacklist
operations/mediawiki-config : masterUse extension registration for DoubleWiki
operations/mediawiki-config : masterUse extension registration for UnicodeConverter
operations/mediawiki-config : masterUse extension registration for Poem
operations/mediawiki-config : masterUse extension registration for DoubleWiki
operations/mediawiki-config : masterUse extension registration for SyntaxHighlight_GeSHi
operations/mediawiki-config : masterUse extension registration for ImageMap
operations/mediawiki-config : masterEnable extension registration for ParserFunctions
operations/mediawiki-config : masterEnable extension registration for InputBox
operations/mediawiki-config : masterUpdate extension-list for extension registration
operations/mediawiki-config : masterUse extension registration for Cite
operations/mediawiki-config : masterGet rid of $wg = $wmg for BetaFeatures
operations/mediawiki-config : masterUse extension registration for Math
operations/mediawiki-config : masterUse extension registration for Graph

Event Timeline

Legoktm created this task.Nov 19 2015, 8:43 PM
Legoktm raised the priority of this task from to Needs Triage.
Legoktm updated the task description. (Show Details)
Legoktm added subscribers: Legoktm, Krenair.
Restricted Application added subscribers: StudiesWorld, Matanya, Aklapper. · View Herald TranscriptNov 19 2015, 8:43 PM

so basically, we can just go convert all of these, if I'm understanding correctly?

Uh, you have to make sure the extension has been converted over to using extension.json first.

Change 266433 had a related patch set uploaded (by Dereckson):
Get rid of $wg = $wmg for Graph

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

Restricted Application added a subscriber: JEumerus. · View Herald TranscriptJan 25 2016, 11:09 PM
Dereckson added a subscriber: Dereckson.EditedJan 25 2016, 11:10 PM

@Legoktm Like this?

Ideally, we should deploy this change extension per extension to allow test with a disruption limited to at most one extension, shouldn't we?

Suggested methodology

  • Check the config section of the extension.json file
  • Determine in CommonSettings.php which ones are defined and use the hack, remove them
  • Rename wmg... in wg... in InitialiseSettings.php

@Legoktm Like this?

Looks good! At the same time, we should also change the require_once invocation to wfLoadExtension and update extension-list if they haven't been updated already.

Ideally, we should deploy this change extension per extension to allow test with a disruption limited to at most one extension, shouldn't we?

Agreed.

Change 266470 had a related patch set uploaded (by Dereckson):
Get rid of $wg = $wmg for BetaFeatures

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

Change 266433 merged by jenkins-bot:
Use extension registration for Graph

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

Change 268627 had a related patch set uploaded (by Dereckson):
Use extension registration for CategoryTree

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

Change 266470 merged by jenkins-bot:
Get rid of $wg = $wmg for BetaFeatures

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

Change 270145 had a related patch set uploaded (by Dereckson):
Use extension registration for Math

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

Change 270145 merged by jenkins-bot:
Use extension registration for Math

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

Change 279268 had a related patch set uploaded (by Dereckson):
Use extension registration for Cite

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

Change 279268 merged by jenkins-bot:
Use extension registration for Cite

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

Change 279371 had a related patch set uploaded (by Dereckson):
Enable extension registration for InputBox

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

Change 279372 had a related patch set uploaded (by Dereckson):
Enable extension registration for ParserFunctions

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

Change 279294 merged by jenkins-bot:
Update extension-list for extension registration

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

Change 279371 merged by jenkins-bot:
Enable extension registration for InputBox

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

Change 279372 merged by jenkins-bot:
Enable extension registration for ParserFunctions

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

Change 280223 had a related patch set uploaded (by Dereckson):
Use extension registration for ImageMap

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

Change 280224 had a related patch set uploaded (by Dereckson):
Use extension registration for SyntaxHighlight_GeSHi

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

Change 280225 had a related patch set uploaded (by Dereckson):
Use extension registration for DoubleWiki

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

Change 280226 had a related patch set uploaded (by Dereckson):
Use extension registration for Poem

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

Change 280227 had a related patch set uploaded (by Dereckson):
Use extension registration for UnicodeConverter

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

Change 280223 merged by jenkins-bot:
Use extension registration for ImageMap

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

Change 280224 merged by jenkins-bot:
Use extension registration for SyntaxHighlight_GeSHi

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

Change 280225 merged by jenkins-bot:
Use extension registration for DoubleWiki

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

Change 280226 merged by jenkins-bot:
Use extension registration for Poem

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

Change 280242 had a related patch set uploaded (by Dereckson):
Use extension registration for DoubleWiki

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

Change 280227 merged by jenkins-bot:
Use extension registration for UnicodeConverter

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

Change 280242 merged by jenkins-bot:
Use extension registration for DoubleWiki

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

Change 281237 had a related patch set uploaded (by Dereckson):
Use extension registration for LabeledSectionTransclusion

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

Change 281239 had a related patch set uploaded (by Dereckson):
Use extension registration for SpamBlacklist

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

Change 281240 had a related patch set uploaded (by Dereckson):
Use extension registration for TitleBlacklist

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

Change 281242 had a related patch set uploaded (by Dereckson):
Use extension registration for Quiz

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

Change 281243 had a related patch set uploaded (by Dereckson):
Use extension registration for FundraisingTranslateWorkflow

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

Change 281244 had a related patch set uploaded (by Dereckson):
Use extension registration for Gadgets

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

Change 281246 had a related patch set uploaded (by Dereckson):
Use extension registration for MwEmbedSupport

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

Change 281303 had a related patch set uploaded (by Dereckson):
Use extension registration for ExtensionDistributor

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

Change 281311 had a related patch set uploaded (by Dereckson):
Use extension registration for GlobalBlocking

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

Change 281976 had a related patch set uploaded (by Dereckson):
Use extension registration for ProofreadPage

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

Dereckson moved this task from Working on to Backlog on the Wikimedia-Site-requests board.EditedApr 14 2016, 1:14 PM

We've a backlog of changes to merge.

I've moved back to the backlog as anybody can take one of the dozens remaining extension include to migrate.

Urbanecm moved this task from Working on to Backlog on the Wikimedia-Site-requests board.

Change 281239 merged by jenkins-bot:
Use extension registration for SpamBlacklist

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

Mentioned in SAL [2016-06-01T23:49:49Z] <dereckson@tin> Synchronized wmf-config/CommonSettings.php: Use extension registration for SpamBlacklist (T119117) (duration: 00m 24s)

Mentioned in SAL [2016-06-01T23:51:30Z] <dereckson@tin> Synchronized wmf-config/CommonSettings.php: Revert Use extension registration for SpamBlacklist (T119117) (duration: 00m 24s)

Change 292312 had a related patch set uploaded (by Dereckson):
Use extension registration for SpamBlacklist

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

Change 281237 merged by jenkins-bot:
Use extension registration for LabeledSectionTransclusion

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

Mentioned in SAL [2016-06-30T15:53:33Z] <thcipriani@tin> Synchronized wmf-config: SWAT: [[gerrit:281237|Use extension registration for LabeledSectionTransclusion (T119117)]] (duration: 00m 27s)

Change 281240 merged by jenkins-bot:
Use extension registration for TitleBlacklist

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

Mentioned in SAL [2016-06-30T16:15:43Z] <thcipriani@tin> Synchronized wmf-config/InitialiseSettings.php: SWAT: [[gerrit:281240|Use extension registration for TitleBlacklist (T119117)]] PART I (duration: 00m 39s)

Mentioned in SAL [2016-06-30T16:16:51Z] <thcipriani@tin> Synchronized wmf-config: SWAT: [[gerrit:281240|Use extension registration for TitleBlacklist (T119117)]] PART II (duration: 00m 36s)

greg added a subscriber: greg.Jul 26 2016, 3:19 PM
Ltrlg added a subscriber: Ltrlg.Jul 28 2016, 4:53 PM

Change 281243 merged by jenkins-bot:
Use extension registration for FundraisingTranslateWorkflow

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

Change 292312 merged by jenkins-bot:
Use extension registration for SpamBlacklist

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

Change 281303 merged by jenkins-bot:
Use extension registration for ExtensionDistributor

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

Change 281246 merged by jenkins-bot:
Use extension registration for MwEmbedSupport

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

Change 281242 merged by jenkins-bot:
Use extension registration for Quiz

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

Change 281976 merged by jenkins-bot:
Use extension registration for ProofreadPage

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

Change 281244 merged by jenkins-bot:
Use extension registration for Gadgets

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

Change 281311 merged by jenkins-bot:
Use extension registration for GlobalBlocking

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

Change 268627 merged by jenkins-bot:
Use extension registration for CategoryTree

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

Change 502269 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[operations/mediawiki-config@master] Stop using wmg variables for Score extension

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

Change 502269 merged by jenkins-bot:
[operations/mediawiki-config@master] CommonSettings: Stop using wmg variables for Score extension

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