aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | | | | Generate machine-readable block info in BlockErrorFormatterBartosz Dziewoński2025-02-183-64/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, BlockErrorFormatter would only generate a human-readable error message for permission errors caused by blocks, and PermissionManager would build a PermissionStatus object out of them. Machine-readable block info was added later: UserAuthority would add a Block object to each one, then finally each API module (via ApiBlockInfoTrait) would generate block info from these Block objects. Now all of this happens in BlockErrorFormatter and PermissionManager. For compatibility with older code, remove the extra information when using the deprecated PermissionManager::getPermissionErrors() method. This is a small hack that can be removed together with that method in the future. The changes seem to make a workaround for T357063 in ApiQueryInfo unnecessary (tests added in c55d33ef11 still pass). Bug: T357063 Change-Id: Id121d51a24fbb1d8210e60bdd54c61b16938dd70
* | | | | | | | | | Merge "notifications: switch no handler present exception to a warning"jenkins-bot2025-02-191-3/+4
|\ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | notifications: switch no handler present exception to a warningPiotr Miazga2025-02-191-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When there are no handlers system shouldn't fail with an exception. Bug: T383992 Change-Id: Ia33524af2574d10375f2cb0586bbdabd9d0adb48
* | | | | | | | | | | Merge "Add support for bottom dock menu"jenkins-bot2025-02-191-1/+1
|\ \ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | | Add support for bottom dock menuJon Robson2025-02-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Various extensions are using a menu currently in Vector 2022 To support other skins: primarily Vector legacy and Minerva this should be in core to make it easier for skins to adopt The menu can be extended via mw.util.addPortletLink or hook ``` $wgHooks['SkinTemplateNavigation::Universal'][] = function ( $t, &$s ) { $s['dock-bottom']['test'] = [ 'icon' => 'foo', 'text' => 'foo', 'href' => '/wiki/Foo' ]; }; ``` Bug: T385298 Change-Id: Ibabb872e9f95a0c0d3bfd201b7181e9f3a20399d
* | | | | | | | | | | | Merge "user: Implement batch user registration lookups"jenkins-bot2025-02-194-36/+263
|\ \ \ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | | | user: Implement batch user registration lookupsMáté Szabó2025-02-194-36/+263
| | |_|_|_|_|/ / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: - The TSP team would like to change the way expired temporary account user links are displayed, which requires an efficient way to fetch their registration timestamps. - On WMF wikis, which use CentralAuth, this requires fetching the first (i.e. global) registration timestamp of the account, rather than the naïve approach of using the registration timestamp from the local user table. - MediaWiki provides the UserRegistrationLookup facade to transparently fetch the earliest registration timestamp for a single user, but offers no batch interface to do the same. - Since user links are often rendered in large pagers, a batch interface is needed. What: - Add IUserRegistrationProvider::fetchRegistrationBatch(), which takes an iterable of UserIdentities and returns a map of their registration timestamps (or null if not available), keyed by user ID. Although this interface is marked as stable to implement, its sole non-core implementor according to codesearch is CentralAuth. - Add UserRegistrationLookup::getFirstRegistrationBatch(), which delegates to fetchRegistrationBatch() on configured registration providers and returns the earliest registration timestamp for each user in the batch. - To avoid potential interface incompatibility in WMF production, this depends on CentralAuth implementing the new IUserRegistrationProvider method first. Bug: T358469 Depends-On: Ibe28163e962161567d486607e36d999a36a1e604 Change-Id: I1f6af2693a8f0c5c854b8a6b04edd1eb21934007
* | | | | | | | | | | | Merge "ResourceLoader: Restore data provider names in testRespond()"jenkins-bot2025-02-191-1/+1
|\ \ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / / |/| | | | | | | | | | |
| * | | | | | | | | | | ResourceLoader: Restore data provider names in testRespond()Timo Tijhof2025-02-181-1/+1
| | |/ / / / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follows-up I804bda0590 (2dc2af1d289), after which information from test failures or slow tests in WMF CI became unactionable with output such as: ``` 1045ms to run ResourcesTest::testRespond with data set #369 1016ms to run ResourcesTest::testRespond with data set #120 663ms to run ResourcesTest::testRespond with data set #623 ``` Bug: T348676 Change-Id: If4eb83e8b4e10fa1bc42d621cf0e4287b4c88539
* | | | | | | | | | | Merge "ApiQuerySiteinfo: Support $wgGroupInheritsPermissions"jenkins-bot2025-02-191-2/+7
|\ \ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | | ApiQuerySiteinfo: Support $wgGroupInheritsPermissionsKevin Israel2025-02-191-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I noticed that the "confirmed" group was missing from the API result on en.wikipedia.org. It is defined using $wgGroupInheritsPermissions, not $wgGroupPermissions. Rather than only using the latter, obtain lists of user groups and granted permissions from UserGroupManager and GroupPermissionsLookup respectively (and not just for filtering undefined groups out of the lists of changeable groups). Bug: T357846 Change-Id: I473868449dcf360afcba3c731ac7f282b623b1cd
* | | | | | | | | | | | block: Add a BlockTarget class hierarchyTim Starling2025-02-1913-48/+594
| |_|_|_|/ / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Main change: * Add a class hierarchy representing block targets, representing a target and type. * Add BlockTargetFactory, replacing BlockUtils. * Add CrossWikiBlockTargetFactory, replacing BlockUtilsFactory. * Construct a BlockTarget object early in the request flow and pass it down through the layers, instead of having every layer interpret UserIdentity|string target specifications. Also: * Remove Block::TYPE_ID. Nothing uses it in code search, so there's no point in porting it to the new system. * Stop using the type constants as specificity scores. Add BlockTarget::getSpecificity(). * Add DatabaseBlockStore::newUnsaved() to replace direct construction of DatabaseBlock in insertBlock() callers. There are many such callers in tests. This is part of the effort to remove the service container usage in DatabaseBlock::__construct(). * Make DatabaseBlock::getRangeStart() and getRangeEnd() return null if the block is not a range, since that is convenient for their only caller following the resolution of T51504. * Add DatabaseBlock::getIpHex() which similarly maps to a DB field in the new schema. * In ApiBlock and ApiUnblock, have ParamValidator provide UserIdentity objects instead of converting to a string and back to a UserIdentity again. Bug: T382106 Change-Id: I2ce1a82f3fbb3cf18aa2d17986d46dbdcc70c761
* | | | | | | | | | | Merge "Re-apply "Use Remex for DeduplicateStyles transform""jenkins-bot2025-02-183-9/+9
|\ \ \ \ \ \ \ \ \ \ \ | |_|_|_|_|/ / / / / / |/| | | | | | | | | |
| * | | | | | | | | | Re-apply "Use Remex for DeduplicateStyles transform"Bartosz Dziewoński2025-01-103-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 7f63d5250e8db443d8fce3016abd9757521b590d, re-applying commit 82da9cf14be08e9458f58fa96be51966a2fe7cb1. It can be re-applied safely after T354361 was fixed. Most of the incidental changes from the original patch are no longer needed, as they were made unnecessary by other work, or were applied in I4cb2f29cf890af90f295624c586d9e1eb1939b95. Change-Id: I1ff9a7c94244bffffe5574c0b99379ed1121a86d
* | | | | | | | | | | Merge "REST: Transform: Validate responses against response schemas in tests"jenkins-bot2025-02-181-125/+190
|\ \ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | | REST: Transform: Validate responses against response schemas in testsAtieno2025-02-181-125/+190
| | |_|_|_|_|/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: T376607 Change-Id: I44bbba284e34e8ff53914d9a881598ccb5cb8aa8
* | | | | | | | | | | Merge "block: Fix vague target requirements in BlockPermissionChecker"jenkins-bot2025-02-182-26/+21
|\ \ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | | block: Fix vague target requirements in BlockPermissionCheckerTim Starling2025-02-132-26/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The doc comment of newBlockPermissionChecker() describes the $target parameter as being optional. The returned object does not need or use a target when checkBasePermissions() or checkEmailPermissions() are called. But failing to pass a target when calling checkBlockPermissions() is incorrect. This was the subject of the linked bug. If an admin is performing a block, self-unblock permissions need to be checked, this is not optional. This could be enforced at runtime, but it seems safer and simpler to enforce it statically. So, move $target from being a constructor parameter to being a formal parameter of checkBlockPermissions(). This formal parameter will be statically required after a deprecation period. Deprecate newBlockPermissionChecker() and introduce newChecker(), using a name with a slightly less than conventional verbosity to allow us to change the parameter order. There is no $target parameter to newChecker(). Backwards compatibility is supported by adding an internal mutator method setTarget(). This can easily be removed after the deprecation period is over. In Special:Block, checkBlockPermissions() was called with $target=null on form entry, meaning that the user could unblock themselves if the target was specified in the URL, but could not unblock themselves by searching with the form. This seems inconsistent. So allow blocked admins to see the search form, but show an error when they try to block or unblock someone other than themselves. Bug: T384716 Change-Id: I8c26cdcc9b87b74bc458fe731cf7f170a2607150
* | | | | | | | | | | | Merge "Hooks: Remove FauxGlobalHooksArray"jenkins-bot2025-02-182-76/+0
|\ \ \ \ \ \ \ \ \ \ \ \ | |_|_|_|_|_|_|_|/ / / / |/| | | | | | | | | | |
| * | | | | | | | | | | Hooks: Remove FauxGlobalHooksArraydaniel2025-02-182-76/+0
| | |_|_|_|_|_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: - $wgHooks should work like a regular configuration variable which cannot be modified after bootstrap. - FauxGlobalHooksArray was in place to trigger deprecation warnings for write access to $wgHooks since 1.40. What: - Remove FauxGlobalHooksArray and supporting code Bug: T331602 Change-Id: I8d881857850a906b893cf3066dcfbe277f9b0b14
* | | | | | | | | | | Merge "resourceloader: Remove getScriptURLsForDebug()"jenkins-bot2025-02-182-23/+0
|\ \ \ \ \ \ \ \ \ \ \ | |_|_|_|_|_|/ / / / / |/| | | | | | | | | |
| * | | | | | | | | | resourceloader: Remove getScriptURLsForDebug()Hannah Okwelum2025-02-172-23/+0
| | |_|/ / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: T367441 Change-Id: I16db275bf60b80954b7e271fbeb3a86a9b8bf11e
* | | | | | | | | | Merge "Add a built-in way to send notifications"jenkins-bot2025-02-181-0/+103
|\ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | Add a built-in way to send notificationsBartosz Dziewoński2025-02-121-0/+103
| | |_|_|_|_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create a provider pattern for sending notifications (T383992). There is no base notifications handler in core; they can only be provided by extensions. A handler in the Echo extension, compatible with the existing Echo notifications system, will be implemented in T383993. Co-Authored-By: Piotr Miazga <pmiazga@wikimedia.org> Bug: T383992 Change-Id: I16b309935c3d29c3cde4459b5e36abce063a8534
* | | | | | | | | | Merge "tests: Remove database clean up from SpecialUserRightsTest"jenkins-bot2025-02-181-7/+0
|\ \ \ \ \ \ \ \ \ \ | |_|_|_|_|_|/ / / / |/| | | | | | | | |
| * | | | | | | | | tests: Remove database clean up from SpecialUserRightsTestUmherirrender2025-02-141-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since I52ade87e2f0305e6f2be541df5b38c7d76c409a7 also changes to external domains are automatically tracked and resetted. Change-Id: I424b6954fd68dea7db783c2500e96bca5f104abf
* | | | | | | | | | block: Add $wgAutoblockExemptionsTaavi Väänänen2025-02-181-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new option to exempt users from autoblocks in the configuration, instead of editing a MediaWiki space page on every wiki. The use case for this is WMCS ranges (see T386689). Bug: T240542 Change-Id: I704b34b81214e7a1ac819fefa7ad3c2c87305647
* | | | | | | | | | block: Add test case for badly formatted AutoblockExemptionList entriesTaavi Väänänen2025-02-181-1/+2
| |_|_|/ / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I7f4cecd2ca3e3b06ba76f373837432a990c14e00
* | | | | | | | | Fix usage of toHtmlIsabelle Hurbain-Palatin2025-02-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since Ibffb2daaf817ce41102211bb9668b29a6e59c0c1, PageBundle::getHtml has been removed. It shouldn't be used in tests. Change-Id: I460e05b2095c354187678219d45f5488132005a4
* | | | | | | | | Fix ContentDOMTransformStageTest after PageBundle refactoringIsabelle Hurbain-Palatin2025-02-171-4/+2
| |_|/ / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since Ibffb2daaf817ce41102211bb9668b29a6e59c0c1, the document creation passes 'markNew' as a parameter, which allows non-Parsoid output to round-trip without data-parsoid or ids getting added to them. This patch adjusts the ContentTransformStageTest to take this into account, and sets markNew as true explicitly so that we do not depend on Parsoid vendor patch. Change-Id: I13bd1316ff22aba5672e500c3b07149d17843811
* | | | | | | | Merge "ExtensionRegistrationTest: move test set description to the right place"jenkins-bot2025-02-161-35/+19
|\ \ \ \ \ \ \ \
| * | | | | | | | ExtensionRegistrationTest: move test set description to the right placeDaimona Eaytoy2025-02-141-35/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use iterator keys to pass the test description, instead of a bespoke method parameter. Change-Id: I43dcc8469aae87c8df4de1cad1029b81e2a56dab
* | | | | | | | | Merge "phpunit: drop unused data provider in ExtensionProcessorTest"jenkins-bot2025-02-161-52/+0
|\ \ \ \ \ \ \ \ \
| * | | | | | | | | phpunit: drop unused data provider in ExtensionProcessorTestDaimona Eaytoy2025-02-131-52/+0
| | |_|/ / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added in I7074b65d07c5c7d and unused ever since. It was used until patch set 6, then ExtensionProcessor was refactored to support batching in PS7 and the tested method, `setToGlobal`, was removed together with its test but not this data provider. Change-Id: I31a07ec8ea320cd5dc946f881f380f603632619a
* | | | | | | | | Merge "PageUpdater: make it easy to create dummy revisions"jenkins-bot2025-02-153-21/+81
|\ \ \ \ \ \ \ \ \
| * | | | | | | | | PageUpdater: make it easy to create dummy revisionsdaniel2025-02-143-21/+81
| | |_|_|_|_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Creating dummy revisions was a fiddly multi-stage process. PageUpdater should just offer a method for doing it. Change how we create dummy revisions in: * LocalFile * MovePage * ImportReporter Bug: T198297 Bug: T384691 Change-Id: I4c7595ce24337ab637a4e0fdbb313fc77d452a15
* | | | | | | | | PermissionManager: Differentiate between cascading protection of file ↵Dylan F2025-02-143-10/+151
| |_|_|/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | content and file pages This patch reworks RestrictionStore::getCascadeProtectionSourcesInternal to return a third and fourth array: * One for cascading restrictions originating from templatelinks * Another for those originating from imagelinks They are used in PermissionManager::checkCascadingSourcesRestrictions to differentiate cascading protection of file content and file page, but could also be used in the future by action=info and other callers. Bug: T24521 Bug: T62109 Bug: T140010 Change-Id: Ia5863f418538106f4fd657c672298ff6ac835805
* | | | | | | | Merge "linker: Add process cache to UserLinkRenderer::userLink()"jenkins-bot2025-02-143-4/+71
|\ \ \ \ \ \ \ \
| * | | | | | | | linker: Add process cache to UserLinkRenderer::userLink()Máté Szabó2025-02-143-4/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: - Rendering user links via UserLinkRenderer::userLink() and its predecessor Linker::userLink() can be fairly expensive, so RecentChanges has been caching them since I91588aebae7e49e3d3cb77702cf28677b4a14c8d. - We would like to start rendering a custom tooltip for user links associated with temporary accounts, which requires returning a unique ID for each tooltip so that it can be associated with the corresponding link via an aria-describedby attribute for accessibility. - This won't work with the existing caching logic because it doesn't treat links differently. - Now that the UserLinkRenderer service exists, we can move the caching logic there instead and allow every page, not just RecentChanges, to automatically enjoy its benefits while transparently handling special cases like expired temporary account links. What: - Implement process caching for user links in UserLinkRenderer. - Replace Linker::userLink() with UserLinkRenderer in RCCacheEntryFactory, and remove the now-redundant local process cache. Bug: T358469 Change-Id: I0259e860c19f356ab66f45955f2997d307daa6e1
* | | | | | | | | Merge "block: Introduce AbstractBlock::isIndefinite"jenkins-bot2025-02-141-6/+17
|\ \ \ \ \ \ \ \ \ | |/ / / / / / / / |/| | | | | | | |
| * | | | | | | | block: Introduce AbstractBlock::isIndefiniteMartin Urbanec2025-02-141-6/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As far as I can see, the only way to determine whether a block has an expiry set is through comparing getExpiry() with the string 'infinity'. That feels fairly fragile, as well as really easy to make an error with. GrowthExperiments needs to introduce a specific behavior for only indefinitely blocked users. To be able to make that detection, the abovementioned method is being added. Bug: T351234 Change-Id: I85efcc71fe3a6d374b57abaefda8d1d370b41bd6
* | | | | | | | | Merge "Set correct merge strategy for $wgAddGroups and $wgRemoveGroups"jenkins-bot2025-02-141-0/+67
|\ \ \ \ \ \ \ \ \ | | |_|_|/ / / / / | |/| | | | | | |
| * | | | | | | | Set correct merge strategy for $wgAddGroups and $wgRemoveGroupsDaimona Eaytoy2025-02-141-0/+67
| | |_|/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are 2D lists, so the default array_merge will overwrite values instead of merging. Bug: T386210 Change-Id: Id001462b17ff43964af4f627ca40f07cb198eab2
* | | | | | | | Merge "tests: Remove unneeded warning suppression for RevisionStore"jenkins-bot2025-02-141-4/+4
|\ \ \ \ \ \ \ \ | |_|_|/ / / / / |/| | | | | | |
| * | | | | | | tests: Remove unneeded warning suppression for RevisionStoreBartosz Dziewoński2025-02-131-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Originally added in d6b989b as a Wikimedia\suppressWarnings() call, later copied to other tests and converted to use the `@` operator. No longer needed since 4d8dc6b, which replaced the wfWarn() calls it was suppressing. Change-Id: I574edd1ce9024164632e42b5e02e719f44e5e504
* | | | | | | | Merge "RevisionStore: Don't use a Title for archived revisions"jenkins-bot2025-02-131-0/+35
|\| | | | | | |
| * | | | | | | RevisionStore: Don't use a Title for archived revisionsdaniel2025-02-131-0/+35
| | |_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: - The title information stored in archived revisions may not represent a valid title by current standards. This will cause Title::isValid() to return false, which makes Title::canExist() return false, which causes the constructor of RevisionArchiveRecord to throw an assertion error. What: - Use a PageIdentityValue to represent the page the archived revision belongs to. PageIdentityValue doesn't perform validation or normalization, so it is unaffected by changes to configuration. Bug: T384628 Change-Id: I4cc1dabd9c7aee94e191f75addd44327788a5d13
* | | | | | | Merge "user: Use TS_MW to compare timestamps in UserRegistrationProvider"jenkins-bot2025-02-131-0/+49
|\ \ \ \ \ \ \
| * | | | | | | user: Use TS_MW to compare timestamps in UserRegistrationProviderUmherirrender2025-02-131-0/+49
| | |_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is valid to use TS_MW for chronological compare as the timestamp stored in a string is ordered from the most significant datetime information (year) to the lowest (seconds). It is not needed to convert to unix. It would not be valid to use TS_MW format to calculate time differents. This is how it is used in the database schema from mediawiki as well. Also replace array + min() with variable + if. Change-Id: Id41e660f3952876e20ac4e88502d7e2757299573
* | | | | | | Merge "Dummy revisions: add tests for event emission"jenkins-bot2025-02-137-19/+447
|\ \ \ \ \ \ \