Commit graph

6 commits

Author SHA1 Message Date
Dreamy Jazz
e7393b3cc7 Exclude boilerplate maintenance code from code coverage reports
Why:
* Maintenance scripts in core have bolierplate code that is
  added before and after the class to allow directly running
  the maintenance script.
* Running the maintenance script directly has been deprecated
  since 1.40, so this boilerplate code is only to support a now
  deprecated method of running maintenance scripts.
* This code cannot also be marked as covered, due to PHPUnit
  not recognising code coverage for files.
* Therefore, it is best to ignore this boilerplate code in code
  coverage reports as it cannot be marked as covered and also
  is for deprecated code.

What:
* Wrap the boilerplate code (requiring Maintenance.php and then
  later defining the maintenance script class and running if the
  maintenance script was called directly) with @codeCoverageIgnore
  comments.
* Some files use a different boilerplate code, however, these
  should also be marked as ignored for coverage for the same
  reason that coverage is not properly reported for files.

Bug: T371167
Change-Id: I32f5c6362dfb354149a48ce9c28da9a7fc494f7c
2024-08-27 13:22:29 +01:00
Tim Starling
a5372218b7 block: Deprecate and stop using $wgBlockTargetMigrationStage
* Deprecate and stop using $wgBlockTargetMigrationStage. Remove
  block_target migration code.
* Make the $schema parameters to DatabaseBlockStore methods default to
  SCHEMA_BLOCK. Avoid passing these parameters where possible.
* Remove cleanupBlocks.php
* Deprecate DatabaseBlock static methods which try to present the old
  schema for b/c.

Bug: T362133
Change-Id: I845bad8cc09a4528fef46a6f9d490ebdec881d99
2024-05-10 15:54:17 +10:00
Derick Alangi
74033c50cd maintenance: Begin using Maintenance::getServiceContainer()
Maintenance class provides a method for getting a fresh reference
of the MW services container instance. Let's make use of these in
maintenance scripts now that we have it.

NOTE: There are still some static methods like in refreshLinks.php
that makes use of services that we can't use this method for now.

Change-Id: Idba744057577896fc97c9ecf4724db27542bf01c
2023-09-04 10:39:58 +00:00
Timo Tijhof
6c8b3e6022 maintenance: Cleanup purgeExpiredBlocks.php file header and @ingroup
* Fix odd deviation from GPL license header. It's the only file in
  MediaWiki core with that header text. Not sure where it comes form.

* Remove `ingroup` from file blocks in class files as otherwise
  the file is indexed twice (e.g. in Doxygen) which makes navigation
  more messy. Move it to the class block instead, matching similar
  changes. [1] Similarly, remove duplicate descriptions from file
  blocks in favour of class doc blocks. This reduces duplication and
  was often incorrect or outdated, and helps to make the file header
  more consistently visually ignorable.

[1] https://gerrit.wikimedia.org/r/q/message:ingroup+owner:Krinkle

Change-Id: I6c666bd04c2193c833491c7f0e1122a76e4ffe2c
2023-01-27 17:15:25 +00:00
Reedy
8b394d8d63 purgeExpiredBlocks.php: Update call to deprecated DatabaseBlock::purgeExpired()
Change-Id: Ifb5c26f7ae6fba786cd2f2d70258ac1ea823ecbd
2020-12-24 17:11:57 +00:00
DannyS712
c32f1bd419 Add purgeExpiredBlocks maintenance script
In case there aren't enough local block for purging to happen automatically

Bug: T257393
Change-Id: I866ac64219bf5f72a6e41ad32bafc5be9d2c89fa
2020-07-08 15:45:56 +00:00