Commit graph

126294 commits

Author SHA1 Message Date
jenkins-bot
7eaeffdbfe Merge "Test fixUserRegistration.php" 2024-08-30 20:14:20 +00:00
jenkins-bot
5984c36efd Merge "Start on tests for renameUser.php" 2024-08-30 20:14:09 +00:00
jenkins-bot
5fa154cce9 Merge "Start on tests for resetAuthenticationThrottle.php" 2024-08-30 20:14:02 +00:00
jenkins-bot
618c745106 Merge "Fix vertical align of collapsibleFooter toggle across skins" 2024-08-30 17:56:06 +00:00
Dreamy Jazz
05c7a34fa6 Test fixUserRegistration.php
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
2024-08-30 17:39:11 +01:00
Dreamy Jazz
3bcf2cae8c Start on tests for renameUser.php
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
2024-08-30 16:35:30 +00:00
Dreamy Jazz
62943e496f Start on tests for resetAuthenticationThrottle.php
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
2024-08-30 16:35:24 +00:00
Ebrahim Byagowi
dad6613ff0 Fix vertical align of collapsibleFooter toggle across skins
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
2024-08-30 19:18:18 +03:30
jenkins-bot
b5a1f97c2e Merge "Revision,Storage: Widen @covers tags in tests" 2024-08-30 12:08:24 +00:00
jenkins-bot
d7a2a2bf56 Merge "recentchanges: Move rcfeed/ to includes/recentchanges/RCFeed/" 2024-08-30 09:03:43 +00:00
Translation updater bot
d23abdc88d
Localisation updates from https://translatewiki.net.
Change-Id: I2ae92158d62ee51967518a9bf2eca32cb45fa43b
2024-08-30 09:01:05 +02:00
Timo Tijhof
311b2d0e98 Revision,Storage: Widen @covers tags in tests
> 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
2024-08-30 04:23:11 +00:00
jenkins-bot
ceeae9b74b Merge "rdbms: remove deprecated MaintainableDBConnRef class" 2024-08-30 01:49:13 +00:00
jenkins-bot
f8d7dbef37 Merge "rdbms: only mention write queries in "writes pending" warnings" 2024-08-30 01:32:06 +00:00
jenkins-bot
b41d85c371 Merge "rdbms: add nullity safety check to DBConnRef::ensureConnection()" 2024-08-30 01:31:58 +00:00
jenkins-bot
74fe73097c Merge "rdbms: rename and reorganize some TransactionManager helper methods" 2024-08-30 01:31:51 +00:00
jenkins-bot
ea42edfe29 Merge "RenameUser: Make RenameUserJob use commitAndWaitForReplication()" 2024-08-30 01:24:02 +00:00
Aaron Schulz
3833d2d3d3 rdbms: remove deprecated MaintainableDBConnRef class
Bug: T373655
Change-Id: I1d1ccb862d4356af146ee39f0fd4081acd82a9ce
2024-08-30 01:19:51 +00:00
jenkins-bot
c88a79d45c Merge "rdbms: clarify comment in DatabaseFactory::create() and rename helper method" 2024-08-30 01:09:06 +00:00
Aaron Schulz
786aa3ebba rdbms: rename and reorganize some TransactionManager helper methods
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
2024-08-30 00:53:22 +00:00
Aaron Schulz
fb8bea33c0 RenameUser: Make RenameUserJob use commitAndWaitForReplication()
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
2024-08-30 00:52:35 +00:00
Aaron Schulz
1e138c9340 api: make ApiMain::getUserAgent() only use api-user-agent when set
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
2024-08-30 00:38:29 +00:00
jenkins-bot
26dc737733 Merge "Add double-px-category tracking category for deprecated image size syntax" 2024-08-29 23:58:32 +00:00
jenkins-bot
c3213fee6e Merge "phpunit: Replace trivial wfParseUrl use with parse_url()" 2024-08-29 23:27:07 +00:00
jenkins-bot
83a075b4fb Merge "Modify namespace translation for Mongolian (mn)" 2024-08-29 22:15:24 +00:00
jenkins-bot
3f154a6d63 Merge "Remove Y2K38 limit from reverse chronology pager" 2024-08-29 22:15:13 +00:00
jenkins-bot
e544e3b279 Merge "Test jsparse.php" 2024-08-29 22:11:03 +00:00
C. Scott Ananian
0450b5e4d5 Add double-px-category tracking category for deprecated image size syntax
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
2024-08-29 17:54:38 -04:00
jenkins-bot
86513d046b Merge "Test moveBatch.php" 2024-08-29 21:45:13 +00:00
jenkins-bot
c146b77a12 Merge "Test checkComposerLockUpToDate.php" 2024-08-29 21:42:44 +00:00
jenkins-bot
0febc69369 Merge "Translate special page names into Polish" 2024-08-29 21:41:14 +00:00
Srishakatux
8a6567d159 Modify namespace translation for Mongolian (mn)
To be merged after the following change has been deployed: https://gerrit.wikimedia.org/r/1060893

