Commit graph

17316 commits

Author SHA1 Message Date
jenkins-bot
75571982bf Merge "phpunit: Set much smaller defaults for RandomImageGenerator" 2024-09-05 20:14:13 +00:00
jenkins-bot
570dff2990 Merge "Add tracking category resolution to Parsoid DataAccess" 2024-09-05 20:08:10 +00:00
thiemowmde
ca453df37e phpunit: Set much smaller defaults for RandomImageGenerator
This class is not used very often:
https://codesearch.wmcloud.org/search/?q=RandomImageGenerator
But in these tests it's a serious bottleneck. For no good reason. We
don't really care how an image looks like during a test. Nobody will
ever see it. Not even when a test fails.

Bug: T225730
Change-Id: I7f3d586144ecdf480c773dc5e8b10f1ad4df8861
2024-09-05 19:48:36 +00:00
jenkins-bot
9722ca09d7 Merge "Hide Special:UserRights link in tools menu when user is a temp user" 2024-09-05 11:58:06 +00:00
Dreamy Jazz
aaacde27b6 Hide Special:UserRights link in tools menu when user is a temp user
Why:
* The "Tools" menu contains a link to Special:UserRights.
* In 4da1989b63 this was updated to
  not display the "Change user groups" link for a temporary user
* However, we should also hide the link for a temporary account.

What:
* Update Skin::buildNavUrls to not add the link to
  Special:UserRights if the user is a temporary account.

Bug: T373988
Change-Id: Ib7d94c6cd5fb213c2bac7b55b8e77c4930e8f5d3
2024-09-05 12:05:20 +01:00
jenkins-bot
7ffa04d155 Merge "Remove UIDGenerator, deprecated since 1.35" 2024-09-05 11:01:25 +00:00
jenkins-bot
3ff7fbbdfa Merge "upload: Add missing documentation to class properties" 2024-09-05 07:03:13 +00:00
jenkins-bot
4a95543279 Merge "Storage: Remove transaction cancel callback from NameTableStore" 2024-09-04 23:54:56 +00:00
jenkins-bot
1062845a48 Merge "objectcache: Remove ReplicatedBagOStuff, deprecated since 1.42" 2024-09-04 20:49:48 +00:00
Ebrahim Byagowi
c0d1f7694c objectcache: Remove ReplicatedBagOStuff, deprecated since 1.42
Bug: T352481
Change-Id: I4e1ee5680b7ba0207dfe30a1208db35eca07e218
2024-09-04 20:21:29 +00:00
Hannah Okwelum
70e0417c2d Resourceloader: Enable methods that stores and retrieves dependency during test
This was intially disabled in I6c54466e9517d98. Now we use HashBagOStuff during test which doesn't use any database interaction.
So it's okay to enable them now.

Bug: T343492
Change-Id: I0413fc9e302085f27ea9e00eafee23858126426b
2024-09-04 20:15:03 +00:00
Umherirrender
bc1af02d62 upload: Add missing documentation to class properties
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: I07ce1f37d1bfb18d6e73dd008a712b3ca60a80e9
2024-09-04 20:09:32 +00:00
jenkins-bot
d15ce4589e Merge "Make SpecialUserRights::userCanChangeRights not accept temp users" 2024-09-04 18:40:50 +00:00
jenkins-bot
8c683a26bd Merge "Prevent cross-wiki assignment of groups to temporary accounts" 2024-09-04 18:36:37 +00:00
Dreamy Jazz
4da1989b63 Make SpecialUserRights::userCanChangeRights not accept temp users
Why:
* SpecialUserRights::userCanChangeRights is used by
  Skin::buildNavUrls to determine whether to display a link to
  Special:UserRights for a user
* Special:UserRights does not allow temporary accounts, so the
  aformentioned method should return false if the name is a
  temporary account to not add the navigational link.

What:
* Return false from SpecialUserRights::userCanChangeRights if the
  provided target user is a temporary account.
* Add some tests for SpecialUserRights::userCanChangeRights to
  verify this behaviour.

Bug: T373988
Change-Id: Ib960c0ae0a04650acfb17d273389f151a04672a2
2024-09-04 15:18:54 +00:00
Dreamy Jazz
b4ce1e3f05 Prevent cross-wiki assignment of groups to temporary accounts
Why:
* On wiki farm installs, it is possible that temporary accounts
  are enabled on wiki but not another wiki
* Special:UserRights can assign groups to users on other wikis
* This currently allows temporary accounts to be assigned groups
  from a wiki where the feature is disabled and not known.
* The Special:UserRights page should disallow this by preventing
  cross-wiki assignment of rights when the target username is
  reserved by the temporary accounts system.
