-
-
Notifications
You must be signed in to change notification settings - Fork 365
Open
Labels
Description
Seen in https://integration.wikimedia.org/ci/job/quibble-for-mediawiki-core-vendor-mysql-php83/4498/consoleFull trying to upgrade to 6.x (note link won't work forever)
04:02:00 1) MediaWiki\Tests\Rest\Handler\ModuleSpecHandlerTest::testGetInfoSpecSuccess with data set "module and version" ('/workspace/src/tests/phpunit/...e.json', array(array('mock', 'v1')), array(array('mock/v1 <message key="rest-mo...ssage>', '1.3-test', array('[email protected]')), array(array('https://example.com:1234/api/mock/v1')), array(array(array(array(array('q', 'query')), array(array('OK'))), array(array(true, array(array(array('object', array('b'), array(array('string')))))), array(array('OK'))))), array(array(array('boolean')), array(PHPUnit\Framework\Constraint\IsAnything Object (...)))))
04:02:00 TypeError: preg_match(): Argument #2 ($subject) must be of type string, int given
04:02:00
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/ObjectConstraint.php:64
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/ObjectConstraint.php:40
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:84
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/UndefinedConstraint.php:66
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/UndefinedConstraint.php:43
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:116
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/ObjectConstraint.php:139
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/ObjectConstraint.php:45
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:84
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/UndefinedConstraint.php:66
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/UndefinedConstraint.php:43
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:116
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/ObjectConstraint.php:66
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/ObjectConstraint.php:40
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:84
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/UndefinedConstraint.php:66
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/UndefinedConstraint.php:43
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:116
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/ObjectConstraint.php:66
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/ObjectConstraint.php:40
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:84
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/UndefinedConstraint.php:66
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/UndefinedConstraint.php:43
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:116
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/ObjectConstraint.php:139
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/ObjectConstraint.php:45
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:84
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/UndefinedConstraint.php:66
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/UndefinedConstraint.php:43
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:116
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/SchemaConstraint.php:96
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Validator.php:92
04:02:00 /workspace/src/tests/phpunit/JsonSchemaAssertionTrait.php:70
04:02:00 /workspace/src/tests/phpunit/integration/includes/Rest/Handler/ModuleSpecHandlerTest.php:85
04:02:00 /workspace/src/tests/phpunit/integration/includes/Rest/Handler/ModuleSpecHandlerTest.php:223
Logs generated by test
04:02:00
04:02:00 2) MediaWiki\Tests\Rest\Handler\ModuleSpecHandlerTest::testGetInfoSpecSuccess with data set "prefix-less module" ('/workspace/src/tests/phpunit/...s.json', array(array('-')), array(array('<message key="rest-module-ext...ssage>', 'undefined', array('Test License', 'https://example.com/license')), array(array('https://example.com:1234/api')), array(array(array(array(array('OK')))))))
04:02:00 TypeError: preg_match(): Argument #2 ($subject) must be of type string, int given
04:02:00
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/ObjectConstraint.php:64
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/ObjectConstraint.php:40
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:84
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/UndefinedConstraint.php:66
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/UndefinedConstraint.php:43
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:116
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/ObjectConstraint.php:139
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/ObjectConstraint.php:45
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:84
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/UndefinedConstraint.php:66
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/UndefinedConstraint.php:43
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:116
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/ObjectConstraint.php:66
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/ObjectConstraint.php:40
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:84
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/UndefinedConstraint.php:66
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/UndefinedConstraint.php:43
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:116
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/ObjectConstraint.php:66
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/ObjectConstraint.php:40
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:84
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/UndefinedConstraint.php:66
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/UndefinedConstraint.php:43
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:116
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/ObjectConstraint.php:139
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/ObjectConstraint.php:45
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:84
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/UndefinedConstraint.php:66
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/UndefinedConstraint.php:43
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:116
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/SchemaConstraint.php:96
04:02:00 /workspace/src/vendor/justinrainbow/json-schema/src/JsonSchema/Validator.php:92
04:02:00 /workspace/src/tests/phpunit/JsonSchemaAssertionTrait.php:70
04:02:00 /workspace/src/tests/phpunit/integration/includes/Rest/Handler/ModuleSpecHandlerTest.php:85
04:02:00 /workspace/src/tests/phpunit/integration/includes/Rest/Handler/ModuleSpecHandlerTest.php:223
From this snippet, preg_match is the one at fault.
foreach ($element as $i => $value) {
if (preg_match($fullRegex, $i)) {
$matches[] = $i;
$this->checkUndefined($value, $schema ?: new \stdClass(), $path, $i, in_array($i, $this->appliedDefaults));
}
}While this may be something we (MediaWiki et al) are doing wrong, it feels a bit odd that we manage to get quite so deep down in the stack before things blow up.
Validating against https://github.com/wikimedia/mediawiki/blob/ee5adbc7ef45067f815fa5f762ee21069fcde2ac/tests/phpunit/integration/includes/Rest/Handler/data/OpenApi-3.0.json which is an older version of the spec... https://spec.openapis.org/oas/v3.0.3
https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1229263
https://gerrit.wikimedia.org/r/c/mediawiki/vendor/+/1218857
Reactions are currently unavailable