mediawiki-extensions-AbuseF.../tests/phpunit
Dreamy Jazz 774f4f02ef Create protected variable access logs POSTSEND
Why:
* The ProtectedVarsAccessLogger::logViewProtectedVariableValue
  method creates a debounced log entry for accessing protected
  variable values.
* This log can be created when a user calls the 'abuselog' query
  API. This API query is made using a GET request.
* Because the ProtectedVarsAccessLogger creates the log
  when it is called, the TransactionProfiler raises a warning
  about writing to the primary DB on a GET request.
* We should address this warning by creating the log entry on
  POSTSEND, in a similar way to how the CheckUser extension
  creates CheckUser log entries.

What:
* Wrap the call to ProtectedVarsAccessLogger::log in
  ::logViewProtectedVariableValue with a DeferredUpdate callback
  that is run POSTSEND.
** As part of this, the expectations that the code only uses the
   replica DBs are silenced inside the DeferredUpdate as the
   PostSend-GET expectations do not usually allow for writes.
   The only other method would to be create the log via a job,
   but we want the log creation to occur quickly and reliably.

Bug: T379083
Change-Id: If14e65b27b0bdd4fd0b99319024ffa281bf44656
2024-11-11 14:33:47 +00:00
..
integration Create protected variable access logs POSTSEND 2024-11-11 14:33:47 +00:00
unit Use explicit nullable type on parameter arguments (for PHP 8.4) 2024-10-26 14:38:46 +02:00
AbuseFilterConsequencesTest.php Use namespaced classes 2024-10-19 21:55:40 +02:00
AbuseFilterCreateAccountTestTrait.php Use explicit nullable type on parameter arguments (for PHP 8.4) 2024-10-26 14:38:46 +02:00
AbuseFilterFilterUserTest.php Use namespaced classes 2024-06-12 20:01:35 +02:00
AbuseFilterRowsAndFiltersTestTrait.php Convert af_hidden into a bitmask 2024-05-28 00:59:08 -07:00
AbuseFilterUploadTestTrait.php Update comment still mentioning setMwGlobals 2024-08-11 17:26:10 +02:00
ConsequenceGetMessageTestTrait.php Use ActionSpecifier to load the IP address 2022-12-17 22:52:24 +01:00
DegroupTest.php tests: Widen @covers tags in phpunit tests 2024-04-17 01:44:40 +01:00
LazyVariableComputerDBTest.php tests: Widen @covers tags in phpunit tests 2024-04-17 01:44:40 +01:00
RCVariableGeneratorTest.php Use explicit nullable type on parameter arguments (for PHP 8.4) 2024-10-26 14:38:46 +02:00
SchemaChangesHandlerTest.php Use namespaced classes 2024-06-12 20:01:35 +02:00