Page MenuHomePhabricator

CI failure on TemplateStyles: Still uses removed Content::getHtml()
Closed, ResolvedPublic

Description

CI failure on extension TemplateStyles - for example https://gerrit.wikimedia.org/r/c/mediawiki/extensions/TemplateStyles/+/725479 - https://integration.wikimedia.org/ci/job/quibble-vendor-mysql-php72-noselenium-docker/111646/console

It seems after merge of https://gerrit.wikimedia.org/r/c/mediawiki/core/+/714561 the extension is broken, because it extends TextContent and provides a getHtml function.

There were 2 errors:

1) TemplateStylesContentTest::testGetParserOutput with data set #0 ('Template:Test/styles.css', 'sanitized-css', '.hello { content: 'world'; co...<ok>\n', '<pre class="mw-code mw-css" d...</pre>', array(array('Unexpected end of stylesheet ...ter 1.', 'Invalid or unsupported value ...er 35.')))
ReflectionException: Method TextContent::getHtml() does not exist

/workspace/src/includes/content/TextContentHandler.php:234
/workspace/src/includes/content/ContentHandler.php:1691
/workspace/src/includes/content/AbstractContent.php:602
/workspace/src/includes/content/AbstractContent.php:560
/workspace/src/extensions/TemplateStyles/includes/TemplateStylesContent.php:144
/workspace/src/tests/phpunit/includes/content/TextContentTest.php:71
/workspace/src/tests/phpunit/MediaWikiIntegrationTestCase.php:452
=== Logs generated by test case
[objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
[localisation] [debug] LocalisationCache using store LCStoreNull []
[MessageCache] [debug] MessageCache using store {class} {"class":"HashBagOStuff"}
[objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
[localisation] [debug] LocalisationCache using store LCStoreNull []
[ContentHandler] [info] Registered handler for sanitized-css: TemplateStylesContentHandler []
[localisation] [debug] LocalisationCache using store LCStoreNull []
[objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
[wfDebug] [debug] ParserFactory: using default preprocessor {"private":false}
[localisation] [debug] LocalisationCache::isExpired(en): cache missing, need to make one []
[objectcache] [debug] fetchOrRegenerate(wikidb-unittest_:page:10:7eb27132f40869253d0e37dc3ad9efa8a6d4f59a): miss, new value computed []
[ContentHandler] [info] Registered handler for wikitext: WikitextContentHandler []
[MessageCache] [debug] MessageCache using store {class} {"class":"HashBagOStuff"}
===

2) TemplateStylesContentTest::testGetParserOutput with data set #1 ('Template:Test/styles.css', 'sanitized-css', '/* hello [[world]] */\n', '<pre class="mw-code mw-css" d...</pre>', array(array(array(0))))
ReflectionException: Method TextContent::getHtml() does not exist

/workspace/src/includes/content/TextContentHandler.php:234
/workspace/src/includes/content/ContentHandler.php:1691
/workspace/src/includes/content/AbstractContent.php:602
/workspace/src/includes/content/AbstractContent.php:560
/workspace/src/extensions/TemplateStyles/includes/TemplateStylesContent.php:144
/workspace/src/tests/phpunit/includes/content/TextContentTest.php:71
/workspace/src/tests/phpunit/MediaWikiIntegrationTestCase.php:452
=== Logs generated by test case
[objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
[localisation] [debug] LocalisationCache using store LCStoreNull []
[MessageCache] [debug] MessageCache using store {class} {"class":"HashBagOStuff"}
[objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
[localisation] [debug] LocalisationCache using store LCStoreNull []
[ContentHandler] [info] Registered handler for sanitized-css: TemplateStylesContentHandler []
[localisation] [debug] LocalisationCache using store LCStoreNull []
[objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
[wfDebug] [debug] ParserFactory: using default preprocessor {"private":false}
[localisation] [debug] LocalisationCache::isExpired(en): cache missing, need to make one []
[MessageCache] [debug] MessageCache using store {class} {"class":"HashBagOStuff"}

Event Timeline

Not sure if only CI is broken or this is a issue for production. I have added the deployment task to get at least attention about this question.

Change 725483 had a related patch set uploaded (by Zabe; author: Zabe):

[mediawiki/extensions/TemplateStyles@master] Move TemplateStylesContent::getHtml() into the content handler

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

Change 725484 had a related patch set uploaded (by Umherirrender; author: Umherirrender):

[mediawiki/core@master] Call getHtml on the content object, not TextContent

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

Change 725485 had a related patch set uploaded (by Ppchelko; author: Ppchelko):

[mediawiki/core@master] Call ::getHtml on provided content, not just TextContent

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

Change 725485 abandoned by Ppchelko:

[mediawiki/core@master] Call ::getHtml on provided content, not just TextContent

Reason:

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

Change 725484 merged by jenkins-bot:

[mediawiki/core@master] Call getHtml on the content object, not TextContent

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

Umherirrender claimed this task.
Umherirrender triaged this task as High priority.
Umherirrender removed a project: Patch-For-Review.
Jdforrester-WMF renamed this task from CI failure on extension TemplateStyles to CI failure on TemplateStyles: Still uses removed Content::getHtml().Oct 5 2021, 11:59 PM

Change 725483 abandoned by Zabe:

[mediawiki/extensions/TemplateStyles@master] Move TemplateStylesContent::getHtml() into the content handler

Reason:

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