** This works because the reserved pattern is accessible even when
   the feature is not known
** Furthermore, the reserved pattern is expected to be set for all
   wikis in the farm if one wiki has temporary accounts enabled,
   so that the temporary account cannot be created on wikis which
   have the feature disabled.

What:
* Update SpecialUserRights::saveUserGroups and ::fetchUser to
  reject usernames when:
** The wiki ID for the username is not local
** Temporary accounts are not enabled on the wiki
** TempUserConfig::isReservedName returns true for the username
* Add a test to verify that temporary accounts cannot be given
  user groups by the special page.
* Testing the changes made in this commit will be difficult as it
  requires having a second wiki set up, and this is not done in
  CI (which makes the test non-blocking for CI).

Bug: T372046
Change-Id: I2d60c5b3322caa4629b4e73c0b0b525fd1028946
2024-09-04 15:26:25 +01:00
Amir E. Aharoni
3353abe82c Add plural forms for Levantine Arabic
Bug: T363690
Change-Id: I9d451e1fa53424ccccb1ef0df21e28fc1d2cfdf4
2024-09-04 13:35:57 +00:00
Ebrahim Byagowi
f903bae012 Remove UIDGenerator, deprecated since 1.35
Change-Id: I5e47ecd560218df7e48af68e6aee351bc2a57823
2024-09-04 14:38:30 +03:30
jenkins-bot
2a9b9675e2 Merge "build: Use inline ignore for Generic.CodeAnalysis.AssignmentInCondition" 2024-09-04 11:07:40 +00:00
jenkins-bot
5e258de06e Merge "tests: Use const for some static data in test files" 2024-09-04 00:51:07 +00:00
jenkins-bot
45e790aa69 Merge "Indicate IP contributions are legacy when temporary accounts enabled" 2024-09-03 23:23:38 +00:00
jenkins-bot
3b1c9bca23 Merge "Expand ProtectTest" 2024-09-03 18:37:46 +00:00
jenkins-bot
0feebaab4e Merge "Test validateRegistrationFile.php" 2024-09-03 17:13:20 +00:00
jenkins-bot
f6c944ce54 Merge "Test changePassword.php" 2024-09-03 16:44:40 +00:00
jenkins-bot
02ccf6f6a7 Merge "Test makeTestEdits.php" 2024-09-03 16:44:32 +00:00
jenkins-bot
79e3c005ac Merge "Test parse.php" 2024-09-03 16:20:44 +00:00
jenkins-bot
c33e2c3b16 Merge "Test getReplicaServer.php" 2024-09-03 16:20:36 +00:00
jenkins-bot
f48e9e34a8 Merge "Test runJobs.php" 2024-09-03 16:15:06 +00:00
jenkins-bot
e51961ecc2 Merge "Test LoggedUpdateMaintenance" 2024-09-03 15:23:30 +00:00
jenkins-bot
c029c7a891 Merge "auth: Split TemporaryPasswordPrimaryAuthenticationProviderTest cases" 2024-09-03 13:53:17 +00:00
Dreamy Jazz
b1c13e3dfb Test LoggedUpdateMaintenance
Why:
* The LoggedUpdateMaintenance class is not tested and testing it
  will help avoid regressions/bugs.

What:
* Create LoggedUpdateMaintenanceTest

Bug: T371167
Change-Id: I84f5399bf67cc98d7c731d75ee668481ce0817b2
2024-09-03 10:21:04 +01:00
Umherirrender
c28ffec986 tests: Use getNewTempFile to simplify test setup
Avoid own teardown as MediaWikiIntegrationTestCase tracks the file and
delete the file on teardown

Remove unused tempnam (added unused in 3db119428a)

Change-Id: Ic53398c89c885f1c263dfcdbc59f6129f605f5a7
2024-09-02 21:14:48 +02:00
jenkins-bot
ea7005551f Merge "search: Replace IResultWrapper::fetchObject()/next() with foreach loop" 2024-09-02 18:42:38 +00:00
Máté Szabó
b9a7704e54 auth: Split TemporaryPasswordPrimaryAuthenticationProviderTest cases
Why:

- TemporaryPasswordPrimaryAuthenticationProviderTest currently combines
  multiple test cases within a single test method, leading to
  duplication and making the tests harder to grok.

What:

- Split the test cases within the test class to use either data
  providers or separate methods where the inputs cannot be provided via
  a data provider.
- Make getProvider() stateless and initialize the $manager and $validity
  fields unconditionally via a setup hook to avoid confusing null errors
  if attempting to manipulate these fields prior to obtaining a provider
  instance.

