Page MenuHomePhabricator

CodexComponentUsageTest fails: Module::getDependencies requires $context argument
Closed, ResolvedPublic

Description

https://gerrit.wikimedia.org/r/c/mediawiki/extensions/CentralNotice/+/1329415
https://integration.wikimedia.org/ci/job/quibble-vendor-mysql-php83/104004/console

There was 1 error:

1) MediaWiki\Tests\Structure\CodexComponentUsageTest::testNoUnusedCodexComponents
$context is required for campaign mixins. [Called from CNChoiceDataResourceLoaderModule::getDependencies in /workspace/src/extensions/CentralNotice/includes/CNChoiceDataResourceLoaderModule.php at line 137]

/workspace/src/includes/Debug/MWDebug.php:486
/workspace/src/includes/Debug/MWDebug.php:195
/workspace/src/includes/GlobalFunctions.php:545
/workspace/src/extensions/CentralNotice/includes/CNChoiceDataResourceLoaderModule.php:137
/workspace/src/tests/phpunit/structure/CodexComponentUsageTest.php:112
/workspace/src/tests/phpunit/structure/CodexComponentUsageTest.php:43

See also T433648: CodexModule: detect and warn on declared-but-unused entries in 'codexComponents'

Event Timeline

See also tests/ResourcesTest.php and ResourceLoader/StartupModule.php where we pass a context to Module::getDepencencies.

Michael triaged this task as Unbreak Now! priority.Aug 26 2026, 1:54 PM
Michael subscribed.

And also GrowthExperiments CI is blocked by it as well. Multiple teams blocked => UBN.

Change #1329573 had a related patch set uploaded (by Michael Große; author: Michael Große):

[mediawiki/core@master] tests: Pass a context to getDependencies in CodexComponentUsageTest

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

That change seems to fix the MediaWiki-extensions-CentralNotice issue, but that was apparently only masking a true positive failure in PersonalDashboard:

00:05:21.630 There was 1 failure:
00:05:21.630 
00:05:21.631 1) MediaWiki\Tests\Structure\CodexComponentUsageTest::testNoUnusedCodexComponents
00:05:21.631 The following modules declare Codex component(s) in their "codexComponents" array that neither they nor any module depending on them use. Remove them to avoid shipping unused code.
00:05:21.631 Failed asserting that two arrays are identical.
00:05:21.631 --- Expected
00:05:21.631 +++ Actual
00:05:21.631 @@ @@
00:05:21.632 -Array &0 ()
00:05:21.632 +Array &0 (
00:05:21.632 +    0 => 'ext.personalDashboard.onboarding: CdxCheckbox'
00:05:21.633 +    1 => 'ext.personalDashboard.reviewChanges: CdxPopover, CdxToggleButton'
00:05:21.633 +)
00:05:21.633 
00:05:21.634 /workspace/src/tests/phpunit/structure/CodexComponentUsageTest.php:87

Change #1329578 had a related patch set uploaded (by Michael Große; author: Michael Große):

[mediawiki/extensions/PersonalDashboard@master] PersonalDashboard: Remove unused Codex component declarations

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

Change #1329573 merged by jenkins-bot:

[mediawiki/core@master] tests: Pass a context to getDependencies in CodexComponentUsageTest

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

Change #1329578 merged by jenkins-bot:

[mediawiki/extensions/PersonalDashboard@master] PersonalDashboard: Remove unused Codex component declarations

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

Michael lowered the priority of this task from Unbreak Now! to Needs Triage.Aug 26 2026, 4:54 PM

As far as I can tell, CI has been unblocked, so this is no longer UBN.

I'll leave it open for the related team to handle in their processes.

Test wiki created on Patch demo by MGrosse-WMF using patch(es) linked to this task:
https://03a921816c.catalyst.wmcloud.org/w/

jsn.sherman claimed this task.
jsn.sherman moved this task from QA to Done on the Moderator-Tools-Team (Kanban) board.
jsn.sherman subscribed.

looking good.

Test wiki on Patch demo by MGrosse-WMF using patch(es) linked to this task was deleted by Catalyst admin via Cron DeleteExpiredWikis:

https://03a921816c.catalyst.wmcloud.org/w/