Commit graph

7386 commits

Author SHA1 Message Date
thiemowmde 07a04b74d7 Remove small pieces of unused code from SpecsFormatterTest
Change-Id: Ifbef4f3c73b5744dd1ead9df1743631753bd306a
2024-04-12 08:37:00 +00:00
jenkins-bot 6bdde6553b Merge "Fix new Phan errors" 2024-04-11 11:34:03 +00:00
Translation updater bot d51d4a014d Localisation updates from https://translatewiki.net.
Change-Id: I15d4293c9d3e0c49e57a34333505214b979570d0
2024-04-11 09:19:58 +02:00
Bartosz Dziewoński ac777ee88a Fix new Phan errors
MediaWiki core change Icb8822def9ce56f42ff52a8e469bb08d61d576c6
improved the type hints for OutputPage::addWikiMsg(), resulting in
two new errors:

* AbuseFilterViewEdit.php: False positive, update suppression
  to include new error code.

* SpecialAbuseLog.php: Genuine bug, the return value of
  Status::getErrors() can't be used directly as a message key.
  I have another change pending that introduces a nicer way
  to do this: Ibc4ce11594cf36ce7b2495d2636ee080d3443b04,
  but in the meantime, make do with the available getters.

Change-Id: Iee0e87496e27a5261adccb977361b3ccf4c9ee2c
2024-04-10 23:12:28 +00:00
Translation updater bot 5142ff49c4 Localisation updates from https://translatewiki.net.
Change-Id: Iff8a27e64cefb11a9d9b37d8face7ae8413fff2c
2024-04-10 09:20:07 +02:00
Translation updater bot 1aaec637b5 Localisation updates from https://translatewiki.net.
Change-Id: I5d2130b2405eb1456f1a672ff6c8fa74dbb158a1
2024-04-08 09:24:33 +02:00
Translation updater bot 3ee87ba924 Localisation updates from https://translatewiki.net.
Change-Id: I995884938d6c2348e73b74e1b94764bbb0736a93
2024-04-05 09:37:01 +02:00
Translation updater bot 47c5dfe417 Localisation updates from https://translatewiki.net.
Change-Id: Iac890b6e97650634baeb622474ebcb12b7160662
2024-04-04 09:36:19 +02:00
Translation updater bot 0574f7a75c Localisation updates from https://translatewiki.net.
Change-Id: Ibbeb6a21cc275f897e9c92ea40a685b95ef10a8f
2024-04-03 09:22:45 +02:00
Translation updater bot c689f4c61b Localisation updates from https://translatewiki.net.
Change-Id: Ib3bbc54e6056087f2f50c782f0eed9a04ec1f59b
2024-04-02 09:20:47 +02:00
Translation updater bot b7e4f17ff5 Localisation updates from https://translatewiki.net.
Change-Id: I84f42d4af5221d5e585176208ae0ecef9c5ff390
2024-04-01 09:22:01 +02:00
libraryupgrader 29bc5928a9 build: Updating dependencies
composer:
* php-parallel-lint/php-parallel-lint: 1.3.2 → 1.4.0

npm:
* eslint-config-wikimedia: 0.26.0 → 0.27.0

Change-Id: I49f3e6f619c6f3ba13f5167bc1c946c7fe601d27
2024-03-30 13:14:05 +00:00
jenkins-bot 5ece43538f Merge "logging: Inject services into AbuseLogHitFormatter" 2024-03-30 01:51:25 +00:00
Timo Tijhof 473b4b1ec4 tests: Remove redundant wgMainCacheType=hash
Introduced in 2019 with 4c8dac4dc6. Redundant since 2020 with
commit c6c62e2c8f in MediaWiki core.

Bug: T139216
Change-Id: I51e9fc3899cf5505917d7899a395350dd86f5c0b
2024-03-29 15:37:58 -07:00
Umherirrender 13cf3eb20a logging: Inject services into AbuseLogHitFormatter
Bug: T356468
Change-Id: I42023b7dcdaf80aeb3367d82068e1de47f8ae424
2024-03-29 21:53:34 +01:00
jenkins-bot ddf9864d21 Merge "Replace deprecated ChangeTags method calls with ChangeTagStore" 2024-03-29 18:58:32 +00:00
Matěj Suchánek 4c2b09fa4e Replace deprecated ChangeTags method calls with ChangeTagStore
Bug: T360664
Change-Id: Icd7c38be9a8b54c29da7d33dfa9691e1c94feeb1
2024-03-29 11:08:41 +01:00
Translation updater bot 09d6a0cc79 Localisation updates from https://translatewiki.net.
Change-Id: Ic78b451772a8be20c96416427987821e00355f8f
2024-03-28 08:30:47 +01:00
Translation updater bot b5e0cd9de8 Localisation updates from https://translatewiki.net.
Change-Id: I74652c6db936dedd25e03c5837cb818734efe553
2024-03-27 08:16:45 +01:00
jenkins-bot 8727b7a7b9 Merge "Reorder messages that describe operators" 2024-03-26 17:18:10 +00:00
Amir E. Aharoni f6eca362e5 Reorder messages that describe operators
Make the order of the messages that describe
operators and functions in the en.json file
identical to their order in
KeywordManager::BUILDER_VALUES, which is also
their order in the actual UI of the filter editor.

