Why:
* Maintenance scripts in core are mostly untested and testing them
will help to avoid regressions.
What:
* Create FixUserRegistrationTest that fully tests the associated
maintenance script.
Bug: T371167
Change-Id: Ifb3594f7dc0055568431002a9180df7db4da9692
Why:
* Maintenance scripts in core have low test coverage, and
increasing the test coverage will help avoid regressions and
bugs.
What:
* Create RenameUserTest which tests the renameUser.php
maintenance script for when invalid arguments are provided.
Bug: T371167
Change-Id: I778f45e74708d1ad25b8bda918f5c3ca03e4668d
Why:
* Maintenance scripts in core have low test coverage, and testing
them is important to avoid regressions and bugs.
What:
* Create ResetAuthenticationThrottleTest which tests the script
for invalid or missing options, as well as resetting the
throttles for temporary account creation and name acquiration.
Bug: T371167
Change-Id: Ied9619f12f3f41040b1837e0923f8c7fb345175c
Different skins have different values for <p>'s spacing making toggle
arrow hard to vertically align correctly with heading paragraph, this
resets it to the symmetric spacing of Vector-2010.
Admittedly this isn't that clean solution but the other solution
would be more intervention on the PHP and also LivePreview side,
turning parseAsBlock() to parse() and taking care of Wikibase
which can't be done in rush so let's have a temporarily fix
at least for now.
Bug: T373658
Change-Id: Ie0d8014d7716b11f04c7b0de782b8ce1d15ff0f7
> Given all called same-class methods are de-facto and liberally claimed,
> and that we keep the coverage limited to the subject class, it maintains
> the spirit and intent by listing the class as a whole instead.
>
> PHPUnit offers a more precise tool when you need it (i.e. when testing
> legacy monster/god classes), but for well-written code, the
> class-wide tag is exactly what you want.
>
> We lose useful coverage and waste valuable time on keeping tags
> accurate through refactors, especially private functions (or worse,
> forget to update it).
> Tracking tiny per-method details wastes time in realizing (and
> fixing) when people inevitably don't keep them in sync, and time
> lost in finding uncovered code to write tests to realize it was
> already covered but "not yet claimed".
Ref https://gerrit.wikimedia.org/r/q/owner:Krinkle+is:merged+message:Widen
Change-Id: If90fc5285a067ec8f706d87b2ba1ae85020e2ba0
Renames motivated by consistency/clarity include:
* onRollback() -> onRollbackInCriticalSection()
* onBeginTransaction() -> onBegin()
* newTrxId() -> onBeginInCriticalSection()
Make onBeginInCriticalSection() reuse resetTrxAtomicLevels().
Make resetTrxAtomicLevels() handle resetting trxAtomicCounter.
Add onSessionLoss() helper method. Relatedly, make consumeTrxId() private.
Move trxLevel() call in Database::begin() to TransactionManager::onBegin().
This better separates concerns (e.g. whether to error out early) and also
avoids a phan suppression line.
Change-Id: I784893d32b43529dd3ba7166cf01d87158935056
This is the preferred way to wait for replicas to catch up, where
as using direct IDatabase::commit() calls is discouraged. Note that
jobs already run with "outer transaction scope".
Change-Id: I8e5cbada2dd70d421e8c08626cd66a222da66e29
This avoids data bloat in feature usage logging and tracking,
reducing the chance of truncation, and makes it easier to search
these records.
Note that all uses of this method are tied to deprecated API
feature use reporting.
Bug: T313731
Change-Id: Ie097ad21959fbcedc33da407145a7aad573a361e
For decades MediaWiki has allowed "extra" px modifiers in image size
specifications, for example `100pxpx`. It has been suggested since at least
2008 (T15500#174968) that this behavior should be deprecated. This is
not localized, so (for example) on eowiki we allow `100rapx` as well (!).
As one small step toward eventually removing this weird corner case behavior
add a tracking category whenever it is used on wiki.
In the process, emit deprecation warnings for
ImageGalleryBase::setWidths() or ::setHeights() if called without
ImageGalleryBase::setParser() having been set. The ::setParser() method
already includes in its documentation that "If you do not set this and
the output of this gallery ends up in parser cache, the javascript will
break!", so please set the parser appropriately.
Bug: T15436
Bug: T15500
Bug: T372935
Change-Id: If86d949189a7d105595404d21447477499873b03
To be merged after the following change has been deployed: https://gerrit.wikimedia.org/r/1060893
Bug: T366271
Change-Id: I1dd9a91bc37e32bde15f52271fbea2580943ab99
Why:
* Maintenance scripts in core are mostly untested and testing them
will help to avoid regressions.
What:
* Create JSParseHelperTest that fully tests the associated
maintenance script.
Bug: T371167
Change-Id: I6ae5d9722169518dd19fd5136b12b7ecd6a22798
Why:
* Maintenance scripts in core are mostly untested and testing them
will help to avoid regressions.
What:
* Create MoveBatchTest that fully tests the associated maintenance
script.
Bug: T371167
Change-Id: I2244f46e34e81c98a2647e00b229ca68bc3d3568
Why:
* Maintenance scripts in core are mostly untested and testing them
will help to avoid regressions.
* Doing this for frequently run scripts is important, as they
may fail in ways not caught by running them in CI.
What:
* Create CheckComposerLockUpToDateTest that fully tests the
associated maintenance script.
** Move test case composer JSON files used by the LockFileCheckerTest
class into the 'phpunit/data' folder instead of placing them
in the same directory to allow the new test class to use these
files too.
Bug: T371167
Change-Id: Id473ef440c6b7f8ecbb1c869f9cc0cf98705a0e9
The ParserOutput::collectMetadata() method is used to transfer parsing
metadata from the legacy parser (ParserOutput) to Parsoid
(ContentMetadataCollecctor). Several new methods were added to Parsoid's
ContentMetadataCollector class but weren't being transferred from
the ParserOutput.
Change-Id: If2b933005c1ebd0f8b33884242a1c97b94f97a2b
Why:
* Maintenance scripts in core are mostly untested and testing them
will help to avoid regressions.
** For example, in testing the script a bug is found where the
Maintenance::purgeRedundantText method will throw an
unexpected exception if no valid rows exist in the
content_address table.
What:
* Create DeleteOldRevisionsTest that fully tests the associated
maintenance script.
* Update Maintenance::purgeRedundantText to not attempt to
use an empty list as the value provided to
IReadableDatabase::getExpr.
** Add a regression test for this.
Bug: T371167
Change-Id: Id0c3c5d6fe56bc9fe5d5347c82dab9ab61137f58
It doesn't seem necessary when viewing the docs on
api.php?action=help, but it causes ugly rendering when
Special:ApiHelp is transcluded on a page with an infobox,
e.g. https://www.mediawiki.org/wiki/Extension:TextExtracts.
Change-Id: I8afc12aa65309a4f61efa2bb40e51416aa011fce
Some wikis treat the category list from ParserOutput as a /set/, others
as an /ordered list/. For those who don't care about the order of
categories, provide the option for wikis to sort the categories
in OutputPage.
This can also be activated with a query parameter, `&sortcat=1`, which
is useful to the Parsoid team when doing visual diff testing to avoid
false positives caused by differences in category ordering.
Bug: T373480
Change-Id: Idd14650a1898c6a49c88441ef024ce3012903bbe
Extensions can use the ArticleParserOptions hook to customize the
parser options used for article read views, and Visual Editor uses
ApiParse to regenerate the article read view HTML after edit. In
order for VE to remain consistent with the original parse options,
provide a `usearticle` option to the parse API to allow it to invoke
the ArticleParserOptions hook.
Bug: T373212
Change-Id: I906affc8d2335b7bb48dff3a4b061fcf86b71cee