Page MenuHomePhabricator

NewPP limit report no longer includes units and limits
Closed, ResolvedPublic

Description

(reported at https://en.wikipedia.org/wiki/Wikipedia:Village_pump_(technical)#NewPP_limit_report_change)

NewPP limit report no longer includes units and limits, for example on https://en.wikipedia.org/wiki/Golden_ratio:

CPU time usage: 2.016
Real time usage: 2.471
Preprocessor visited node count: 14645
Post‐expand include size: 370602

Expected rendering, copied from an old integration test https://gerrit.wikimedia.org/g/mediawiki/extensions/DiscussionTools/+/3a2e10588bae3a4e0a60bb1be20e72d245308c56/tests/cases/ar-nbsp-timezone-oldparser/ar-nbsp-timezone-oldparser.html:

CPU time usage: 0.112 seconds
Real time usage: 0.177 seconds
Preprocessor visited node count: 599/1000000
Post‐expand include size: 10641/2097152 bytes

Event Timeline

This is caused by rMWa3f51c732d5d: Refactor DefaultOutputTransform into a pipeline of transforms.

In addition to moving the code around, that commit also changed some uses of wfMessage to Message::newFromSpecifier. However, these functions are not the same – when given an array, Message::newFromSpecifier treats it as a message key and parameters, while wfMessage treats it as a message key and fallback message keys: https://gerrit.wikimedia.org/g/mediawiki/core/+/486c4075871625c4be752555ccddac22d2caf0d7/includes/GlobalFunctions.php#901

Specifically, the problem is in this line:
Old: https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+/a3f51c732d5d2d24ac205c0855df1e78abafb421~1/includes/ParserOutputTransform/DefaultOutputTransform.php#409
$valueMsg = wfMessage( [ "$key-value-text", "$key-value" ] )
New: https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+/a3f51c732d5d2d24ac205c0855df1e78abafb421/includes/OutputTransform/Stages/RenderDebugInfo.php#79
$valueMsg = Message::newFromSpecifier( [ "$key-value-text", "$key-value" ] )
As a result, localisation messages such as limitreport-postexpandincludesize-value are not used.

It should use Message::newFallbackSequence instead.

Change 984809 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/core@master] Fix showing units and limits in NewPP limit report

https://gerrit.wikimedia.org/r/984809

Change 984809 merged by jenkins-bot:

[mediawiki/core@master] Fix showing units and limits in NewPP limit report

https://gerrit.wikimedia.org/r/984809

Change 984501 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/core@wmf/1.42.0-wmf.10] Fix showing units and limits in NewPP limit report

https://gerrit.wikimedia.org/r/984501

Change 984501 merged by jenkins-bot:

[mediawiki/core@wmf/1.42.0-wmf.10] Fix showing units and limits in NewPP limit report

https://gerrit.wikimedia.org/r/984501

Mentioned in SAL (#wikimedia-operations) [2023-12-21T14:43:17Z] <lucaswerkmeister-wmde@deploy2002> Started scap: Backport for [[gerrit:984501|Fix showing units and limits in NewPP limit report (T353793)]]

Mentioned in SAL (#wikimedia-operations) [2023-12-21T14:44:57Z] <lucaswerkmeister-wmde@deploy2002> matmarex and lucaswerkmeister-wmde: Backport for [[gerrit:984501|Fix showing units and limits in NewPP limit report (T353793)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2023-12-21T14:52:45Z] <lucaswerkmeister-wmde@deploy2002> Finished scap: Backport for [[gerrit:984501|Fix showing units and limits in NewPP limit report (T353793)]] (duration: 09m 27s)