Page MenuHomePhabricator

Update Maintenance scripts in extensions to use $this->requireExtension()
Open, NormalPublic

Description

Maintenance scripts from extensions are special in that they can be run from the CLI without the extension ever being enabled, causing weird issues. We created $this->requireExtension('ExtensionName') for that (it goes in the constructor, and is checked after extensions are loaded). Only a few scripts have been updated to use it though.

Documentation: https://www.mediawiki.org/wiki/Manual:Writing_maintenance_scripts#Extensions

Example commit: rECRE62b0bc4fe579: Set extension dependency in maintenance scripts

Name of MediaWiki extensionAssignee to work on it
AbuseFilterPppery
AntiSpoofPppery
ArticleFeedbackv5@subins2000
Athena@subins2000
BlockAndNuke@subins2000
BlueSpiceExtendedSearch@subins2000 @Osnard
BlueSpiceExtensions@RazeSoldier
BlueSpiceFoundation@RazeSoldier
Cargo@IvanFon
CentralAuth@subins2000
CentralNotice@Georggi199
CheckUserPppery
Cognate@Zoranzoki21
CollapsibleVector@RazeSoldier
ConfirmEdit@divadsn
ContentTranslation@Zoranzoki21
Contributors@FilipGCI
CreditsSource@FilipGCI
DisableAccount@RazeSoldier
DonationInterface@Zoranzoki21
Echo@MtDu
EditAccount@Jayprakash12345
ExtensionDistributor@Jayprakash12345
Flow@Phantom42
GeoData@FilipGCI
GlobalBlocking@Jayprakash12345
GlobalCssJsAlready done. See https://pastebin.com/G1u5yy5W
GlobalUsage@Jayprakash12345
HitCounters@Jayprakash12345
LocalisationUpdate@Jayprakash12345
MassMessage@RazeSoldier
Math@IvanFon
MathSearch@Phantom42
Newsletter@Phantom42
OATHAuth@MtDu
OAuth@divadsn
ORES@Zoranzoki21
PagedTiffHandler@Zoranzoki21
PageImages@Zoranzoki21
Renameuser@Jayprakash12345
ReplaceText@Jayprakash12345
SecurePoll@Jayprakash12345
ShortUrl@RazeSoldier
SyntaxHighlight_GeSHi@Zoranzoki21
TitleKey@Jayprakash12345
TorBlock@divadsn
TranslationNotifications@Jayprakash12345
UniversalLanguageSelectorPer source of code it is already done.
UploadWizard@Zoranzoki21
UrlShortener@MtDu
VisualEditor@IvanFon
wikihiero@MaxSem
ProofreadPage@Jayprakash12345
BibManager@Jayprakash12345
SecureSessions@Jayprakash12345
PluggableSSO@Jayprakash12345
StopForumSpam@Jayprakash12345
WikibaseLexeme@Jayprakash12345
CongressLookup@Jayprakash12345
WikimediaMaintenance@Phantom42

Following Extensions are in awaiting, this can be done once they will Extension registration.

Name of MediaWiki extensionAssignee to work on it
GWToolset
WikiLexicalData
RevisionCommentSupplement
CirrusSearch
CommonMessages
Configure
OpenID
SemanticTasks
SimpleFarm
SphinxSearch
Teahouse
TimedMediaHandler
UserGroups
Wikibase

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Change 406520 had a related patch set (by Jayprakash12345) published:
[mediawiki/extensions/HitCounters@master] Update maintenance scripts to use $this->requireExtension

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

Zoranzoki21 triaged this task as Normal priority.Jan 28 2018, 7:30 PM
Zoranzoki21 updated the task description. (Show Details)
IvanFon removed a subscriber: IvanFon.Jan 28 2018, 7:34 PM

Change 406521 had a related patch set (by Jayprakash12345) published:
[mediawiki/extensions/ProofreadPage@master] Update maintenance scripts to use $this->requireExtension

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

Change 406522 had a related patch set (by Jayprakash12345) published:
[mediawiki/extensions/BibManager@master] Update maintenance scripts to use $this->requireExtension

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

Change 406521 merged by jenkins-bot:
[mediawiki/extensions/ProofreadPage@master] Update maintenance scripts to use $this->requireExtension

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

Jayprakash12345 added a subscriber: IvanFon.
Jayprakash12345 removed a subscriber: IvanFon.

Change 406519 merged by jenkins-bot:
[mediawiki/extensions/UploadWizard@master] Update Maintenance scripts in extensions to use $this->requireExtension()

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

