This is a re-submit of 35da1bbd7c, which was accidentally merged before
CR (and reverted with aa4da3c2e8).
The purge() method handles purging of both file cache and CDN, using
a PRESEND deferred update. This avoids code duplication and missing
file cache purge calls.
Also:
* Migrate HTMLCacheUpdate callers to just directly using HTMLCacheUpdateJob
* Add HtmlFileCacheUpdate class and defer such updates just like with CDN
* Simplify HTMLCacheUpdate constructor parameters
* Remove BacklinkCache::clear() calls which do nothing since the backlink
query does not actually happen until the job runs
Bug: T230025
Change-Id: Ic1005e70e2c22d5bd1ca36dcdb618108ebe290f3
The class was already documented as "given a list of URLs or Title
instances", this makes that work.
Title objects will have ->getCdnUrls() called when the update is
resolved, which avoids problems like those encountered in T240083 where
that was being called too early.
Bug: T240083
Change-Id: I30b29a7359a8f393fb19ffc199211a421d3ea4d9
From 1% of lines to 12% in deferred/.
From 6% of lines to 68% in DeferredUpdates.php.
* Adding relevant @covers tags to existing tests.
* Add coverage for MWCallableUpdate.
* Add coverage for MergeableUpdate.
Also:
* Make MergeableUpdate extend DeferrableUpdate.
1. Because PHPUnit doesn't support implementing multiple interfaces
in a mock, and would make the mock fail the typehint at run-time.
2. It DeferredUpdates doesn't support having a MergeableUpdate that isn't
itself a DeferrableUpdate given the only way to reach that code is past
methods that are type-hinted with DeferrableUpdate.
3. Making the interface extend DeferrableUpdate helps produce better and
earlier errors. Instead of run-time error:
> Argument 1 passed to addUpdate() must implement interface DeferrableUpdate
> instance of MergeableUpdate given
We get:
> Fatal error: Class .. contains 1 abstract method and must therefore be
> declared abstract or implement the remaining methods (doUpdate)
Change-Id: Ie384bf849a96bb37dc3e4a4154da2b02889e9fc8
Replaces \TestingAccessWrapper (defined in core) with
\Wikimedia\TestingAccessWrapper (defined in the composer package
wikimedia/testing-access-wrapper).
See https://gerrit.wikimedia.org/r/#/q/topic:librarize-testing-access-wrapper
for downstream patches.
The core version of the class is kept around for a while to avoid
circular dependency problems.
Bug: T163434
Change-Id: I52cc257e593da3d6c3b01a909e554a950225aec8