aboutsummaryrefslogtreecommitdiffstats
path: root/maintenance
Commit message (Collapse)AuthorAgeFilesLines
* BlockUsers: Add a waitForReplication() callReedy2025-04-011-0/+2
| | | | | Bug: T390771 Change-Id: I2ef54405b0f27d665d11e387ff9b6a6e8633d460
* updateCollation: Add missing waitForReplication()Alexander Vorwerk2025-04-011-0/+2
| | | | | Bug: T385703 Change-Id: I7975b7443c03f9fbabcc7addcf6bba8656531360
* Merge "Chinese Conversion Table Update 2025-1"jenkins-bot2025-03-2610-19/+216
|\
| * Chinese Conversion Table Update 2025-1BAKAHOME\chief2025-01-0610-19/+216
| | | | | | | | | | | | | | | | | | Update the Chinese conversion table routinely to fix bugs reported at https://zh.wikipedia.org/wiki/Wikipedia:字词转换/修复请求. It is only data changes and only works for Chinese WikiProjects. Change-Id: I2c7e4818a1dcb4c7027265840732ec503ec60b1a
* | Replace a number of uses of class aliases with the real thingsJames D. Forrester2025-03-2640-4/+53
| | | | | | | | | | | | | | Found via disabling phan's alias support for a run (and ignoring wgLang's hard-coded state of being a \Language, alas). Change-Id: I4753bcd84d72d6de111fc7ffc5841fa417bf7333
* | Namespace all remaining files in includes/changetagsJames D. Forrester2025-03-253-0/+3
| | | | | | | | | | Bug: T353458 Change-Id: I3cf44dfe5425f2efb8409c83571c427447b053af
* | Namespace all remaining files in includes/exceptionJames D. Forrester2025-03-252-2/+3
| | | | | | | | | | | | | | | | | | In MediaWiki/Exception, to follow PSR-4 per plural vs. singular (this can be changed later if people really care). Also, move the couple of exceptions in here that were already namespaced in the MW-top-level into the new space. Bug: T353458 Change-Id: I12ed850ae99effb699a6d7ada173f54e72f0570e
* | Namespace all remaining files in includes/jobqueueJames D. Forrester2025-03-201-0/+1
| | | | | | | | | | Bug: T353458 Change-Id: I95690a312e356c45dbeed607d32fb0e4626690cf
* | Merge "block: Add cleanupBlocks.php"jenkins-bot2025-03-201-0/+309
|\ \
| * | block: Add cleanupBlocks.phpTim Starling2025-03-191-0/+309
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add a script to clean up referential integrity issues in the block and block_target table. Most notably, merge duplicate block_target rows and delete orphan block_target rows, issues which exist in production. Bug: T389301 Change-Id: I77e1bc308a107a3155d23fa43fe830a394f157ba
* | | Namespace all remaining files in includes/loggingJames D. Forrester2025-03-192-0/+2
|/ / | | | | | | | | Bug: T353458 Change-Id: Ibe1810f1c71316a9124e1dc6ae405097dafd5267
* | createAndPromote: Add documentation about automatic global groupsThalia2025-03-171-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * If createAndPromote is run while CentralAuth is loaded and $wgCentralAuthAutomaticGlobalGroups is configured, the global groups will not be updated atomatically, and instead must be updated manually. * This decision was made as part of T376315, which introduces automatic global groups, because we do not expect there to be a need for automatic global groups to work with the groups that are permitted by createAndPromote. What: * Document this behaviour in the createAndPromote documentation. Bug: T376315 Change-Id: Ic5ccb82f5adee5c939b1c3f7ebcaa3dff5929ee4
* | Merge "findBadBlobs: Allow for timestamp based search via --scan-to"jenkins-bot2025-03-151-17/+46
|\ \
| * | findBadBlobs: Allow for timestamp based search via --scan-toAmir Sarabadani2025-03-141-17/+46
| | | | | | | | | | | | | | | | | | | | | | | | Very similar to --scan-from. There is a bit of complexity involved with allowing combination of --limit and this but locally it seems to work. Bug: T351953 Change-Id: Ie218717a9f00318392e7a78f25ccfadba4b30503
* | | Merge "Avoid constructing Title from LinkTarget where not needed"jenkins-bot2025-03-141-1/+1
|\ \ \ | |/ / |/| |
| * | Avoid constructing Title from LinkTarget where not neededthiemowmde2025-01-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I just find this combination of method calls confusing. A revision can not be addressed via a LinkTarget. We can only end having a revision when we started with a proper PageIdentity. This is actually hard-coded in the RevisionRecord constructor. So why not use that PageIdentity when we have the guarantee that it's available? I believe the proposed replacement is also faster. Not only because we avoid calling some extra code. The new code makes sure that the page ID is never lost and doesn't need to be queried again. Change-Id: I3ea3dd8b52566cc9883f3328c7748584fb3d05ff
* | | ImportImages: Exit with non-zero code if import failsBlankEclair2025-03-081-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When scripting, folks generally check the exit code of a program to be zero if it is successful, and non-zero if it isn't. Since importImages can be used in third-party scripts to automate wiki imports, it is paramount that import failures are detected. However, since it doesn't exit with a failure code (i.e. a non-zero exit code) when a file fails to import or when there are no files found, it is much more difficult to detect import failures. Therefore, we exit with a non-zero return code to make import failures much more easier to detect for scripts. Bug: T388296 Change-Id: I5d9ede123355d63267793133287253a86faecda5
* | | Merge "maintenance: Also check for utf-8 encoding in findBadBlobs"jenkins-bot2025-03-051-3/+8
|\ \ \
| * | | maintenance: Also check for utf-8 encoding in findBadBlobsAmir Sarabadani2025-03-051-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, if you run this on broken revisions that trigger an exception, it passes on them. For example: mwscript findBadBlobs.php --wiki eowiki --revisions 4062 passes while loading the revision in web triggers an exception. These are clearly bad blobs and should be treated as such. Bug: T351953 Change-Id: Id3164322269efd8aa67a1496d4019d50f433062e
* | | | Merge "Split MediaWikiTitleCodec"jenkins-bot2025-03-031-2/+2
|\ \ \ \
| * | | | Split MediaWikiTitleCodecTim Starling2025-03-031-2/+2
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the linked bug, I would really like GenderCache to use UserOptionsManager. But all user-related services need UserNameUtils which depends on TitleParser, and TitleFormatter needs GenderCache to correctly format NS_USER titles. Having TitleFormatter and TitleParser together in a single class creates an intractable dependency loop. So, split MediaWikiTitleCodec. On Daniel's advice I converted the existing TitleParser and TitleFormatter interfaces to classes. The code was always structured to allow this. Extensions require surprisingly few updates. MediaWikiTitleCodec remains only for its deprecated static methods. The implementations were split cleanly with no need for shared code. The tests did have a little bit of shared code, for round-trip testing, so I added a shared test base class for that. Bug: T386584 Depends-On: Ibf307e953b666d8923bc96a507907421558da378 Depends-On: I47e83e95727e6830500e9af7cff92e7d3f91167e Depends-On: Id9c045864a9dc3c640a896e6b34f516c7e42b050 Change-Id: I3dcce6639ed01c7611a663671c872cec775bdaa2
* / / / initEditCount: Join from user to actor to revisionBryan Davis2025-02-251-2/+2
|/ / / | | | | | | | | | | | | | | | | | | | | | Correct the join conditions used to find the current edit count for a batch of users. Follows up b98f33c where the incorrect join order and conditions were introduced as part of migration to QueryBuilder syntax. Change-Id: I1841bb074b0f2be31e60a3cce3d62eb1b5999ad0
* | | Merge "Add Y/n prompt at the end of interactive install"jenkins-bot2025-02-252-0/+25
|\ \ \
| * | | Add Y/n prompt at the end of interactive installaddshore2025-02-252-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Split out from I8b6b4138158e64fbe63a63e5e784a9b5a7574270 Bug: T48076 Change-Id: I6ac5550434850973e544c69a11a0d199ab2d422c
* | | | maintenance: Document channel for Maintenance::output as stringUmherirrender2025-02-222-2/+2
|/ / / | | | | | | | | | | | | | | | | | | It is passed to Maintenance::outputChanneled, already documented as string Change-Id: Ice0222d642fef703a5cc39ef0d238bd2c31d4d40
* | | Merge "Revert "maintenance: Use DatabaseSqlite for type-hinting instead of ↵jenkins-bot2025-02-201-7/+6
|\ \ \ | | | | | | | | | | | | DBConnRef""
| * | | Revert "maintenance: Use DatabaseSqlite for type-hinting instead of DBConnRef"Umherirrender2025-02-201-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 4563e41f20212fe45abf503966e6ec186519bb17. Reason for revert: The expected DatabaseSqlite is not directly used here, it is still DBConnRef and the patch does not work as is. Bug: T386891 Change-Id: I83b1e299b698c004dcacb9aa90901dfe28097403
* | | | Prevent creation of temporary accounts using createAndPromote.phpDreamy Jazz2025-02-191-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * The createAndPromote.php maintenance script can be used to create accounts, assign passwords to the account, and assign user groups. * Temporary accounts cannot have user groups (T340468) and cannot have passwords set or updated. * Given this, the createAndPromote.php maintenance script can only auto-create a temporary account which does not seem to be needed, as this can be done by making an edit. ** Attempting to assign user groups to a temporary account using this maintenance script currently throws an exception, so as it stands the script needs to be fixed. * Therefore, the createAndPromote.php maintenance script should reject any attempts to create or update groups / passwords of a temporary account. What: * Cause a fatal error if the createAndPromote.php maintenance script is called with a username matching the temporary account name format. * Add tests for this new behaviour. Bug: T386775 Change-Id: Iad622d903fe685f98bcb33470ce2042bacb4fe4e
* | | | Merge "ResourceLoader: Remove module_deps table"jenkins-bot2025-02-132-164/+0
|\ \ \ \
| * | | | ResourceLoader: Remove module_deps tableHannah Okwelum2025-02-132-164/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No longer used. see T343492 Bug: T379661 Change-Id: I6b3d51995452f77b5da86b0cf32a23b12c7c669c
* | | | | Merge "Replace call_user_func_array with dynamic function call"jenkins-bot2025-02-122-4/+4
|\ \ \ \ \
| * | | | | Replace call_user_func_array with dynamic function callUmherirrender2025-02-032-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use modern php syntax to call a callable. Reduce the stack trace to improve performance and better IDE and static analyzer Also replace func_get_args with variables Change-Id: Ie193c4e996ab136e08f1e16c988448d054520aa7
* | | | | | Merge "Remove terminal colours from findDeprecated.php"jenkins-bot2025-02-111-11/+2
|\ \ \ \ \ \
| * | | | | | Remove terminal colours from findDeprecated.phpTim Starling2025-02-101-11/+2
| | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The output of this script is completely unreadable when using a terminal with a light background. The output is fine without the colours. The colours break the PHPUnit test. Change-Id: I731b2e79994194ff1d6c1fc4742be8391c7e1724
* / | | | | RenameUser: Introduce RenameUserJob to run rename jobxtex2025-02-112-158/+59
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RenameUserJob is moved to Job/RenameUserTableJob because there are two kinds of jobs now. The newly added RenameUserDerivedJob is used for performing user-renames across a wiki family using virtual domains or shared tables. Most code are moved from SpecialRenameUser and maintenance/renameUser. The new service, RenameUserFactory is added for constructing RenameUser easier. When a global rename happen, the central wiki will enqueue RenameUserDerivedJobs for other wikis in the same family. The derived jobs will check if the central wiki has the same user table as local, and perform updates to local tables. A new user-right 'renameuser-global' is also added because wiki families may want global users to be renamed only by a limit set of users or on a certain global wiki. Bug: T104830 Change-Id: Ic4120cbd9a4850dfe22d009daa171199fe7c5e39
* | | | | Merge "Use $string === '' instead of strlen( $string ) === 0"jenkins-bot2025-02-057-14/+14
|\ \ \ \ \ | |/ / / / |/| | | |
| * | | | Use $string === '' instead of strlen( $string ) === 0Fomafix2025-01-307-14/+14
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add $string === false or $string === null where $string can have other types than a string. Also document null as possible return value in FileRepo. Change-Id: Iaa29ba01c3fd6bea506debdc6f929edfe881c808
* | | | Merge "updateCollation: Add option to only migrate collation normalization"jenkins-bot2025-02-031-0/+70
|\ \ \ \
| * | | | updateCollation: Add option to only migrate collation normalizationAmir Sarabadani2025-01-241-0/+70
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | We should add support for write both to the script as well Bug: T299951 Change-Id: I6822e36bb0575f56811002eeecd3c286890fb608
* / / / maintenance: Replace call_user_func with dynamic function callUmherirrender2025-01-316-9/+9
|/ / / | | | | | | | | | | | | | | | | | | | | | Use modern php syntax to call a callable. Reduce the stack trace to improve performance and better IDE and static analyzer support Change-Id: I1af7da4a8b3433f31dfef78adda2511a88adb73f
* | | Add migrateFileTables.phpAmir Sarabadani2025-01-211-0/+294
| | | | | | | | | | | | | | | Bug: T383492 Change-Id: Iabcb8ccb89697d531b291cc1fcddbfb2e205d741
* | | Remove 2-line PHPDocs that just repeat the types from the codethiemowmde2025-01-1711-50/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Same as Ia294bf4 did for 1-line comments. This patch removes slightly more complex 2-line PHPDoc comments that don't add any new information to the code, but literally repeat what the code already says. They say "don't document the code, code the documentation", and we are doing this more and more. We just tend to forget to remove the obsolete comments. Note I'm also removing a line of text in a few cases when it's very short and literally says the same as the method name. Again, such comments add zero new information. Change-Id: I01535404bab458c6c47e48e5456403b7a64198ed
* | | Merge "Remove trivial 1-line PHPDocs that just repeat the code"jenkins-bot2025-01-166-19/+0
|\ \ \
| * | | Remove trivial 1-line PHPDocs that just repeat the codethiemowmde2025-01-166-19/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I assume these are all either auto-generated by an IDE or the language-level type declarations have been added later. In any case the comments don't add any new information to what the code already says. This is just extra clutter that makes the code harder to read, I would argue. There are many, many more comments like this. In this patch I intentionally focus on the most trivial 1-line comments. Change-Id: Ia294bf4ce0d8a77036842fe25884bc175c2b0e7d
* | | | dumps: Use proc_close() to close proc_open() subprocessMáté Szabó2025-01-161-1/+1
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: - TextPassDumper may spawn PHP subprocesses via proc_open() when invoked with --spawn. - The script uses pclose() to try and close these, which is incorrect, because the resource returned by proc_open() should be closed via proc_close().[1] - This causes a TypeError on PHP 8.1 and newer. What: - Use proc_close() to close the resource instead of pclose(). Test Plan: - Run `php maintenance/dumpBackup.php --current --stub | php maintenance/dumpTextPass.php --spawn` on a local test wiki using PHP 8.1 or newer. It should succeed. [1] https://www.php.net/manual/en/function.proc-open.php Bug: T382484 Change-Id: I66cd733cdbc1b8bc1470c14851a0700401c36d1e
* | | Merge "maintenance: Back out DI in purgeMessageBlobStore.php maint script"jenkins-bot2025-01-141-2/+6
|\ \ \
| * | | maintenance: Back out DI in purgeMessageBlobStore.php maint scriptAmmarpad2025-01-121-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use MessageBlobStore::clearGlobalCacheEntry static method directly Delete the script test. Cache clearing is already tested in MessageBlobStoreTest and seems sufficient here Bug: T379722 Change-Id: I7155089081f5bd518b06b0890a3d5d5b7d0d0314
* | | | Remove use of BagOStuff TTL constants from unrelated codeTimo Tijhof2025-01-131-3/+2
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Neither of these are related to BagOStuff or other object cache expiry. * Article/OutputPage caller related to HTTP Cache-Control and its 'max-page' pragma. * expireTemporaryAccounts.php was about Unix timestamps. Bug: T353529 Bug: T364652 Change-Id: I78af9a126696144021fc8f4585a6f4b2931ed8a6
* | | Merge "build: Upgrade mediawiki/mediawiki-phan-config from 0.14.0 to 0.15.0"jenkins-bot2025-01-102-1/+2
|\ \ \
| * | | build: Upgrade mediawiki/mediawiki-phan-config from 0.14.0 to 0.15.0James D. Forrester2024-12-192-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Suppress remaining issues Depends-On: I633ec05fe9ab6a815225911d942ecb79f21c428f Depends-On: I186e799256fbaf5ee77558bd146f9418dd5eaacc Depends-On: Ib84b7d71e8308a36409f30ecfd16e9de149e97b3 Depends-On: I26aa4adf31b4142248abe3e0f9aa8314512602a6 Depends-On: Icf24e208a487bafe3d1983536870aac19cfc4b5e Depends-On: I99915b893f14cfbb2b54d9a6264b4f294200c4f2 Depends-On: Ia53b71dff3299837856ae3c004cd0227bd45e05b Change-Id: I825dce05d4a6ca87acf25063e3664cb2d16f5db0