Change 406522 merged by jenkins-bot:
[mediawiki/extensions/BibManager@master] Update maintenance scripts to use $this->requireExtension

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

Change 406520 merged by jenkins-bot:
[mediawiki/extensions/HitCounters@master] Update maintenance scripts to use $this->requireExtension

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

Change 406526 had a related patch set (by Jayprakash12345) published:
[mediawiki/extensions/EditAccount@master] Update maintenance scripts to use $this->requireExtension

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

Jayprakash12345 added a subscriber: IvanFon.
Zoranzoki21 updated the task description. (Show Details)Jan 28 2018, 9:25 PM

Change 406527 had a related patch set uploaded (by Zoranzoki21; owner: Zoranzoki21):
[mediawiki/extensions/DonationInterface@master] Update Maintenance scripts in extensions to use $this->requireExtension()

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

Zoranzoki21 updated the task description. (Show Details)Jan 28 2018, 9:34 PM

Change 406529 had a related patch set uploaded (by Zoranzoki21; owner: Zoranzoki21):
[mediawiki/extensions/ContentTranslation@master] Update Maintenance scripts in extensions to use $this->requireExtension()

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

Change 406526 merged by jenkins-bot:
[mediawiki/extensions/EditAccount@master] Update maintenance scripts to use $this->requireExtension

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

@Legoktm Anything else in this. Or Should be now closed.

Change 406527 merged by jenkins-bot:
[mediawiki/extensions/DonationInterface@master] Update Maintenance scripts in extensions to use $this->requireExtension()

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

Change 406529 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] Update Maintenance scripts in extensions to use $this->requireExtension()

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

Change 406518 merged by jenkins-bot:
[mediawiki/extensions/ReplaceText@master] Update maintenance scripts to use $this->requireExtension

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

Change 406637 had a related patch set uploaded (by Umherirrender; owner: Umherirrender):
[mediawiki/extensions/EducationProgram@master] Use $this->requireExtension() in maintenance scripts

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

Change 406639 had a related patch set uploaded (by Umherirrender; owner: Umherirrender):
[mediawiki/extensions/GettingStarted@master] Use $this->requireExtension() in maintenance scripts

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

Change 406650 had a related patch set uploaded (by Umherirrender; owner: Umherirrender):
[mediawiki/extensions/PageTriage@master] Use $this->requireExtension() in maintenance scripts

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

Change 406651 had a related patch set uploaded (by Umherirrender; owner: Umherirrender):
[mediawiki/extensions/ReadingLists@master] Use $this->requireExtension() in maintenance scripts

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

Change 406652 had a related patch set uploaded (by Umherirrender; owner: Umherirrender):
[mediawiki/extensions/PropertySuggester@master] Use $this->requireExtension() in maintenance scripts

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

Change 406764 had a related patch set uploaded (by Umherirrender; owner: Umherirrender):
[mediawiki/extensions/WikibaseQualityConstraints@master] Use $this->requireExtension() in maintenance scripts

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

Change 406651 merged by jenkins-bot:
[mediawiki/extensions/ReadingLists@master] Use $this->requireExtension() in maintenance scripts

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

Change 406639 merged by jenkins-bot:
[mediawiki/extensions/GettingStarted@master] Use $this->requireExtension() in maintenance scripts

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

Change 406764 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Use $this->requireExtension() in maintenance scripts

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

Change 406854 had a related patch set uploaded (by Umherirrender; owner: Umherirrender):
[mediawiki/extensions/CirrusSearch@master] Use $this->requireExtension() in maintenance scripts

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

Change 406854 abandoned by Umherirrender:
Use $this->requireExtension() in maintenance scripts

Reason:
No extension.json yet - T87892

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

Change 406652 merged by jenkins-bot:
[mediawiki/extensions/PropertySuggester@master] Use $this->requireExtension() in maintenance scripts

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

Change 406650 merged by jenkins-bot:
[mediawiki/extensions/PageTriage@master] Use $this->requireExtension() in maintenance scripts

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

Change 406637 merged by jenkins-bot:
[mediawiki/extensions/EducationProgram@master] Use $this->requireExtension() in maintenance scripts

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

Change 407062 had a related patch set (by Jayprakash12345) published:
[mediawiki/extensions/ApprovedRevs@master] Update maintenance scripts to use $this->requireExtension

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

