The codehealth job for MW core is quite slow: overall, it's slower than the normal test checks, with an average of ~20 minutes apparently. By looking at the output for this random patch, there are two things that stand out immediately:
- First, it looks like sonar is never using the cache, even if it's enabled:
19:30:12 INFO: Starting PHP symbol indexer 19:30:12 INFO: 4613 source files to be analyzed 19:30:22 INFO: 486/4613 files analyzed, current file: includes/libs/rdbms/lbfactory/LBFactorySingle.php 19:30:32 INFO: 846/4613 files analyzed, current file: tests/phpunit/structure/AutoLoaderStructureTest.php 19:30:42 INFO: 1298/4613 files analyzed, current file: includes/libs/filebackend/FileBackendMultiWrite.php 19:30:52 INFO: 1808/4613 files analyzed, current file: includes/MainConfigSchema.php 19:31:02 INFO: 2238/4613 files analyzed, current file: includes/language/converters/UzConverter.php 19:31:12 INFO: 2682/4613 files analyzed, current file: tests/phpunit/integration/includes/user/TempUser/RealTempUserConfigTest.php 19:31:22 INFO: 3097/4613 files analyzed, current file: includes/libs/objectcache/wancache/WANObjectCache.php 19:31:32 INFO: 3531/4613 files analyzed, current file: includes/MediaWiki.php 19:31:42 INFO: 4024/4613 files analyzed, current file: tests/phpunit/includes/session/SessionManagerTest.php 19:31:52 INFO: 4430/4613 files analyzed, current file: tests/phpunit/includes/filerepo/file/FileTest.php 19:31:58 INFO: 4613/4613 source files have been analyzed 19:31:58 INFO: Cached information of global symbols will be used for 0 out of 4613 files. Global symbols were recomputed for the remaining files. 19:31:59 INFO: Starting PHP rules 19:31:59 INFO: 4613 source files to be analyzed 19:32:09 INFO: 290/4613 files analyzed, current file: includes/import/WikiImporter.php 19:32:19 INFO: 517/4613 files analyzed, current file: includes/block/BlockRestrictionStore.php 19:32:29 INFO: 709/4613 files analyzed, current file: includes/collation/data/first-letters-root.php 19:32:39 INFO: 928/4613 files analyzed, current file: tests/phpunit/includes/Revision/RevisionStoreDbTest.php 19:32:49 INFO: 1209/4613 files analyzed, current file: includes/libs/lockmanager/MemcLockManager.php 19:32:59 INFO: 1491/4613 files analyzed, current file: includes/installer/PostgresUpdater.php 19:33:09 INFO: 1769/4613 files analyzed, current file: tests/phpunit/includes/parser/ParserCacheSerializationTestCases.php 19:33:19 INFO: 2020/4613 files analyzed, current file: includes/linker/Linker.php 19:33:29 INFO: 2288/4613 files analyzed, current file: includes/upload/UploadStash.php 19:33:39 INFO: 2579/4613 files analyzed, current file: languages/messages/MessagesTly.php 19:33:49 INFO: 2810/4613 files analyzed, current file: maintenance/rebuildtextindex.php 19:33:59 INFO: 3055/4613 files analyzed, current file: maintenance/compareLanguageConverterOutput.php 19:34:09 INFO: 3297/4613 files analyzed, current file: tests/phpunit/includes/filebackend/FileBackendIntegrationTest.php 19:34:19 INFO: 3537/4613 files analyzed, current file: tests/phpunit/includes/Status/StatusTest.php 19:34:29 INFO: 3838/4613 files analyzed, current file: includes/api/ApiQuery.php 19:34:39 INFO: 4106/4613 files analyzed, current file: includes/page/WikiPage.php 19:34:49 INFO: 4332/4613 files analyzed, current file: includes/Output/OutputPage.php 19:34:59 INFO: 4584/4613 files analyzed, current file: tests/phpunit/includes/session/UserInfoTest.php 19:35:03 INFO: 4613/4613 source files have been analyzed 19:35:03 INFO: The PHP analyzer was able to leverage cached data from previous analyses for 0 out of 4613 files. These files were not parsed.
- Second, sonar spent 6 minutes and 40 seconds (!) running the TextAndSecretsSensor (which I assume looks for passwords etc?), checking i18n files in the process. Is this something we actually want/need and is worth almost 7 minutes of wait time?
19:35:04 INFO: Sensor TextAndSecretsSensor [text] 19:35:04 INFO: 6731 source files to be analyzed 19:35:14 INFO: 180/6731 files analyzed, current file: includes/installer/i18n/mk.json 19:35:24 INFO: 297/6731 files analyzed, current file: includes/installer/i18n/sl.json 19:35:34 INFO: 467/6731 files analyzed, current file: languages/i18n/vi.json 19:35:44 INFO: 635/6731 files analyzed, current file: languages/i18n/mn.json 19:35:54 INFO: 844/6731 files analyzed, current file: languages/i18n/mt.json 19:36:04 INFO: 937/6731 files analyzed, current file: includes/installer/i18n/lt.json 19:36:14 INFO: 1161/6731 files analyzed, current file: languages/i18n/cv.json 19:36:24 INFO: 1269/6731 files analyzed, current file: languages/i18n/szy.json 19:36:34 INFO: 1440/6731 files analyzed, current file: includes/api/ApiQueryAllLinks.php 19:36:44 INFO: 1639/6731 files analyzed, current file: languages/i18n/bdr.json 19:36:54 INFO: 1783/6731 files analyzed, current file: includes/editpage/Constraint/UserRateLimitConstraint.php 19:37:04 INFO: 2025/6731 files analyzed, current file: languages/i18n/vmw.json 19:37:14 INFO: 2210/6731 files analyzed, current file: languages/i18n/tt-latn.json 19:37:24 INFO: 2325/6731 files analyzed, current file: languages/i18n/sr-ec.json 19:37:34 INFO: 2456/6731 files analyzed, current file: languages/i18n/ti.json 19:37:44 INFO: 2686/6731 files analyzed, current file: languages/i18n/cy.json 19:37:54 INFO: 2819/6731 files analyzed, current file: languages/i18n/tk.json 19:38:04 INFO: 3037/6731 files analyzed, current file: languages/i18n/exif/bn.json 19:38:14 INFO: 3193/6731 files analyzed, current file: languages/i18n/qqq.json 19:38:24 INFO: 3387/6731 files analyzed, current file: languages/i18n/sah.json 19:38:34 INFO: 3586/6731 files analyzed, current file: languages/messages/MessagesCy.php 19:38:44 INFO: 3732/6731 files analyzed, current file: languages/i18n/sk.json 19:38:46 WARN: Invalid character encountered in file /workspace/src/tests/phpunit/unit/includes/tidy/html5lib-tests.json at line 3623 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'. 19:38:54 INFO: 3901/6731 files analyzed, current file: includes/ServiceWiring.php 19:39:04 INFO: 4060/6731 files analyzed, current file: languages/i18n/gor.json 19:39:14 INFO: 4228/6731 files analyzed, current file: languages/i18n/ruq-latn.json 19:39:24 INFO: 4403/6731 files analyzed, current file: languages/i18n/bs.json 19:39:34 INFO: 4521/6731 files analyzed, current file: languages/i18n/tay.json 19:39:44 INFO: 4658/6731 files analyzed, current file: languages/messages/MessagesKsw.php 19:39:54 INFO: 4848/6731 files analyzed, current file: includes/Storage/DerivedPageDataUpdater.php 19:40:04 INFO: 5029/6731 files analyzed, current file: languages/i18n/myv.json 19:40:14 INFO: 5213/6731 files analyzed, current file: languages/i18n/exif/or.json 19:40:24 INFO: 5353/6731 files analyzed, current file: includes/libs/rdbms/database/replication/MysqlReplicationReporter.php 19:40:34 INFO: 5482/6731 files analyzed, current file: languages/i18n/et.json 19:40:44 INFO: 5675/6731 files analyzed, current file: languages/i18n/kcg.json 19:40:54 INFO: 5830/6731 files analyzed, current file: languages/i18n/rue.json 19:41:04 INFO: 5998/6731 files analyzed, current file: includes/installer/i18n/cs.json 19:41:14 INFO: 6172/6731 files analyzed, current file: includes/content/ContentHandler.php 19:41:24 INFO: 6372/6731 files analyzed, current file: languages/i18n/tg-cyrl.json 19:41:34 INFO: 6521/6731 files analyzed, current file: languages/i18n/rmc.json 19:41:44 INFO: 6731/6731 source files have been analyzed 19:41:44 INFO: Sensor TextAndSecretsSensor [text] (done) | time=400114ms