This only reorders the mesages in the en.json file.
It's not supposed to change anything in
the end users' experience, but it will change
the order in which translators on translatewiki.net
see them.

This is a cleanup step towards removing
the explicit operators from the messages,
as suggested in T360909, and this reordering
is hopefully useful even without that change,
for general consistency.

Comments about particular messages:
* abusefilter-edit-builder-vars-timestamp-expanded
  is moved to the very end because, despite its key,
  it's not actually used in the filter builder.
* old-text, old-html, and minor-edit are moved towards
  the end because they are outdated. They are listed
  separately from BUILDER_VALUES and they are not used
  in the filter builder UI, but they are used in the logs
  of previous actions. This patch adds a code comment
  for the benefit of developers who touch that code
  in the future.

Bug: T360909
Change-Id: I86ecdca5a6173b9068d5e968e69c57c74a379888
2024-03-26 11:22:46 -04:00
Translation updater bot 6a16b77475 Localisation updates from https://translatewiki.net.
Change-Id: Ic76660cafbdeec8e76b55e93e2f0b7f80e2fd627
2024-03-26 08:18:19 +01:00
jenkins-bot 430b7f81ad Merge "FilterLookup: Stop using DBAccessObjectUtils::getDBOptions()" 2024-03-25 18:20:52 +00:00
Translation updater bot bea46722c7 Localisation updates from https://translatewiki.net.
Change-Id: Id16b4e1173cee09287dbbe2bf160952f873b9cc9
2024-03-25 08:34:36 +01:00
Translation updater bot 082a6a63dd Localisation updates from https://translatewiki.net.
Change-Id: I3496e9f444837b833242df522e216fe912d1be73
2024-03-22 08:43:00 +01:00
Amir Sarabadani fe0fed1d8f FilterLookup: Stop using DBAccessObjectUtils::getDBOptions()
And more db clean ups:
 - Use QueryBuilders
 - Stop relying on actor migration to simplify query building
 - Using expression builder in one case.
 - Change the default actor migration stage to read new and write both.

Bug: T354194
Depends-On: I7c116cab0c748707d9a9fd17feeffe26e7d188ec
Depends-On: I74002911749335f4323a03fb430d02f936771b7e
Change-Id: Id84d1db7a2991f3cccc2f4f1502ba77643ddef24
2024-03-21 20:22:02 +01:00
Translation updater bot ca0b026d96 Localisation updates from https://translatewiki.net.
Change-Id: I68ed31138dcd71b9a58b519b4d5b018c678e671f
2024-03-21 08:53:37 +01:00
Translation updater bot e6806e6736 Localisation updates from https://translatewiki.net.
Change-Id: Icadf61c5bee5c1c47b0504b50f882878748ebe7e
2024-03-20 08:22:48 +01:00
Translation updater bot f1dd5c4c7a Localisation updates from https://translatewiki.net.
Change-Id: Ie2710f81c68bd66d8a076a62230a829e8111378b
2024-03-19 08:24:18 +01:00
Translation updater bot 255d7d9828 Localisation updates from https://translatewiki.net.
Change-Id: I4aed55d141508d85f532b6f1727e6dbfaca25147
2024-03-18 08:29:33 +01:00
jenkins-bot ccd31a4e7d Merge "build: Updating mediawiki/mediawiki-codesniffer to 43.0.0" 2024-03-16 19:21:29 +00:00
libraryupgrader a8c9fab2cc build: Updating mediawiki/mediawiki-codesniffer to 43.0.0
The following sniffs are failing and were disabled:
* MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic

Change-Id: I6075c76d53a899aac56af027f9a956a6b9e6a667
2024-03-16 18:53:05 +00:00
Dringsim f0e2af4dd7
Remove wfGetDB from comments
Bug: T357632
Change-Id: I658c2e4cf4b889075e944488501bba1bc197965a
2024-03-17 00:35:04 +08:00
Translation updater bot fb1273541e Localisation updates from https://translatewiki.net.
Change-Id: I3a7805936645900ef4c82436d5796fd259776b1a
2024-03-15 08:32:32 +01:00
jenkins-bot 2468019359 Merge "Silence warnings related to writes to CheckUser in AbuseLogger" 2024-03-14 13:20:36 +00:00
Translation updater bot 0f8f930266 Localisation updates from https://translatewiki.net.
Change-Id: I9720d18fc6e955915d8595fb9a60b8f635a186b8
2024-03-14 14:11:36 +01:00
jenkins-bot 647d5e3998 Merge "Type hint IReadableDatabase in AbuseFilterExaminePager" 2024-03-14 10:55:51 +00:00
Translation updater bot 51764af645 Localisation updates from https://translatewiki.net.
Change-Id: I97ebbd1f99804393e4f1307e766da32517677930
2024-03-14 09:01:59 +01:00
Umherirrender e2a3c62896 Type hint IReadableDatabase in AbuseFilterExaminePager
Change-Id: I21392e5f7fb0e2e69b6e1d8e0a3c770d5454efad
2024-03-13 22:36:42 +01:00
Translation updater bot e35fb1d945 Localisation updates from https://translatewiki.net.
Change-Id: I8c8826ff1a6e55645b406f5890dff4ac6b0ab186
2024-03-13 08:24:56 +01:00
Dreamy Jazz 8798b20369 Silence warnings related to writes to CheckUser in AbuseLogger
Why:
* The AbuseLogger::insertLocalLogEntries calls the CheckUser
  extension to insert the abuse filter log entries, so that
  checkusers can see these log entries in the results.