Change 407066 had a related patch set (by Jayprakash12345) published:
[mediawiki/extensions/ArticleFeedbackv5@master] Correct Update maintenance scripts to use $this->requireExtension

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

Change 407121 had a related patch set (by Jayprakash12345) published:
[mediawiki/extensions/BlueSpiceAvatars@master] Correct Update maintenance scripts to use $this->requireExtension

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

Change 407122 had a related patch set (by Jayprakash12345) published:
[mediawiki/extensions/BlueSpiceSMWConnector@master] Update maintenance scripts to use $this->requireExtension

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

Change 407062 merged by jenkins-bot:
[mediawiki/extensions/ApprovedRevs@master] Update maintenance scripts to use $this->requireExtension

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

Change 407193 had a related patch set (by Jayprakash12345) published:
[mediawiki/extensions/NSFileRepo@master] Use $this->requireExtension() in maintenance scripts

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

Change 407122 merged by jenkins-bot:
[mediawiki/extensions/BlueSpiceSMWConnector@master] Update maintenance scripts to use $this->requireExtension

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

Change 407121 merged by jenkins-bot:
[mediawiki/extensions/BlueSpiceAvatars@master] Correct Update maintenance scripts to use $this->requireExtension

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

Jayprakash12345 added a comment.EditedFeb 1 2018, 2:03 PM
jay@Jay MINGW64 ~/extensions
$ grep -R "extends Maintenance" | cut -d'/' -f1 | sort -n | uniq -c
      2 AbuseFilter
      1 AntiSpoof
      1 ApprovedRevs
      4 ArticleFeedbackv5
     10 Athena
      2 BibManager
      1 BlockAndNuke
      1 BlueSpiceAvatars
      2 BlueSpiceExtendedSearch
      6 BlueSpiceFoundation
      2 BlueSpiceSMWConnector
      1 BounceHandler
      3 Cargo
     19 CentralAuth
      1 CentralNotice
      2 CheckUser
     18 CirrusSearch
      1 cldr
      8 CodeReview
      4 Cognate
      1 CollapsibleVector
      1 CommonMessages
      5 Configure
      3 ConfirmEdit
      4 CongressLookup
      3 ContentTranslation
      1 ContributionReporting
      1 Contributors
      1 CreditsSource
      1 DisableAccount
      5 DonationInterface
      7 Echo
      1 EditAccount
      1 EducationProgram
      1 ExtensionDistributor
      1 ExternalArticles
     11 FlaggedRevs
     14 Flow
      1 GeoData
      1 GlobalBlocking
      1 GlobalCssJs
      1 GlobalUsage
      1 GWToolset
      1 HitCounters
      1 LocalisationUpdate
      1 MassMessage
      1 Math
     14 MathSearch
      2 Newsletter
      3 NSFileRepo
      2 OATHAuth
      1 OAuth
      1 OpenID
      8 OpenStackManager
      1 OracleTextSearch
      6 ORES
      1 PageAssessments
      1 PagedTiffHandler
      1 PageImages
      5 PageTriage
      1 PluggableSSO
      1 PropertySuggester
      3 ReadingLists
      2 Renameuser
      1 ReplaceText
      3 RevisionCommentSupplement
      1 SecurePoll
      1 SecureSessions
      1 SemanticTasks
      1 ShortUrl
      1 SimpleFarm
      1 SphinxSearch
      1 StopForumSpam
      2 SyntaxHighlight_GeSHi
      1 Teahouse
      1 TimedMediaHandler
      1 TitleKey
      1 TorBlock
     24 Translate
      2 TranslationNotifications
      4 UniversalLanguageSelector
      1 UploadWizard
      1 UrlShortener
      1 UserGroups
      1 VisualEditor
     15 Wikibase
      1 WikibaseLexeme
      2 WikibaseQualityConstraints
      1 WikibaseQualityExternalValidation
     18 Wikidata
      5 WikiLexicalData
     33 WikimediaMaintenance

Change 407066 merged by Umherirrender:
[mediawiki/extensions/ArticleFeedbackv5@master] Correct Update maintenance scripts to use $this->requireExtension

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

Change 407193 merged by Umherirrender:
[mediawiki/extensions/NSFileRepo@master] Use $this->requireExtension() in maintenance scripts

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

Change 409294 had a related patch set (by Jayprakash12345) published:
[mediawiki/extensions/SecureSessions@master] Use $this->requireExtension() in maintenance scripts

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

