aboutsummaryrefslogtreecommitdiffstats
path: root/maintenance
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Add script to delete a user email's addressSamuel Guebo2021-09-271-0/+66
| | | | | | | | | | | | | | | | | | | | | | | | Can be used for a variety of operations including preservation of users privacy. Bug: T290099 Change-Id: Iad75810310c95e96b5f8998b201ed04ace5af656
* | | Merge "UndeletePage cleanup, part 1"jenkins-bot2021-09-271-5/+0
|\ \ \
| * | | UndeletePage cleanup, part 1Daimona Eaytoy2021-09-211-5/+0
| | | | | | | | | | | | | | | | | | | | Bug: T290021 Change-Id: Idaf25a209a65b9a36a0a24473c76523ee3a17e8d
* | | | Merge "Move code from PageArchive to a new UndeletePage command"jenkins-bot2021-09-271-1/+1
|\| | | | |/ / |/| |
| * | Move code from PageArchive to a new UndeletePage commandDaimona Eaytoy2021-09-211-1/+1
| |/ | | | | | | | | | | | | | | This is just moving code verbatim, removing now-unneeded stuff, and duplicating tests as well. Bug: T290021 Change-Id: I540ddaaa11dfabcf0b87b608b151b5e34d199fd8
* | Merge "Chinese Conversion Table Update 2021-2"jenkins-bot2021-09-2510-85/+130
|\ \
| * | Chinese Conversion Table Update 2021-2Chiefwei2021-09-2010-85/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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: I14fc68ae8f6792e24127aaa93f6fe7aa1f786a26
* | | docs: Fix nullable documentation for class propertiesUmherirrender2021-09-241-2/+2
| | | | | | | | | | | | Change-Id: I6d0577124d852103f485ffdc819876a13f6641c3
* | | sql.php: Fix typosReedy2021-09-231-2/+2
| |/ |/| | | | | Change-Id: I8de1d70039390a3e204dddac9d445187b4bf554d
* | Merge "objectcache: Avoid getCurrentTime() call in MapCacheLRU::has()"jenkins-bot2021-09-171-3/+33
|\ \
| * | objectcache: Avoid getCurrentTime() call in MapCacheLRU::has()Timo Tijhof2021-09-101-3/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | == Background During a parse request [1] for a popular Wikipedia article, there are 180,949 calls to MapCacheLRU::has and 188,542 calls to ::getCurrentTime via ::getAge. (Note, getCurrentTime has more calls than ::has, as there are also calls via ::set and ::setField). In a one-off XHGui profile, these calls had 246ms wall-time or 258ms cpu-time attributed to them, which is 0.25s of a 12s parse or 2%. In a day's worth of index.php samples [2] [3], there is 1.1% cpu-time or 1.4% wall-time attributed to MapCacheLRU, of which ~0.3% in getCurrentTime() alone. == Change Most uses of MapCacheLRU are without any in-process TTL, and thus have $maxAge at its default of INF. Avoid calling getAge and getCurrentTime in that case. I think long-term it might make sense to deprecate the TTL feature in MapCacheLRU, as it is very very rarely used, and still adds significant overhead to all uses MapCacheLRU and its set() code path. For cases where in-process TTLs are really needed, the HashBagOStuff class could be used instead. I can't find any complex uses of get/setFields, let alone with per-sub field TTL, but a theoretical or third-party use case could potentially use HashBagOStuff with sub-fields either as their own key, or refactor to put arrays under a single key and TTL, or re-create it in their own code base if really needed. == Difference I've added a benchmark since generating random values and populating MapCacheLRU seems non-trivial enough to be worth a re-usable bench. Using `benchmarkLruHash.php --method get --count 1000`, before: > MapCacheLRU::get with 500 keys > count: 100 > rate: 28.5/s > mean: 35.06ms ... and after: > count: 100 > rate: 35.6/s > mean: 28.10ms [1] POST en.wikipedia.org /w/api.php?action=parse&title=Barack_Obama&text={{:Barack_Obama}} [2] https://performance.wikimedia.org/arclamp/svgs/daily/2021-09-06.excimer.index.reversed.svgz [3] https://performance.wikimedia.org/arclamp/svgs/daily/2021-09-06.excimer-wall.index.reversed.svgz Bug: T275673 Change-Id: Id8c747f0d0a9454274c296090a2ca80e440f97bb
* | | Merge "WikiExporter: inject services"jenkins-bot2021-09-161-1/+7
|\ \ \
| * | | WikiExporter: inject servicesAlexander Vorwerk2021-09-061-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch injects services into WikiExporter. It also adds a WikiExporterFactory service for creating WikiExporter instances. Change-Id: Ib1547defea54c309865c116bc83d617c21568843
* | | | Emit deprecation warnings reading from $wgUserDannyS7122021-09-1510-27/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this patch deprecation warnings will be emitted if $wgUser is accessed or written into. The only pattern of usage still allowed is $oldUser = $wgUser; $wgUser = $newUser; // Do something $wgUser = $oldUser; Once there is no deprecation warnings, we know that nothing legitimately depends on $wgUser being set, so we can safely remove the code that's still allowed as well. Bug: T267861 Change-Id: Ia1c42b3a32acd0e2bb9b0e93f1dc3c82640dcb22
* | | | Using @return never documentation on always-throw-functionUmherirrender2021-09-073-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This helps phan to detect unreachable code and also impossible types after the functions. It helps phan to avoid false positives for array keys when the keys are checked before Bug: T240141 Change-Id: I895f70e82b3053a46cd44135b15437e6f82a07b2
* | | | build: Update mediawiki/mediawiki-phan-config to 0.11.0Umherirrender2021-09-075-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Addition and remove of suppression needs to be done with the version update. Change-Id: I3288b3cefa744b507eadebb67b8ab08c86517c1c
* | | | Merge "Remove unreachable code after exception/die/exit"jenkins-bot2021-09-074-6/+1
|\ \ \ \
| * | | | Remove unreachable code after exception/die/exitUmherirrender2021-09-034-6/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: Ia81903fb2a8157625fbe63115097eccc1161b5db
* | | | | Merge "renameRestrictions.php: Update protected_titles as well"jenkins-bot2021-09-061-4/+11
|\ \ \ \ \
| * | | | | renameRestrictions.php: Update protected_titles as wellMartin Urbanec2021-09-051-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Restriction names are used in two tables, we should update both. Bug: T290398 Change-Id: Ic5e77ee451f12acfd0c69afe9a5c498885ffeaa5
* | | | | | Merge "Remove unneeded variable assignment"jenkins-bot2021-09-042-4/+1
|\ \ \ \ \ \
| * | | | | | Remove unneeded variable assignmentUmherirrender2021-09-032-4/+1
| | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | The variable already has the value Change-Id: I75f25cc944e30d91a65e1d2bb0abce7d671b19b8
* | | | | | collation: Create CollationFactory serviceUmherirrender2021-09-041-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use ObjectFactory specs for collation classes Avoid the language construction in the factory class, make it a detail of the implementation of each class Follow-Up of Ifc96f851e6091ce834dbaf0e91695c648a42169c Bug: T286079 Change-Id: Ib581f64aec8619986fb8dd49ceee0524d59a1b84
* | | | | | Cleanup mixed space/tab line indentUmherirrender2021-09-045-11/+11
|/ / / / / | | | | | | | | | | | | | | | Change-Id: I833052a656b1ce419c0929f6f0514f2a33c2c4cc
* | | | | ExternalStoreDB: Rename getMaster to getPrimaryJames D. Forrester2021-09-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Bug: T282894 Change-Id: I6d6361a0b84f7130a27df6a6c75a983c73e5dd95
* | | | | Miscellaneous master -> primary switches for private functions and variablesJames D. Forrester2021-09-031-3/+3
|/ / / / | | | | | | | | | | | | Change-Id: I5c90822f1da6af7354ee7e2d67d579bd72bce8c3
* | | | Merge "tables.json: add a missing space after period"jenkins-bot2021-09-021-1/+1
|\ \ \ \
| * | | | tables.json: add a missing space after periodDannyS7122021-09-021-1/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: Ia0b4fc6cf4c0e5f481461c383a66e68fe111f653
* | | | | IDatabase: Rename masterPosWait to primaryPosWaitJames D. Forrester2021-09-022-2/+2
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | Hard-deprecating immediately as no known users in git outside of mainteance scripts. Bug: T282894 Change-Id: I072f3d93a9598df719f76f635bfd477737097ad9
* | / / ILoadBalancer/ILBFactory: Rename commitMasterChanges() to commitPrimaryChanges()James D. Forrester2021-09-021-2/+2
| |/ / |/| | | | | | | | | | | Bug: T282894 Change-Id: I0d80be56e683924254c4e38d05e1109ea74eeab5
* | | Merge "fixMergeHistoryCorruption.php: use DB_REPLICA"jenkins-bot2021-08-311-2/+3
|\ \ \
| * | | fixMergeHistoryCorruption.php: use DB_REPLICATim Starling2021-08-311-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the replica DB for read queries. Bug: T263340 Change-Id: I5ab5706390dfc012c86bc18094c5baf457b8cbe8
* | | | Merge "Add typehints to several methods"jenkins-bot2021-08-312-4/+1
|\ \ \ \ | |/ / / |/| | |
| * | | Add typehints to several methodsDaimona Eaytoy2021-08-312-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These not only make the code more robust, but also help a lot when writing unit tests: if a method is return-typehinted and its class is mocked, the mock method will automatically return a mock of its declared return type. Otherwise it will return null, and developers are forced to manually mock the method if the return value is used by the SUT in a way that doesn't accept null. Depends-On: I628fcb1807133390c7b9b47984f512f5b1ae58d0 Depends-On: I7080bc505f5838b2f51a368da562104e206063b0 Change-Id: I59068cfed10aabf6c6002f9e9312a6ef6e7e9441
* | | | maintenance: Cleanup use of exit in Maintenance::execute implementationUmherirrender2021-08-3014-40/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Returning void from execute() is success. Returning true is success, false is failure with exit(1) Using fatalError also using exit(1) Change-Id: I1d40430ad6226e4aab8f0810b03ee1213282d123
* | | | Merge "Create new UserGroupManager::addUserToMultipleGroups method"jenkins-bot2021-08-301-3/+1
|\ \ \ \ | |/ / / |/| | |
| * | | Create new UserGroupManager::addUserToMultipleGroups methodTChin2021-08-301-3/+1
| | | | | | | | | | | | | | | | | | | | Bug: T287247 Change-Id: I40f560a2143a2c0fda8cb7233d9954dc645749a3
* | | | resourceloader: Define mw.loader in its own JS fileDannyS7122021-08-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove primary IIFE when setting mw.loader, which reduces indentation by an extra level. Futher cleanup will be done to the code for mw.loader.store in a follow-up. The fnv132() function, which is only used in the loader, was among the extra bits that were moved. Should have no effect on the functionality. Change-Id: Ie475879727e4170eb47f3fc78048379c7190844d
* | | | Merge "Avoid Status/StatusValue mismatch in syncFileBackend maintenance script"jenkins-bot2021-08-281-1/+1
|\ \ \ \
| * | | | Avoid Status/StatusValue mismatch in syncFileBackend maintenance scriptUmherirrender2021-08-271-1/+1
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | FileBackend::doQuickOperations is documented to return StatusValue, but syncFileBatch is documented to return Status. Change-Id: I5e9dc48bf43e96a18619a2290dd7995d5fdc7f0a
* | | | Merge "docs: Use interface instead of real types in documentation"jenkins-bot2021-08-282-2/+4
|\ \ \ \
| * | | | docs: Use interface instead of real types in documentationUmherirrender2021-08-262-2/+4
| |/ / / | | | | | | | | | | | | Change-Id: Ie555efd6f70762f4e085957d59306623570459a5
* / / / export: Fix false/null handling for fread in TextPassDumperUmherirrender2021-08-271-1/+1
|/ / / | | | | | | | | | | | | | | | | | | fread cannot return null, it returns false instead Avoid using null in a string concat Change-Id: Iae0ac52040335b1b39af7cace82e76f6cfd89ef0
* | | Merge "benchmarks: Remove old bench, document `perf -e instructions`"jenkins-bot2021-08-262-117/+24
|\ \ \
| * | | benchmarks: Remove old bench, document `perf -e instructions`Tim Starling2021-08-262-117/+24
| | | | | | | | | | | | | | | | | | | | | | | | <https://gerrit.wikimedia.org/r/c/mediawiki/core/+/713031> Change-Id: I60ec9a263a66747a1a5177584d3d04692f011e49
* | | | Merge "benchmarks: Set a default file in benchmarkJSMinPlus.php"jenkins-bot2021-08-262-7/+6
|\| | |
| * | | benchmarks: Set a default file in benchmarkJSMinPlus.phpTimo Tijhof2021-08-262-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes it easier to run, but more importantly, makes it obvious that the file in /data/jsmin is still conceptually in use. Change-Id: Iaf10c9bd2f6643bcb0bae95eaf22ec92de15950d
* | | | Merge "Add benchmark for Linker::formatComment() in preparation for refactor"jenkins-bot2021-08-266-2/+55
|\| | |
| * | | Add benchmark for Linker::formatComment() in preparation for refactorTim Starling2021-08-246-2/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Move data files to /data * Add benchmarkCommentFormatter, named for the new class hierarchy. Bug: T285917 Change-Id: Idf2529894fe63d34087d6d5ce4dd1676c89b1373
* | | | Merge "Same code style and formatting for exists-style SQL queries"jenkins-bot2021-08-244-13/+7
|\ \ \ \