aboutsummaryrefslogtreecommitdiffstats
path: root/maintenance
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | | Merge "NamespaceDupes: check if page exists from primary database"jenkins-bot2024-09-161-1/+1
|\ \ \ \ \ \ | |_|/ / / / |/| | | | |
| * | | | | NamespaceDupes: check if page exists from primary databasePppery2024-09-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: T374631 Change-Id: Ia3480d40bd7696726cf05cec3d873d2cb4e2e255
* | | | | | Merge "Move update-keys.sql to a PHP array"jenkins-bot2024-09-164-92/+5
|\ \ \ \ \ \ | |_|_|/ / / |/| | | | |
| * | | | | Move update-keys.sql to a PHP arrayTim Starling2024-09-134-92/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve maintainability of update-keys.sql by moving the list from an SQL file to a PHP array in the same file as the updates it is disabling. It was apparently an SQL file for the convenience of third parties wishing to install MediaWiki by manually sourcing tables.sql. Support this use case by adding an option to update.php which inserts the update keys. Users should source tables-generated.sql and then run update.php --initial The array is the same for each DB type, but it's correct for it to have the same scope as getCoreUpdateList(). Factoring out common parts of getCoreUpdateList() and this new array is a separate project. Bug: T167924 Change-Id: I404ee29aadcc2f3f24f78d1111090395129cd021
* | | | | | Merge "Fix old autoblock unblock log entries with namespace in log_title"jenkins-bot2024-09-131-0/+105
|\ \ \ \ \ \
| * | | | | | Fix old autoblock unblock log entries with namespace in log_titleDreamy Jazz2024-09-131-0/+105
| | |_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * The logging table on en.wikipedia.org contains an entry from 2005 which is an unblock of an autoblock. However, the log_title contains the namespace, which makes the code that looks for logs which target an autoblock fail (because it checks for the first character being '#'). * Fixing the log_title to remove the 'User:' prefix from rows which are autoblocks (i.e. searching for log_titles which start with 'User:#') should address the exceptions seen on Special:Log for these rows. ** The search can be limited to rows which have the 'unblock' log_action, as this has only been seen for this type of log. What: * Create fixAutoblockLogTitles.php which searches for the entries and then updates the log_title value to no longer include the 'User:' prefix ** The queries to search are split, such that the expensive LIKE query is performed on batches of row IDs. If the LIKE query is applied directly to all rows in the table, the query takes 30s to run on WMF production. * Add this maintenance script to update.php. It will be run once as the class extends LoggedUpdateMaintenance. * Test the newly added maintenance script to ensure it works. Bug: T373929 Change-Id: Ia62db56eda456bb764303b5f4b5a29be8f2d8fff
* | | | | | Merge "maintenance: Add missing documentation to class properties"jenkins-bot2024-09-1334-2/+83
|\ \ \ \ \ \
| * | | | | | maintenance: Add missing documentation to class propertiesUmherirrender2024-09-1334-2/+83
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add doc-typehints to class properties found by the PropertyDocumentation sniff to improve the documentation. Once the sniff is enabled it avoids that new code is missing type declarations. This is focused on documentation and does not change code. Change-Id: I7dec01892a987a87b1b79374a1c28f97d055e8fa
* | | | | | Merge "Use const keyword for constant list of strings or ints"jenkins-bot2024-09-135-28/+22
|\ \ \ \ \ \ | |/ / / / / |/| | | | |
| * | | | | Use const keyword for constant list of strings or intsUmherirrender2024-09-115-28/+22
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | Also changed visiblity of some to private Change-Id: I113b040321d27c84fe9b807c162736909e96fb20
* | | | | Merge "Specify caller in DB queries"jenkins-bot2024-09-131-1/+1
|\ \ \ \ \ | |_|/ / / |/| | | |
| * | | | Specify caller in DB queriesBartosz DziewoƄski2024-09-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found warnings about this in WMF production logs. Change-Id: I3ba973c320d672604c0c0ffa1c229a32231261b9
* | | | | Merge "Use $this->getServiceContainer() in maintenance"jenkins-bot2024-09-124-11/+6
|\ \ \ \ \ | |_|/ / / |/| | | |
| * | | | Use $this->getServiceContainer() in maintenanceFomafix2024-09-044-11/+6
| | | | | | | | | | | | | | | | | | | | Change-Id: I67af274ad60fab7ffeee2cbff6c0720665886c98
* | | | | Merge "Fix broken deleteSelfExternals.php and test it"jenkins-bot2024-09-111-13/+30
|\ \ \ \ \
| * | | | | Fix broken deleteSelfExternals.php and test itDreamy Jazz2024-09-111-13/+30
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * The deleteSelfExternals.php maintenance script is broken on my local wiki as the SQL generated by the script errors out when run on MariaDB. * This script should be fixed, updated to use the query builders, and tested to ensure that any future breakages do not go unnoticed. What: * Fix the deleteSelfExternals.php script to use a DELETE query that works, by generating it using the query builder. * Create DeleteSelfExternalsTest to test that the script now works. Bug: T371167 Change-Id: Id423fa5c1bfe666f57a38e733334342ac1ad2cea
* | | | | Merge "Test grep.php"jenkins-bot2024-09-111-9/+15
|\ \ \ \ \
| * | | | | Test grep.phpDreamy Jazz2024-09-021-9/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * Maintenance scripts in core have low test coverage * Improving this will reduce the chances of regressions and bugs What: * Fix grep.php to batch requests for rows from the page table, as it currently selects all rows in one go. ** Doing this on large wikis would result in millions of rows being returned in one query. * Create GrepPagesTest Bug: T371167 Change-Id: I4c9a55257ee64609fece776ca15c4219764d5266
* | | | | | Merge "Start on tests for userOptions.php"jenkins-bot2024-09-111-4/+4
|\ \ \ \ \ \ | |_|/ / / / |/| | | | |
| * | | | | Start on tests for userOptions.phpDreamy Jazz2024-09-021-4/+4
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * Maintenance scripts in core have low test coverage * Improving this will reduce the chances of regressions and bugs What: * Create UserOptionsMaintenanceTest which starts on tests for this script. Bug: T371167 Change-Id: I51374a96a0dd73f5a155278f5a48c5b59c44d055
* | | | | Merge "Remove ParserOutput::getText() calls from core (runOutputPipeline)"jenkins-bot2024-09-061-1/+2
|\ \ \ \ \
| * | | | | Remove ParserOutput::getText() calls from core (runOutputPipeline)Isabelle Hurbain-Palatin2024-09-061-1/+2
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the fourth patch of a series of patches to remove ParserOutput::getText() calls from core. This series of patches should be functionally equivalent to I2b4bcddb234f10fd8592570cb0496adf3271328e. Here we replace calls to getText where a ContentRenderer is available close by by temporary ParserOutput::runOutputPipeline that will eventually be replaced by a call to (probably) ContentRenderer (T371004). Doing this work in stages allows us to separate the work of "bring ParserOptions to the call site" from the work of "bringing ContentRenderer(ish) to the call site", since both need to be done for to make ParserOutput a value object (T293512). Change-Id: Ib4f9357293dc230df6e0ca2379a1e2a4cc1b91b7 Bug: T293512
* | | | | Merge "Hard deprecating wfGetServerUrl"jenkins-bot2024-09-061-3/+5
|\ \ \ \ \
| * | | | | Hard deprecating wfGetServerUrlEbrahim Byagowi2024-09-061-3/+5
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | wfGetServerUrl is deprecated since 1.39, let's remove the only use and turn it into a hard deprecation. Change-Id: I82be851fe411cd002c9c5847fe3924a6c0a4ba50
* | | | | Merge "Clarify documentation of Maintenance::runChild"jenkins-bot2024-09-061-4/+24
|\ \ \ \ \ | |/ / / / |/| | | |
| * | | | Clarify documentation of Maintenance::runChildDreamy Jazz2024-09-021-4/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * The Maintenance::runChild method is named in a way which makes it easy to assume that calling the method will directly execute the passed maintenance script ** The documentation does not help either, with it also implying that the script will be run once the method is called. * Instead callers are expected to run the maintenance script by calling ::execute on the returned object * The method name should be changed to make this clearer and the documentation improved. What: * Rename Maintenance::runChild to ::createChild, which makes it clearer that the maintenance script has not been run ** Leave ::runChild as an alias to ::createChild, as ::runChild was marked as stable to override. * Improve the documentation for Maintenance::createChild to make it clear that callers need to call ::execute on the returned Maintenance object. Bug: T371789 Change-Id: I7d0914ebaaa3ff5da05bccebb57cc76aad120dd5
* | | | | Merge "build: Use inline ignore for Generic.CodeAnalysis.AssignmentInCondition"jenkins-bot2024-09-049-0/+9
|\ \ \ \ \ | |_|_|/ / |/| | | |
| * | | | build: Use inline ignore for Generic.CodeAnalysis.AssignmentInConditionUmherirrender2024-09-019-0/+9
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid that new code contains this pattern. Depends-On: I7a9b5c89129fe4b555d03861f2c3ce3e9e2b2446 Depends-On: Ic2bcc7eeb16d3333dcd019bd209bd7fde843dab9 Depends-On: If20eddd8376ae2e8e29c4e56cd51f7b8eb6642b0 Depends-On: I3414f7e17f4bcb801857bc986bae8eb97aa2bfb8 Depends-On: I38b2729418e8389c681c6cd84858f5e5ed25bd3e Change-Id: I7cfd2e027edd327cf8be6471e348c137fefacda0
* | | | Merge "Mark FakeMaintenance as excluded for test coverage"jenkins-bot2024-09-031-0/+1
|\ \ \ \ | |_|/ / |/| | |
| * | | Mark FakeMaintenance as excluded for test coverageDreamy Jazz2024-09-021-0/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * The FakeMaintenance class contains no code execept for an empty definition of ::execute * Testing this class would therefore only involve checking that constructing it and calling ::execute does nothing * Instead, ignoring the file for test coverage should be sufficent. What: * Mark FakeMaintenance as excluded for test coverage. Bug: T371167 Change-Id: I7da4791d231fa7e2c4f514d3cf6ca7c492594f25
* / / CleanupTitles: Check if title exists from primary databasePppery2024-09-011-5/+5
|/ / | | | | | | | | | | | | | | | | | | | | It's possible for multiple invalid titles to normalize to the same title. The script tries to catch this, but it uses a replica database for it, which might not have picked up an earlier change in the same maintenance script. This caused the cleanupTitles run on ptwiki to crash (and somehow escaped notice until now) Bug: T195546 Change-Id: I2a4a34ce99067986d7c44605c796323c4d77dc4e
* | Merge "maintenance: Replace deprecated Maintenance::$mOptions"jenkins-bot2024-08-304-4/+4
|\ \
| * | maintenance: Replace deprecated Maintenance::$mOptionsUmherirrender2024-08-294-4/+4
| | | | | | | | | | | | Change-Id: I1b48b3c0b0e4bda5b61307725a2f08bbb5bbaaa9
* | | Merge "Start on tests for install.php"jenkins-bot2024-08-301-2/+1
|\ \ \
| * | | Start on tests for install.phpDreamy Jazz2024-08-301-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * Maintenance scripts in core are mostly untested and testing them will help to avoid regressions. What: * Create CommandLineInstallerTest. Bug: T371167 Change-Id: Ia9ef03326d7c25b7eb310c191034932fffcbff8c
* | | | Fully test createBotPassword.phpDreamy Jazz2024-08-301-1/+1
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * Maintenance scripts in core have low test coverage * Improving this will reduce the chances of regressions and bugs What: * Create CreateBotPasswordTest which fully tests createBotPassword.php maintenance script. * While doing this, address a PHP warning that appears when the user does not specify the 'grants' option. Bug: T371167 Change-Id: I8256c278b8397de896906e5714d478883b518ba0
* | | Merge "Test jsparse.php"jenkins-bot2024-08-291-1/+1
|\ \ \
| * | | Test jsparse.phpDreamy Jazz2024-08-291-1/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * Maintenance scripts in core are mostly untested and testing them will help to avoid regressions. What: * Create JSParseHelperTest that fully tests the associated maintenance script. Bug: T371167 Change-Id: I6ae5d9722169518dd19fd5136b12b7ecd6a22798
* | | Merge "Test moveBatch.php"jenkins-bot2024-08-291-1/+1
|\ \ \
| * | | Test moveBatch.phpDreamy Jazz2024-08-291-1/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * Maintenance scripts in core are mostly untested and testing them will help to avoid regressions. What: * Create MoveBatchTest that fully tests the associated maintenance script. Bug: T371167 Change-Id: I2244f46e34e81c98a2647e00b229ca68bc3d3568
* | | Merge "Test checkComposerLockUpToDate.php"jenkins-bot2024-08-291-4/+11
|\ \ \
| * | | Test checkComposerLockUpToDate.phpDreamy Jazz2024-08-291-4/+11
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * Maintenance scripts in core are mostly untested and testing them will help to avoid regressions. * Doing this for frequently run scripts is important, as they may fail in ways not caught by running them in CI. What: * Create CheckComposerLockUpToDateTest that fully tests the associated maintenance script. ** Move test case composer JSON files used by the LockFileCheckerTest class into the 'phpunit/data' folder instead of placing them in the same directory to allow the new test class to use these files too. Bug: T371167 Change-Id: Id473ef440c6b7f8ecbb1c869f9cc0cf98705a0e9
* / / Test deleteOldRevisions.phpDreamy Jazz2024-08-292-6/+10
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * Maintenance scripts in core are mostly untested and testing them will help to avoid regressions. ** For example, in testing the script a bug is found where the Maintenance::purgeRedundantText method will throw an unexpected exception if no valid rows exist in the content_address table. What: * Create DeleteOldRevisionsTest that fully tests the associated maintenance script. * Update Maintenance::purgeRedundantText to not attempt to use an empty list as the value provided to IReadableDatabase::getExpr. ** Add a regression test for this. Bug: T371167 Change-Id: Id0c3c5d6fe56bc9fe5d5347c82dab9ab61137f58
* | Merge "docs: Set SORT_GROUP_NAMES=YES in Doxyfile"jenkins-bot2024-08-291-1/+1
|\ \
| * | docs: Set SORT_GROUP_NAMES=YES in DoxyfileTimo Tijhof2024-08-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current order is decided based on whatever order Doxygen encountered the `@defgroup myname Title Here` commands when recursively traversing the source code directories (INPUT). By default, it is not based on the identifier (group name) or display label (group title), which means we end up with the following on doc.wikimedia.org: * API * Recent changes (!) * Change tagging * Debug * ExternalStorage * Profiling * ExtensionRegistry (!) * ResourceLoader * Upload * Maintenance (!) Because internally these are traversed as: * includes/api * includes/changes * includes/registration * maintenance/ But that's by no means known, relevant, or intuitive to a reader of the docs; even for contributors that know where the files are, they probably don't realize that maintenance/ comes after all includes. Bug: T364652 Change-Id: I3f03ae5bcc902aa2df020b7d5aa404c42829320c
* | | Exclude boilerplate maintenance code from code coverage reportsDreamy Jazz2024-08-27224-0/+878
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * Maintenance scripts in core have bolierplate code that is added before and after the class to allow directly running the maintenance script. * Running the maintenance script directly has been deprecated since 1.40, so this boilerplate code is only to support a now deprecated method of running maintenance scripts. * This code cannot also be marked as covered, due to PHPUnit not recognising code coverage for files. * Therefore, it is best to ignore this boilerplate code in code coverage reports as it cannot be marked as covered and also is for deprecated code. What: * Wrap the boilerplate code (requiring Maintenance.php and then later defining the maintenance script class and running if the maintenance script was called directly) with @codeCoverageIgnore comments. * Some files use a different boilerplate code, however, these should also be marked as ignored for coverage for the same reason that coverage is not properly reported for files. Bug: T371167 Change-Id: I32f5c6362dfb354149a48ce9c28da9a7fc494f7c
* | | Merge "installer: Support MW_SKIP_EXTERNAL_DEPENDENCIES in update.php"jenkins-bot2024-08-261-1/+1
|\ \ \
| * | | installer: Support MW_SKIP_EXTERNAL_DEPENDENCIES in update.phpTimo Tijhof2024-08-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This environment variable is already checked in TestSetup.php for PHPUnit runs by Quibble, when the job is running for a patch to the mediawiki/vendor repository. Right now, Quibble sets this var, but then has to separately pass `--skip-external-dependencies` to update.php as well. Remove the need for that by supporting the same environment variable so that Quibble can set it once for that run, and naturally applies by any commands where it makes sense. Bug: T370380 Change-Id: Iad7c8d4be9e81af0a0de11019a98804b232efa8b
* | | | Merge "Make use of the ??= and ?? operators where it makes sense"jenkins-bot2024-08-264-21/+8
|\ \ \ \
| * | | | Make use of the ??= and ?? operators where it makes sensethiemowmde2024-08-264-21/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This touches various production classes and maintenance scripts. The code should do the exact same as before. The main benefit is that the syntax avoids any repetition. Change-Id: I5c552125469f4d7fb5b0fe494d198951b05eb35f