Bug: T366271
Change-Id: I1dd9a91bc37e32bde15f52271fbea2580943ab99
2024-08-29 21:01:39 +00:00
jenkins-bot
ab18e47057 Merge "Test deleteOldRevisions.php" 2024-08-29 20:59:11 +00:00
Dreamy Jazz
05e6bdce58 Test jsparse.php
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
2024-08-29 20:51:56 +00:00
Dreamy Jazz
276d4d0092 Test moveBatch.php
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
2024-08-29 20:51:19 +00:00
jenkins-bot
ee66b9e0c2 Merge "Add missing cases to ParserOutput::collectMetadata()" 2024-08-29 20:30:44 +00:00
Dreamy Jazz
b380904c66 Test checkComposerLockUpToDate.php
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
2024-08-29 20:18:39 +00:00
C. Scott Ananian
550f916fa9 Add missing cases to ParserOutput::collectMetadata()
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
2024-08-29 15:51:54 -04:00
jenkins-bot
4f323be830 Merge "api: Use MW_INSTALL_PATH in ApiBase" 2024-08-29 18:59:34 +00:00
Dreamy Jazz
06ccac8c49 Test deleteOldRevisions.php
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
2024-08-29 18:54:19 +00:00
jenkins-bot
57777e1c08 Merge "Test purgeOldText.php" 2024-08-29 18:41:51 +00:00
jenkins-bot
2273a27c93 Merge "Remove 'clear: both;' from headings in generated API docs" 2024-08-29 17:52:10 +00:00
jenkins-bot
01abfbfcbd Merge "Add option to sort categories in OutputPage" 2024-08-29 17:03:13 +00:00
jenkins-bot
4474aaf440 Merge "Allow ApiParse to use the ArticleParserOptions hook" 2024-08-29 17:00:00 +00:00
Bartosz Dziewoński
7de0666843 Remove 'clear: both;' from headings in generated API docs
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
2024-08-29 18:53:46 +02:00
C. Scott Ananian
493df826b9 Add option to sort categories in OutputPage
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
2024-08-29 12:20:19 -04:00
C. Scott Ananian
9dbce134c6 Allow ApiParse to use the ArticleParserOptions hook
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
2024-08-29 11:33:35 -04:00
jenkins-bot
f78d2f950d Merge "docs: Set SORT_GROUP_NAMES=YES in Doxyfile" 2024-08-29 15:20:20 +00:00
jenkins-bot
ceb2e9b2bd Merge "Revert "auth: Relax AuthManager session state check while cde00b55 is deployed"" 2024-08-29 14:57:20 +00:00
Msz2001
1b667a735d Translate special page names into Polish
Change-Id: Ibb3de5f1ec0faaf9dba1866c49e2d8b9aa10aa37
2024-08-29 14:07:15 +00:00