Bug: T328718
Change-Id: I3e53d06ec5bde6a8f842f5caed5cdbad883f7afd
2024-09-02 16:52:23 +02:00
Dreamy Jazz
cad3bd1703 Test changePassword.php
Why:
* Maintenance scripts in core have low test coverage
* Improving this will reduce the chances of regressions and bugs

What:
* Create ChangePasswordTest

Bug: T371167
Change-Id: Ia61283e4121f1130607ba103202e2e1a500f1cb2
2024-09-02 11:49:00 +00:00
Dreamy Jazz
c38ce01267 Test makeTestEdits.php
Why:
* Maintenance scripts in core have low test coverage
* Improving this will reduce the chances of regressions and bugs

What:
* Create MakeTestEditsTest which fully tests the script

Bug: T371167
Change-Id: If71c09eea96c4b0fbf522162de3a5ed09a5770f6
2024-09-02 10:20:02 +00:00
Dreamy Jazz
5a5a28f817 Expand ProtectTest
Why:
* Maintenance scripts in core have low test coverage
* Improving this will reduce the chances of regressions and bugs
* Some files are mostly covered, and expanding their associated
  tests should fully cover them or at least further improve
  coverage.

What:
* Expand ProtectTest

Bug: T371167
Change-Id: Iff86988967d8a69d71353fea4ba72705062aa95f
2024-09-02 10:16:03 +00:00
Dreamy Jazz
477168c8c9 Test validateRegistrationFile.php
Why:
* Maintenance scripts in core have low test coverage
* Improving this will reduce the chances of regressions and bugs

What:
* Create ValidateRegistrationFileTest

Bug: T371167
Change-Id: Icba4650a0d3f6af3d597628753af292f522e5456
2024-09-02 10:12:00 +00:00
Dreamy Jazz
845e73f80c Test parse.php
Why:
* Maintenance scripts in core have low test coverage
* Improving this will reduce the chances of regressions and bugs

What:
* Create CLIParserTest which does not yet test parsoid parsing
  using the script.

Bug: T371167
Change-Id: I8852d9c9889e7bfef814ce28ef7d6efe375095e2
2024-09-02 10:09:34 +00:00
Dreamy Jazz
23ab9f7005 Test runJobs.php
Why:
* Maintenance scripts in core have low test coverage
* Improving this will reduce the chances of regressions and bugs

What:
* Create RunJobsTest

Bug: T371167
Change-Id: I478c23440e4b0b373e9be41dee37de6460e7962e
2024-09-02 10:09:20 +00:00
Dreamy Jazz
856da14475 Test getReplicaServer.php
Why:
* Maintenance scripts in core have low test coverage
* Improving this will reduce the chances of regressions and bugs

What:
* Create GetReplicaServerTest

Bug: T371167
Change-Id: I24fdda83c8a9c2ea0ad1dbbd1f9c90bb61a81439
2024-09-02 10:08:41 +00:00
Umherirrender
0a69e0bc53 tests: Use const for some static data in test files
Change-Id: Id7ccd48e3bf626095e2d3929831b5d87ed0be948
2024-09-01 23:24:11 +02:00
jenkins-bot
53936dc79c Merge "utils: Add missing documentation to class properties" 2024-09-01 15:19:10 +00:00
Umherirrender
574e8b702c utils: Add missing documentation to class properties
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.

Improve a mixed type to string

Change-Id: Id994553eaeac181775ac782423ff53928ad45466
2024-09-01 14:40:01 +00:00
jenkins-bot
104e1c05c8 Merge "filerepo: Add missing documentation to class properties" 2024-09-01 13:42:26 +00:00
Umherirrender
20dadba5be filerepo: Add missing documentation to class properties
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: Ifbc2ce0c68865c5d32689e56c6215a5099f7478b
2024-09-01 12:09:37 +00:00
Umherirrender
e44aee1f74 auth: Add missing documentation to class properties
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: Ib6081f5519d2294bb14f81bf399f9c45315f2b69
2024-09-01 11:27:45 +02:00
Umherirrender
be39a18332 build: Use inline ignore for Generic.CodeAnalysis.AssignmentInCondition
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
2024-09-01 00:15:10 +02:00
Umherirrender
cfa2cf73ff search: Replace IResultWrapper::fetchObject()/next() with foreach loop
Avoid assigment in conditions
foreach starts at begin of iterator, the while loop can process the next
from within the result, but all the iterator in search are rewinded
before iterator starts

Change-Id: I38b2729418e8389c681c6cd84858f5e5ed25bd3e
2024-08-31 23:58:02 +02:00
jenkins-bot
684496b621 Merge "Message: Add more tests for serialization and unserialization" 2024-08-30 22:13:07 +00:00