Page MenuHomePhabricator

clearActionName warning is blocking CI
Closed, ResolvedPublic1 Estimated Story Points

Description

It looks like d4ce0f3255ad has caused VisualEditor browser tests to fail (example) with an error log "Unexpected clearActionName after getActionName already called".

The patch looks like a good idea, but maybe premature. I would suggest that we disable the new log message for tests rather than using @-suppression, since the latter is unspecific and can hide other errors, and clearing the action name is a common use case in tests.

Event Timeline

Change 812952 had a related patch set uploaded (by Awight; author: Awight):

[mediawiki/core@master] Revert "Setup: Promote clearActionName log message to runtime warning"

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

Change 812952 merged by jenkins-bot:

[mediawiki/core@master] Revert "Setup: Promote clearActionName log message to runtime warning"

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

For the record, this was also breaking Wikibase CI (including gate-and-submit). Thanks for the quick revert!

Stack traces for future reference:

08:55:32 mw-error.log:2022-07-12 06:54:41 c91d7f5c8e83 wikidb: [f7d64a7d38af2d9ed7e4f6d0] /api.php   PHP Notice: Unexpected clearActionName after getActionName already called
08:55:32 mw-error.log:#0 [internal function]: MWExceptionHandler::handleError(integer, string, string, integer, array)
08:55:32 mw-error.log:#1 /workspace/src/includes/context/RequestContext.php(320): trigger_error(string)
08:55:32 mw-error.log:#2 /workspace/src/includes/context/RequestContext.php(185): RequestContext->clearActionName()
08:55:32 mw-error.log:#3 /workspace/src/extensions/VisualEditor/includes/ApiVisualEditorEdit.php(506): RequestContext->setTitle(Title)
08:55:32 mw-error.log:#4 /workspace/src/includes/api/ApiMain.php(1901): MediaWiki\Extension\VisualEditor\ApiVisualEditorEdit->execute()
08:55:32 mw-error.log:#5 /workspace/src/includes/api/ApiMain.php(875): ApiMain->executeAction()
08:55:32 mw-error.log:#6 /workspace/src/includes/api/ApiMain.php(846): ApiMain->executeActionWithErrorHandling()
08:55:32 mw-error.log:#7 /workspace/src/api.php(90): ApiMain->execute()
08:55:32 mw-error.log:#8 /workspace/src/api.php(45): wfApiMain()
08:55:32 mw-error.log:#9 {main}
08:55:32 mw-error.log:2022-07-12 06:54:41 c91d7f5c8e83 wikidb: [f7d64a7d38af2d9ed7e4f6d0] /api.php   PHP Notice: Unexpected clearActionName after getActionName already called
08:55:32 mw-error.log:#0 [internal function]: MWExceptionHandler::handleError(integer, string, string, integer, array)
08:55:32 mw-error.log:#1 /workspace/src/includes/context/RequestContext.php(320): trigger_error(string)
08:55:32 mw-error.log:#2 /workspace/src/includes/context/RequestContext.php(185): RequestContext->clearActionName()
08:55:32 mw-error.log:#3 /workspace/src/extensions/VisualEditor/includes/ApiVisualEditorEdit.php(516): RequestContext->setTitle(Title)
08:55:32 mw-error.log:#4 /workspace/src/includes/api/ApiMain.php(1901): MediaWiki\Extension\VisualEditor\ApiVisualEditorEdit->execute()
08:55:32 mw-error.log:#5 /workspace/src/includes/api/ApiMain.php(875): ApiMain->executeAction()
08:55:32 mw-error.log:#6 /workspace/src/includes/api/ApiMain.php(846): ApiMain->executeActionWithErrorHandling()
08:55:32 mw-error.log:#7 /workspace/src/api.php(90): ApiMain->execute()
08:55:32 mw-error.log:#8 /workspace/src/api.php(45): wfApiMain()
08:55:32 mw-error.log:#9 {main}

VE code calls RequestContext::getMain()->setTitle( … ) in code that integrates with FlaggedRevs, because FlaggedRevs uses the global context for various things. We can't replace it without rewriting a chunk of FlaggedRevs (or removing our integration with it for this feature – this code concerns updating how the page is rendered after an edit is saved).

awight set the point value for this task to 1.Jul 20 2022, 11:04 AM

Thanks. I'll follow-up at T314008, and close this from the CI regression perspective. I have an idea for how to address @matmarex's point in a way that satisfied both the needs of FlaggedRevs in ApiVisualEditorEdit hack as well as the need to not cause a dirty RequestContext action value.

Krinkle assigned this task to awight.