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:
- When disabling temporary accounts, the wiki operator may wish to also
expire active temporary accounts.
What:
- Provide an override of the config setting for 'expireAfterDays' in the
maintenance script. Setting a value of "--expiry=0" will expire all
temporary accounts
Bug: T356524
Change-Id: I7313ce947d7d4de340418d145a9bdd15910403e8
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
Why:
Temporary accounts (introduced as part of IP Masking)
are supposed to expire 1 year after their registration.
Automatic account expiration can be done via a maintenance
script, which would be periodically executed via cron / systemd.
Make it possible for extensions to provide their own logic
for generating a list of temporary accounts to invalidate.
This is used in CentralAuth to base registration timestamp
on the global registration timestamp.
The default behavior is "temporary accounts do not expire",
given the feature requires a maintenance script to run
periodically, which will not be the case on third party
instances.
What:
* Add `expireAfterDays` to $wgAutoCreateTempUser, controlling
how many days temporary accounts have.
* Add UserSelectQueryBuilder::whereRegisteredTimestamp(),
filtering accounts based on user_registration.
* Add ExpireTemporaryAccounts maintenance script, which is
@stable to extend.
Bug: T344695
Change-Id: If17bf84ee6620c8eb784b7d835682ad5e7afdfcc