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
Why:
- A few places in core should check the isKnown
flag (I4ce534a847461230f7fa276a565bdc1d6c9857e1) rather than isEnabled
What:
- Update ChangesListSpecialPage, UserGroupManager,
UserSelectQueryBuilder, WatchedItemQueryService,
ApiQuerySiteInfo, maintenance/expireTemporaryAccounts and
maintenance/userOptions to used the isKnown() config check
Bug: T356524
Change-Id: I5a88808c7297752c60f6e7ffe16cf6543d783269
The idea is similar to the one behind TempUser\Pattern::toLikeValue(),
which has been effectively deprecated by allowing multiple patterns.
Change-Id: Iddb284bff21355deb8ceaa6925d3c2aea34d727e
Why:
* The user_is_temp column exists in the user table to allow finding
temporary users when reading from the DB directly.
* This column was added in f283c0e990,
but this was not written to until
6e68107b3a which was several months
later and after a release version was branched.
* As such, we need a maintenance script to populate the user_is_temp
column for wikis that have enabled temporary account creation.
What:
* Add a maintenance script named populateUserIsTemp.php which
populates the user_is_temp column by looking for rows in the
user table that have user_is_temp as 0 and have user_name match
at least one temporary account match pattern. These rows are then
updated to have user_is_temp as 1.
* This script will be added to update.php in a future commit, so that
betawikis can have this run manually.
* Create unit tests and an integration test for this maintenance
script.
Bug: T355181
Change-Id: I6223496d7aee65e3ab207fe86e386b01bef8b388