* However, these logs can be inserted on GET requests (such as
  when a filter matched a autocreation of an account). This means
  that the TransactionProfiler warns about writes.
* Updating the writes to occur on POSTSEND and also silencing the
  expectations about not performing write queries should prevent
  the logstash spam being caused by the TransactionProfiler related
  to this code.

What:
* Make the call to Hooks::updateCheckUserData occur on POSTSEND
  instead of PRESEND.
* Silence the TransactionProfiler for 'EXPECTATION_REPLICAS_ONLY'
  only for the call to Hooks::updateCheckUserData.

Bug: T359648
Change-Id: I08e1674ff4dca386c046374c77dd31b4b29bb41e
2024-03-12 15:12:58 +00:00
Translation updater bot 2962f63592 Localisation updates from https://translatewiki.net.
Change-Id: I9a041e8d877a536e30f0beb993ab05d72fbdfcb1
2024-03-11 08:25:47 +01:00
Umherirrender 5ab7282b4a Fix casing of dropdown-related methods
Methods gets renamed to lowercase variant in core (f1d7e68c)

Follow-Up: Ifda13ba9dee316709c424636ec3b285de8d0e9b1
Change-Id: I0ee5602536033268ff49aadf8d14320f8e5d03d2
2024-03-09 15:44:59 +01:00
jenkins-bot b9e6d0bc65 Merge "Add user_type variable" 2024-03-08 13:27:00 +00:00
Translation updater bot 4ebc556fcb Localisation updates from https://translatewiki.net.
Change-Id: I0b3fb687aad185d9c85a7ace0845f1b03bccd65d
2024-03-08 08:22:06 +01:00
Dreamy Jazz 85022190e5 Add user_type variable
Why:
* An AbuseFilter variable is needed that allows filters to determine
  what type the current user is. That is, whether the user is an
  IP address, temporary account, named user or external user.
* Currently filters implement this by inspecting the value in
  the 'user_name' variable, but this is likely to break when
  temporary accounts are enabled as IPs would be hidden.
* Giving a dedicated variable that indicates the type of the user
  allows filters to work out this information without having to
  know the specific username of the user before performing the
  check.

What:
* Add the 'user_type' variable which is lazily computed. It can have
  the value 'named', 'temp', 'ip' or 'external' depending on the
  type of the user. If the user does not match any of these, then
  the value is 'unknown'.
* Replace call to deprecated User::newFromIdentity with a use of the
  UserFactory service that is dependency injected.
* Add and update tests to ensure consistent test coverage.

Bug: T357615
Change-Id: Ifffa891879e7e49d2430a0330116b34c5a03049d
2024-03-07 10:38:25 +00:00
Translation updater bot 1672130d79 Localisation updates from https://translatewiki.net.
Change-Id: I39df98d92aee72eb56677fbfac9424a2c66847da
2024-03-07 08:47:40 +01:00
Derick Alangi 82d876ada8 Handlers: Drop AutoPromoteGroupsHandler::factory()
This patch solves a pending TODO which is to remove the ::factory()
method from the AutoPromoteGroupsHandler class. If the cache instance
is injected, we'll use it otherwise we'll default to a HashBagOStuff.

Bug: T358346
Change-Id: I2bc414da8733431d1d11025e954282fc7c73aa80
2024-03-06 21:38:12 +00:00
Translation updater bot bd7e10d5ac Localisation updates from https://translatewiki.net.
Change-Id: Ife7be6f220805056a2a39bb0923ae97dbfac23a5
2024-03-04 08:22:29 +01:00
Dreamy Jazz f4e3f78b7e Add integration test to verify logs are saved in CheckUser
Why:
* In f3c87749b8, the sending of logs
  to CheckUser when using a temporary account was fixed. As part
  of that change, it was suggested to add a test to verify that
  the call to `Hooks::updateCheckUserData` actually causes an
  insert into the relevant CheckUser result table.
* This change adds this test as a follow-up.

What:
* Create a test for the AbuseLogger that verifies that an event is
  sent to CheckUser and is saved into the DB for an abuse filter
  hit. This test is only run if the CheckUser extension is installed.

Bug: T358632
Change-Id: I33ed0810db13e38eacf4e682eb54d4ffcd583084
2024-03-01 16:11:33 +00:00