Change 409296 had a related patch set (by Jayprakash12345) published:
[mediawiki/extensions/PluggableSSO@master] Use $this->requireExtension() in maintenance scripts

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

Change 409299 had a related patch set (by Jayprakash12345) published:
[mediawiki/extensions/StopForumSpam@master] Use $this->requireExtension() in maintenance scripts

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

Change 409300 had a related patch set (by Jayprakash12345) published:
[mediawiki/extensions/WikibaseLexeme@master] Use $this->requireExtension() in maintenance scripts

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

Change 409303 had a related patch set (by Jayprakash12345) published:
[mediawiki/extensions/CongressLookup@master] Use $this->requireExtension() in maintenance scripts

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

Jayprakash12345 updated the task description. (Show Details)

I have a question. Maintenance::requireExtension() is used to load the extension. But how does it load the extension? Via extension.json?

I saw this manual.

This will only work for extensions that use extension.json.

So should RevisionCommentSupplement extension be ruled out? This extension does not have extension.json.

TheDJ added a subscriber: TheDJ.Feb 9 2018, 1:04 PM

This will only work for extensions that use extension.json.

So should RevisionCommentSupplement extension be ruled out? This extension does not have extension.json.

Not necessarily, but it does mean that fixing it will be blocked, until the point that that extension is converted to make use of extension.json

TheDJ added a comment.Feb 9 2018, 1:05 PM

I have a question. Maintenance::requireExtension() is used to load the extension. But how does it load the extension? Via extension.json?

LocalSettings.php is responsible for loading extensions. The extension cannot force an extension to be loaded.

I understand why these extensions are placed at the end of the description.

Change 409299 merged by jenkins-bot:
[mediawiki/extensions/StopForumSpam@master] Use $this->requireExtension() in maintenance scripts

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

Change 409296 merged by jenkins-bot:
[mediawiki/extensions/PluggableSSO@master] Use $this->requireExtension() in maintenance scripts

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

Change 409294 merged by jenkins-bot:
[mediawiki/extensions/SecureSessions@master] Use $this->requireExtension() in maintenance scripts

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

Change 409303 merged by jenkins-bot:
[mediawiki/extensions/CongressLookup@master] Use $this->requireExtension() in maintenance scripts

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

Change 409300 merged by jenkins-bot:
[mediawiki/extensions/WikibaseLexeme@master] Use $this->requireExtension() in maintenance scripts

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

Change 415757 had a related patch set uploaded (by Ejegg; owner: Ejegg):
[mediawiki/extensions/DonationInterface@master] Make requireExtension calls conditional

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

Change 415757 merged by jenkins-bot:
[mediawiki/extensions/DonationInterface@master] Make requireExtension calls conditional

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

Change 429750 had a related patch set uploaded (by Gopavasanth; owner: Gopavasanth):
[mediawiki/extensions/CirrusSearch@master] Update maintenance scripts to use $this->requireExtension

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

Currently, are all the extensions are done are extension remaining (or) to be done? As so far with the above main list.

Smalyshev updated the task description. (Show Details)Apr 30 2018, 7:38 PM
Smalyshev added a subscriber: subins2000.
nikitavbv updated the task description. (Show Details)Jun 15 2018, 7:33 PM

Change 440563 had a related patch set uploaded (by Phantom42; owner: Phantom42):
[mediawiki/extensions/WikimediaMaintenance@master] Update Maintenance scripts to use $this->requireExtension()

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

PFWOz added a subscriber: PFWOz.EditedNov 28 2018, 8:34 PM

Is it expected for this to break these extensions on 1.27 LTS? Since this line was added I've had to comment it out in TitleKey in order to run update.php without a "Call to undefined method RebuildTitleKeys::requireExtension()" error.

TheDJ added a comment.Nov 28 2018, 8:57 PM

@PFWOz yes. We always advise people to use extensions that are of the same branch version as core. So you shouldn't use a 1.32 version of an extension on an LTS 1.27 release of core. We provide no guarantees that this will work, and only after 1.27 we are keeping a limited set of information per extension that keeps track of compatibility (But because of how new that is and the enormous backlog, I wouldn't rely on this information yet to judge actual compatibility).

Same release branch of both extensions and core is your best bet.

PFWOz added a comment.Nov 28 2018, 9:13 PM

@TheDJ Thanks. I'll request backports of some significant fixes to the extension that were made after REL1_27 was cut. Should hopefully be possible since the only breaking change appears to be the use of requireExtension() in the maintenance script.