aboutsummaryrefslogtreecommitdiffstats
path: root/maintenance
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | Remove fixDefaultJsonContentPages.phpDreamy Jazz2024-08-261-141/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * The fixDefaultJsonContentPages.php maintenance script was added in 2986d47c9052af08e37b363ad614e32f5ccff508 which was MW 1.27 * Per the version policy, wikis wishing to upgrade to MW 1.43 should upgrade via 1.35 or 1.39 before moving to 1.43. * As such, this script will have been already run for any wiki upgrading to 1.43 and therefore this script is unused. * Removing the script is useful to reduce the amount of untested code in the maintenance directory and reducing unnecessary maintenance on now unused code. What: * Remove fixDefaultJsonContentPages.php Bug: T373335 Change-Id: Ie20f55c6a8723573aa7e9acd67766af9dfb67269
* | | | | Remove populatePPSortKey.phpDreamy Jazz2024-08-261-111/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * The populatePPSortKey.php maintenance script was added in 993ce4d4111c3ac4be92106f7c8d93e9e0d1427f which was in at least MW 1.34. * Per the version policy, wikis wishing to upgrade to MW 1.43 should upgrade via 1.35 or 1.39 before moving to 1.43. * As such, this script will have been already run for any wiki upgrading to 1.43 and therefore this script is unused. * Removing the script is useful to reduce the amount of untested code in the maintenance directory and reducing unnecessary maintenance on now unused code. What: * Remove populatePPSortKey.php Bug: T373334 Change-Id: Iaa86bb193bf8feae9f5e2fe33255182e864d2e4f
* | | | | Remove populateBacklinkNamespace.phpDreamy Jazz2024-08-261-111/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * The populateBacklinkNamespace.php maintenance script was added to update.php in MW 1.24 in b8c038f6784ef08205f7cf6d7cc11462140e3fa2 * Per the version policy, wikis wishing to upgrade to MW 1.43 should upgrade via 1.35 or 1.39 before moving to 1.43. * As such, this script will have been already run for any wiki upgrading to 1.43 and therefore this script is unused. * Removing the script is useful to reduce the amount of untested code in the maintenance directory and reducing unnecessary maintenance on now unused code. What: * Remove populateBacklinkNamespace.php Bug: T373333 Change-Id: Ia70fdd5c5ae087d7f5bdf4499185701bbb106c1f
* | | | | Remove addRFCandPMIDInterwiki.phpDreamy Jazz2024-08-261-95/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * The addRFCandPMIDInterwiki.php maintenance script last had it's update key modified in MW 1.23 in commit bd384358482da20facf3cfac5b1c092d8791e9d1. * Per the version policy, wikis wishing to upgrade to MW 1.43 should upgrade via 1.35 or 1.39 before moving to 1.43. * As such, this script will have been already run for any wiki upgrading to 1.43 and therefore this script is unused. * Removing the script is useful to reduce the amount of untested code in the maintenance directory and reducing unnecessary maintenance on now unused code. What: * Remove addRFCandPMIDInterwiki.php Bug: T373331 Change-Id: Ie6791c0cc2cfab5e09aa0b1c7ddcea1099cd1f79
* | | | | Remove populateRevisionLength.phpDreamy Jazz2024-08-261-181/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * The populateRevisionLength.php maintenance script last had it's update key modified in 0f79beec8b1cf79bad8f7f7326ce417913abc009 which was MW 1.22. * Per the version policy, wikis wishing to upgrade to MW 1.43 should upgrade via 1.35 or 1.39 before moving to 1.43. * As such, this script will have been already run for any wiki upgrading to 1.43 and therefore this script is unused. * Removing the script is useful to reduce the amount of untested code in the maintenance directory and reducing unnecessary maintenance on now unused code. What: * Remove populateRevisionLength.php Bug: T373313 Change-Id: Ic621e14a6ea7f455a396aac61b9919ed8436d71a
* | | | | Remove populateFilearchiveSha1.phpDreamy Jazz2024-08-261-112/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * The populateFilearchiveSha1.php maintenance script has been in core since fb2c1c645bdc2f74477e4a4dd9c7b08c5afe4744 which was MW 1.19 * Per the version policy, wikis wishing to upgrade to MW 1.43 should upgrade via 1.35 or 1.39 before moving to 1.43. * As such, this script will have been already run for any wiki upgrading to 1.43 and therefore this script is unused. * Removing the script is useful to reduce the amount of untested code in the maintenance directory and reducing unnecessary maintenance on now unused code. What: * Remove populateFilearchiveSha1.php Bug: T373312 Change-Id: Ia68d11ccc5c9f470783acfe7139e48f76a1576c9
* | | | | Remove populateImageSha1.phpDreamy Jazz2024-08-261-201/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * The populateImageSha1.php maintenance script has been in core since at least MW 1.19, being definitely added to update.php in 1.19 through 7cb4d69d9d2c442ad3cfe6efd5307463aef562d8. * Per the version policy, wikis wishing to upgrade to MW 1.43 should upgrade via 1.35 or 1.39 before moving to 1.43. * As such, this script will have been already run for any wiki upgrading to 1.43 and therefore this script is unused. * Removing the script is useful to reduce the amount of untested code in the maintenance directory and reducing unnecessary maintenance on now unused code. What: * Remove populateImageSha1.php Bug: T373310 Change-Id: Ibc6a31b1eafb7c5727d68bfb2526ffd7532408a6
* | | | | Remove populateRecentChangesSource.phpDreamy Jazz2024-08-261-117/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * The populateRecentChangesSource.php maintenance script was added in 6bbd4bca6c1341395988fdfdcf4788ce187edfa9 which was in MW 1.22. It was added to the version-specific updater list, which means it is no longer run in 1.43 and therefore is also never called. * Per the version policy, wikis wishing to upgrade to MW 1.43 should upgrade via 1.35 or 1.39 before moving to 1.43. * As such, this script will have been already run for any wiki upgrading to 1.43 and therefore this script is unused. * Removing the script is useful to reduce the amount of untested code in the maintenance directory and reducing unnecessary maintenance on now unused code. What: * Remove populateRecentChangesSource.php Bug: T373308 Change-Id: Iabe8f0b28966c9d57a19d6965cc2de7ce489e8ed
* | | | | Remove populateIpChanges.phpDreamy Jazz2024-08-261-158/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * The populateIpChanges.php maintenance script was added in MW 1.30 in commit d09554b6ef498a0182110427af6a5b0545de1293. * Per the version policy, wikis wishing to upgrade to MW 1.43 should upgrade via 1.35 or 1.39 before moving to 1.43. * As such, this script will have been already run for any wiki upgrading to 1.43 and therefore this script is unused. * Removing the script is useful to reduce the amount of untested code in the maintenance directory and reducing unnecessary maintenance on now unused code. What: * Remove populateIpChanges.php Bug: T373306 Change-Id: Ie6b5405ceac4aa5465325dc5b5d3b82e3235390f
* | | | | Remove populateRevisionSha1.phpDreamy Jazz2024-08-261-163/+0
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * The populateRevisionSha1.php maintenance script last had it's update log key changed in MW 1.19 in c326cab5, and it has been added to update.php since that version. * This means that, since the script has been run via update.php since before MW 1.35, it should be possible to remove the script as all wikis will have run this script and therefore it will be skipped for all wikis (as it's in the update log). * Removing now unused maintenance scripts is important to reduce the amount of untested code in the maintenance directory and also prevents the need to update the code for migrations (e.g. using the query builders). What: * Remove the populateRevisionSha1.php maintenance script. Bug: T373238 Change-Id: Id3d46d6e0d4b8bd4aaf6d3ed01d7b759813c981a
* | | | resetAuthenticationThrottle.php: Support null login usernameGergő Tisza2024-08-241-10/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Username can be legitimately missing when using a redirect-based primary authentication provider. Change-Id: I7a56bec98f8efab9940c08fe9685e3f3f2726f8e
* | | | Merge "Remove ParserOutput::getText() calls from core (direct pipeline)"jenkins-bot2024-08-243-25/+27
|\ \ \ \ | |_|/ / |/| | |
| * | | Remove ParserOutput::getText() calls from core (direct pipeline)Isabelle Hurbain-Palatin2024-08-233-25/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the second patch of a series of patches to remove ParserOutput::getText() calls from core. This series of patches should be functionally equivalent to I2b4bcddb234f10fd8592570cb0496adf3271328e. This patch replaces the calls to getText where the legacy parser is called directly by creating a pipeline and invoking it on the generated. These should probably eventually use the Content framework to generate output instead of using Parser directly (T371008), which will also allow them to transparently support Parsoid. Bug: T293512 Change-Id: I45951a49e57a8031887ee6e4546335141d231c18
* | | | Merge "maintenance: Fix rollbackEdits.php with uncanonicalised names"jenkins-bot2024-08-231-3/+3
|\ \ \ \ | |/ / / |/| | |
| * | | maintenance: Fix rollbackEdits.php with uncanonicalised namesBlankEclair2024-08-151-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The database stores usernames canonicalised, but the script checks the non-canonicalised version. This commit fixes that, and adds a test to ensure that there will not be any regressions. Bug: T372533 Change-Id: I52b551e92fd6812b108030708c3ecbb1c8ed6d1c
* | | | recentchanges: Improve docs, fix file headers, fix doc groupsTimo Tijhof2024-08-222-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Define "RecentChanges" doc group and add all classes in changes/ and rcfeed/ to the group, as well as a few obvious classes that we (currently) maintain in vertical buckets: maintenance, api, specials. * Doc group "Change tagging" was invalid because a group identifier must be a single word, and this was thus passing an unexpected second argument to the `ingroup` Doxygen command. As such, it was missing on https://doc.wikimedia.org/mediawiki-core/master/php/ Define "ChangeTags" properly and fix/add classes in this component. * Add missing `ingroup` to class blocks (and remove from any file blocks) as otherwise the file is indexed twice (e.g. in Doxygen) which makes navigation on doc.wikimedia.org rather messy. Remove duplicate descriptions from file blocks in favour of class doc blocks. This reduces needless duplication and was often incorrect or outdated, and helps make file headers more consistently (visually) ignorable. Ref https://gerrit.wikimedia.org/r/q/message:ingroup+is:merged * Minor improvements to class descriptions here and there. Test plan: * `php maintenance/mwdocgen.php --file includes/changes,includes/changetags,includes/rcfeed` (This will emits harmless warnings about undefined "Hooks" group, because it's referenced but not included in this fast subset.) * open docs/html/index.html Bug: T364652 Change-Id: Ifac20da51f7e809f1a9ccbfac3bf50e739a083ea
* | | | Merge "Create a maintenance script to purge expired rows in recentchanges"jenkins-bot2024-08-221-0/+49
|\ \ \ \
| * | | | Create a maintenance script to purge expired rows in recentchangesDreamy Jazz2024-08-211-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * In the CheckUser extension, a maintenance script named 'purgeOldData.php' purges data from the recentchanges table. * This script is run on WMF production daily to ensure private data is purged. * This should instead be in core, so that the functionality can be used when CheckUser is not installed and also not duplicate existing code used for the job that purges the table. What: * Create purgeRecentChanges.php which purges expired rows in the recentchanges table by running the code in the RecentChangesUpdateJob directly (without using the job queue, as there is no need to do that because we are in a maintenance script context). * Add a test for this maintenance script * Test the purging features of the existing job to ensure that this code is reliable. Bug: T373032 Change-Id: Id32780c00b053d7fec94a00812f8d40a6bf2e40c
* | | | | Merge "Remove ParserOutput::getText() calls from core (getRawText)"jenkins-bot2024-08-211-3/+4
|\ \ \ \ \
| * | | | | Remove ParserOutput::getText() calls from core (getRawText)Isabelle Hurbain-Palatin2024-08-191-3/+4
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the first patch of a series of patches to remove ParserOutput::getText() calls from core. This series of patches should be functionally equivalent to I2b4bcddb234f10fd8592570cb0496adf3271328e. This first patch replaces the calls to getText to calls to ParserOutput::getRawText when the pipeline has no reason to be executed. Bug: T293512 Change-Id: I0ad53cd074ca9cf13e96e6b08179e13aeea180f4
* / / / / CleanupTitles: log the correct namespace when not in dry run modePppery2024-08-191-1/+1
|/ / / / | | | | | | | | | | | | | | | | Bug: T195546 Change-Id: I01179fef459b94d33dc22642347b0a82ad318677
* | | | Fix some typosMatěj Suchánek2024-08-181-2/+2
| | | | | | | | | | | | | | | | Change-Id: I1a41f33c65bc9edf2df248581a2c45c5c79c4f93
* | | | Chinese Conversion Table Update 2024-3.1Chiefwei2024-08-181-0/+1
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | 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: I02396a408fb00ef32ddf6d9b164f37dffc3e0dab
* | | Merge "Get environment variable HOME via getenv( 'HOME' )"jenkins-bot2024-08-132-4/+6
|\ \ \
| * | | Get environment variable HOME via getenv( 'HOME' )Fomafix2024-08-132-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | $_ENV is only available if activated by variable_orders in php.ini. Change-Id: Id79334256d319c434df4325ea83adefe711dff0a
* | | | Test getConfiguration.phpDreamy Jazz2024-08-111-1/+1
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * The maintenance scripts in core are mostly untested and testing them will help prevent regressions in the scripts. What: * Update Maintenance::maybeShowHelp to call ::fatalError instead of directly calling die(). This is so that code which calls this can be tested. * Create GetConfigurationTest Bug: T371167 Change-Id: Ifa31a3b759c2fdc1c869a3764b75515ec27a4648
* | | Consolidate Maintenance 'includes' code in one placeJames D. Forrester2024-08-113-0/+539
| | | | | | | | | | | | Change-Id: Ifd20f164e5cafe52efdf4fa65e39289214d68696
* | | Chinese Conversion Table Update 2024-3Chiefwei2024-08-115-15/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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: I50920b1be658741bfb3643e3992b3ebd6727e0ec
* | | Test findClasses.phpDreamy Jazz2024-08-101-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * Maintenance scripts in core are mostly untested and testing the less complex scripts will enable quicker raising of the coverage. What: * Add FindClassesTest Bug: T371167 Change-Id: I8bc9ef7c7bc59b675734f00bf5c2c0892bba8c3a
* | | Fix blockUsers.php handling of an invalid performer optionDreamy Jazz2024-08-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * The blockUsers.php maintenance script can set the performer's username as the username provided via the --performer option. * The username is validated by the script, but the validation broke in c106f679b03ca221fcee26f1a0f5aff40381e3f5. This was because both: ** The check for whether the username was invalid changed to only looking for 'null' values returned by User::newSystemUser / User::newFromName. ** The User::newFromName method returns false on an invalid username. * Replacing the deprecated User::newFromName with the call to UserFactory::newFromName fixes this issue, as the replacement method returns null on an invalid username. ** This also allows replacement of a deprecated method, which is preferrable to changing the 'null' check to be a falsey check. What: * Replace the call to User::newFromName with UserFactory ::newFromName to fix this issue. * Add a test to verify that this fix worked. Bug: T371167 Change-Id: Ie181c16a1dda559a81b8ae4d53cd8f69b1af9b75
* | | Merge "Add MediaWiki\Registration namespace to registration classes"jenkins-bot2024-08-108-0/+12
|\ \ \
| * | | Add MediaWiki\Registration namespace to registration classesEbrahim Byagowi2024-08-108-0/+12
| | | | | | | | | | | | | | | | | | | | Bug: T353458 Change-Id: Ifa3b6a6e0353bb4ce21a3f4456f1fc696c8d377c
* | | | Test code in Maintenance class that calls ::fatalErrorDreamy Jazz2024-08-101-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * Since 65d62ae39ea1e1fb8706ab00db2373bf5235df3f, it has been possible to test code that calls ::fatalError because in a PHPUnit test context it will throw an exception. What: * Add tests for code that calls ::fatalError in Maintenance. Bug: T371167 Change-Id: Ic25e93ba9a5617f0cadcda7c1723f82ed21e678f
* | | | Test wikiBirthday.phpDreamy Jazz2024-08-101-2/+2
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * Maintenance scripts in core are mostly untested, and testing the scripts which are less complex will allow raising the test coverage. * Furthermore, when testing these scripts bugs can be found which can then be fixed. In this commit, a bug is found where the script fails to generate the correct age for the wiki if the wiki has no revisions in the revision table but does in the archive table. What: * Fix wikiBirthday.php to correctly generate the age when the wiki has no undeleted revisions. * Create WikiBirthdayTest which covers the script. Bug: T371167 Change-Id: I15721f076beb8221bd4fa1ce8cb7a7f07635c1b5
* | | Merge "Test resetPageRandom.php"jenkins-bot2024-08-091-2/+2
|\ \ \
| * | | Test resetPageRandom.phpDreamy Jazz2024-08-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * The maintenance scripts in core are mostly untested and testing the less complex scripts will improve the test coverage in core. What: * Add integration tests for resetPageRandom.php * Update resetPageRandom.php to indicate that both the --to and --from parameters are required, as this is checked for in ::execute. Bug: T371167 Change-Id: Ieb46edf2b2e1571e2bec50a0d79bed4085da8894
* | | | Merge "Use fake maintenance scripts in MaintenanceRunnerTest where necessary"jenkins-bot2024-08-091-1/+8
|\ \ \ \ | |/ / / |/| | |
| * | | Use fake maintenance scripts in MaintenanceRunnerTest where necessaryDreamy Jazz2024-08-081-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * The MaintenanceRunnerTest class tests using real maintenance scripts and the code being tested can include the maintenance script files. * However, if running all tests together (such as when generating test coverage) the maintenance scripts may have already been loaded by integration tests that exist for those scripts. * Instead of fixing the specific instances, we should instead ensure that (where necessary) the MaintenanceRunnerTest tests using fake maintenance scripts only loaded by that test class. * Doing this prevents the files from being loaded anywhere else and ensures that the tests should not fail in this way again. What: * Update MaintenanceRunner::expandScriptFile to move the use of MS_INSTALL_PATH to a protected method that can then be mocked in MaintenanceRunnerTest. * Update MaintenanceRunnerTest to use fake maintenance scripts where necessary. This includes: ** No longer setting the current working directory as the MW_INSTALL_PATH, but instead set it as __DIR__. ** Creating several fake maintenance scripts to replace the uses of the real ones. ** Updating the data providers to reflect the changes. Bug: T371188 Change-Id: Ifacdcb8de5af53d2d5f4ed354af0d209384d7325
* | | | Merge "Chinese Conversion Table Update 2024-2"jenkins-bot2024-08-0910-70/+142
|\ \ \ \
| * | | | Chinese Conversion Table Update 2024-2Chiefwei2024-06-1010-70/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: I4da56d4083406639a41a15de6ed9263411217ac3
* | | | | Merge "Throw exception from Maintenance::fatalError when in PHPUnit tests"jenkins-bot2024-08-092-1/+30
|\ \ \ \ \
| * | | | | Throw exception from Maintenance::fatalError when in PHPUnit testsDreamy Jazz2024-08-032-1/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * The Maintenance::fatalError method calls the exit method, which when called causes the PHPUnit test suites to exit early. * This means that code that calls ::fatalError cannot be tested unless the method is mocked for each test. * To avoid this problem the ::fatalError method should not call exit() when running PHPUnit tests, as described in T272241. Instead, it should throw an exception which can be caught when the call is expected. What: * Create MaintenanceFatalError which extends Exception, which is thrown by Maintenance::fatalError instead of calling exit() if the 'MW_PHPUNIT_TEST' constant is defined. ** This new exception takes the error code passed to the ::fatalError method and uses it as the exception error code. * Create MaintenanceBaseTestCase::expectCallToFatalError which makes it easier for tests to assert that a call to Maintenance::fatalError occurs. This can optionally assert that the $code passed is as expected. ** Code which wishes to assert against the provided $msg can use ::expectOutputString or ::expectOutputRegex. Bug: T272241 Change-Id: I554a963c63eb4f22ebb3273053a7b83a33dcb4d1
* | | | | | Merge "maintenance: remove Database::clearFlag() call in recompressTracked.php"jenkins-bot2024-08-091-1/+0
|\ \ \ \ \ \
| * | | | | | maintenance: remove Database::clearFlag() call in recompressTracked.phpAaron Schulz2024-08-081-1/+0
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Maintenance scripts do not use DBO_TRX mode so this was redundant. Bug: T311090 Change-Id: I6dc6d2a8e7daf8a2a1dac7c3f8968b4a575b3dd6
* | | | | | Merge "Test migrateUserGroup.php"jenkins-bot2024-08-091-14/+33
|\ \ \ \ \ \ | |_|_|/ / / |/| | | | |
| * | | | | Test migrateUserGroup.phpDreamy Jazz2024-07-281-14/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * The maintenance scripts in core are mostly untested and testing the less complex scripts will improve the test coverage in core. * The migrateUserGroup.php maintenance script has a few bugs which were found by testing the script, and are fixed. What: * Add an integration test for migrateUserGroup.php * Fix the maintenance script to: ** Correctly report the number of affected users (instead of affected rows) ** Clear the cache in the UserGroupManager when a batch is performed. Bug: T371167 Change-Id: Ibd4c82332cbe83b7c5576a9e3bce6a99fa15c240
* | | | | | Merge "Add namespace to WikitextContent"jenkins-bot2024-08-071-0/+1
|\ \ \ \ \ \
| * | | | | | Add namespace to WikitextContentEbrahim Byagowi2024-08-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It adds MediaWiki\Content namespace to WikitextContent and two classes related. Change-Id: Ib74e4c5b3edac6aa0e35d3b2093ce1d0b794cb6d
* | | | | | | Merge "checkComposerLockUpToDate: Don’t suggest --no-dev during tests"jenkins-bot2024-08-061-1/+5
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | |
| * | | | | | checkComposerLockUpToDate: Don’t suggest --no-dev during testsLucas Werkmeister2024-07-311-1/+5
| | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we’re in a PHPUnit test run, we’ll need the dev dependencies (otherwise PHPUnit itself will be missing), so it doesn’t make sense to suggest --no-dev in that case IMHO. Change-Id: If105e00870a37a4f39b8b88982ec259108bf81de