Page MenuHomePhabricator

SettingsTest::testCurrentSettingsValidate fails in quibble-vendor-mysql-php72-noselenium-docker for multiple repos
Closed, ResolvedPublic

Description

The error log says:

15:34:43 There was 1 failure:
15:34:43 
15:34:43 1) MediaWiki\Tests\Structure\SettingsTest::testCurrentSettingsValidate
15:34:43 Status should be OK
15:34:43 <Error, collected 10 error(s) on the way, no value set>
15:34:43 +------+---------------------------+------------------------------------------+
15:34:43 |    1 | config-invalid-key        | NamespaceContentModels | Skipping valida |
15:34:43 |      |                           | tion of object with integer keys         |
15:34:43 |    2 | config-invalid-key        | ObjectCaches | Skipping validation of ob |
15:34:43 |      |                           | ject with integer keys                   |
15:34:43 |    3 | config-invalid-key        | WANObjectCaches | Skipping validation of |
15:34:43 |      |                           |  object with integer keys                |
15:34:43 |    4 | config-invalid-key        | CanonicalNamespaceNames | Skipping valid |
15:34:43 |      |                           | ation of object with integer keys        |
15:34:43 |    5 | config-invalid-key        | ExtraNamespaces | Skipping validation of |
15:34:43 |      |                           |  object with integer keys                |
15:34:43 |    6 | config-invalid-key        | NamespacesWithSubpages | Skipping valida |
15:34:43 |      |                           | tion of object with integer keys         |
15:34:43 |    7 | config-invalid-key        | NamespaceProtection | Skipping validatio |
15:34:43 |      |                           | n of object with integer keys            |
15:34:43 |    8 | config-invalid-key        | NamespacesToBeSearchedDefault | Skipping |
15:34:43 |      |                           |  validation of object with integer keys  |
15:34:43 |    9 | config-invalid-key        | PreviewOnOpenNamespaces | Skipping valid |
15:34:43 |      |                           | ation of object with integer keys        |
15:34:43 |   10 | config-invalid-key        | LogActions | Array value found, but an a |
15:34:43 |      |                           | rray is required | array (
15:34:43   'globalauth |
15:34:43 |      |                           | /lock' => 'centralauth-log-entry-lock',
15:34:43  |
15:34:43 |      |                           |   'globalauth/unlock' => 'centralauth-.. |
15:34:43 |      |                           | .                                        |
15:34:43 +------+---------------------------+------------------------------------------+
15:34:43 
15:34:43 /workspace/src/tests/phpunit/MediaWikiTestCaseTrait.php:304
15:34:43 /workspace/src/tests/phpunit/MediaWikiTestCaseTrait.php:309
15:34:43 /workspace/src/tests/phpunit/structure/SettingsTest.php:71
15:34:43 /workspace/src/tests/phpunit/MediaWikiIntegrationTestCase.php:467
15:34:43 === Logs generated by test case
15:34:43 [objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
15:34:43 ===

Wikibase Lexeme, README.md change: https://integration.wikimedia.org/ci/job/quibble-vendor-mysql-php72-noselenium-docker/145629/console
Wikibase: https://integration.wikimedia.org/ci/job/quibble-vendor-mysql-php72-noselenium-docker/145631/console
Content Translation: https://integration.wikimedia.org/ci/job/quibble-vendor-mysql-php72-noselenium-docker/145635/console

Event Timeline

Michael triaged this task as Unbreak Now! priority.Apr 7 2022, 2:22 PM

Since this affects multiple teams, I'm making the task Unbreak Now! Feel free to change if you disagree.

I can reproduce this locally, by the way, with 11 errors in the status (CapitalLinkOverrides seems to be the extra one compared to the task description; I’m not sure why, since I don’t have it in my LocalSettings and grepping for it in extensions/ and skins/ doesn’t find anything either).

If I comment out StatusValue::warning(), the one non-warning error seems to be the LogActions one: “Array value found, but an array is required”

I think the nonsensical error message “Array value found, but an array is required” actually means that it requires a non-associative array.

vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/TypeCheck/LooseTypeCheck.php
public static function isArray($value)
{
    return
        is_array($value) &&
        (count($value) == 0 || !self::isAssociativeArray($value));
}

And LogActions is something like [ 'rights/erevoke' => 'rights-editor-revoke' ] (at least on my system), which is associative, hence not an array according to justinrainbow/json-schema.

editor-revoke seems to come from FlaggedRevs; when I remove that in my LocalSettings (why, for the love of all that is holy, did I have this accursed extension enabled?!), the test passes. In CI, it sounds like CentralAuth is responsible for the associative array instead.

Change 778309 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/core@master] Temporarily skip SettingsTest::testCurrentSettingsValidate()

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

Change 778311 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/core@master] Fix type of LogActions

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

Change 778311 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/core@master] Fix type of LogActions

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

Testing this one via Depends-On at https://gerrit.wikimedia.org/r/c/mediawiki/extensions/WikibaseLexeme/+/778290; if it works, we can abandon the change that skips the test (unless you think that’s the safer course of action, because who knows how many other incorrect types are waiting to be discovered in extensions).

Note that all the "Skipping validation" messages are just warnings. They do nto make the test fail. The failues is for LogAction.

"LogActions | Array value found, but an array is required" is a very confusing message, it comes from the JSON Schema validator. It really means "string key found in what is supposed to be a sequential list".

Looking at LogPage::actionText(), LogAction is not a sequential list, but a map. I'll fix that in the MainConfigSchema.

Change 778313 had a related patch set uploaded (by Daniel Kinzler; author: Daniel Kinzler):

[mediawiki/core@master] LogActions is a map, not a list.

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

Change 778311 abandoned by Lucas Werkmeister (WMDE):

[mediawiki/core@master] Fix type of LogActions

Reason:

superseded by I681b2d7004

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

Change 778309 abandoned by Lucas Werkmeister (WMDE):

[mediawiki/core@master] Temporarily skip SettingsTest::testCurrentSettingsValidate()

Reason:

superseded by I681b2d7004

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

Change 778313 merged by jenkins-bot:

[mediawiki/core@master] LogActions is a map, not a list.

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

Change 783868 had a related patch set uploaded (by Daniel Kinzler; author: Daniel Kinzler):

[mediawiki/core@REL1_38] LogActions is a map, not a list.

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

Change 783868 merged by jenkins-bot:

[mediawiki/core@REL1_38] LogActions is a map, not a list.

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