Page MenuHomePhabricator

mwext-php70-phan-docker fails for WikibaseCirrusSearch
Closed, ResolvedPublic

Description

The CI phan job fails on WikibaseCirrusSearch since Wikibase introduced stubs for phan (T217018).

The reason is Wikibase now introduces stub classes for elasticsearch. Since WikibaseCirrusSearch depends on ElasticSearch the concrete classes are available and thus conflict with the stubs from Wikibase.

Example conflict:

\Wikibase\Search\Elastic\DispatchingQueryBuilder inherits Interface \CirrusSearch\Query\FullTextQueryBuilder
declared at ../../extensions/CirrusSearch/includes/Query/FullTextQueryBuilder.php:10

which is also declared at ../../extensions/Wikibase/.phan/stubs/cirrussearch.php:225.

This may lead to confusing errors."
+ exec /srv/phan/vendor/bin/phan -d . -m checkstyle
A future major version of Phan will require PHP 7.1+ to run, but PHP 7.0.33-0+deb9u3 is installed.
PHP 7.0 reached its end of life in December 2018.
(Set PHAN_SUPPRESS_PHP_UPGRADE_NOTICE=1 to suppress this message)
RecursiveDirectoryIterator::__construct(includes/): failed to open dir: No such file or directory
RecursiveDirectoryIterator::__construct(maintenance/): failed to open dir: No such file or directory
RecursiveDirectoryIterator::__construct(.phan/stubs/): failed to open dir: No such file or directory
RecursiveDirectoryIterator::__construct(../../tests/phan/stubs): failed to open dir: No such file or directory
<?xml version="1.0" encoding="ISO-8859-15"?>
<checkstyle version="6.5">
  <file name="src/DispatchingQueryBuilder.php">
    <error line="13" severity="warning" message="\Wikibase\Search\Elastic\DispatchingQueryBuilder inherits Interface \CirrusSearch\Query\FullTextQueryBuilder declared at ../../extensions/CirrusSearch/includes/Query/FullTextQueryBuilder.php:10 which is also declared at ../../extensions/Wikibase/.phan/stubs/cirrussearch.php:225. This may lead to confusing errors." source="PhanRedefinedInheritedInterface"/>
  </file>
  <file name="src/ElasticTermResult.php">
    <error line="19" severity="warning" message="\Wikibase\Search\Elastic\ElasticTermResult inherits Interface \CirrusSearch\Search\ResultsType declared at ../../extensions/CirrusSearch/includes/Search/ResultsType.php:25 which is also declared at ../../extensions/Wikibase/.phan/stubs/cirrussearch.php:275. This may lead to confusing errors." source="PhanRedefinedInheritedInterface"/>
  </file>
  <file name="src/EntityFullTextQueryBuilder.php">
    <error line="23" severity="warning" message="\Wikibase\Search\Elastic\EntityFullTextQueryBuilder inherits Interface \CirrusSearch\Query\FullTextQueryBuilder declared at ../../extensions/CirrusSearch/includes/Query/FullTextQueryBuilder.php:10 which is also declared at ../../extensions/Wikibase/.phan/stubs/cirrussearch.php:225. This may lead to confusing errors." source="PhanRedefinedInheritedInterface"/>
  </file>
  <file name="src/EntityResult.php">
    <error line="13" severity="warning" message="\Wikibase\Search\Elastic\EntityResult extends Class \CirrusSearch\Search\Result declared at ../../extensions/CirrusSearch/includes/Search/Result.php:31 which is also declared at ../../extensions/Wikibase/.phan/stubs/cirrussearch.php:269. This may lead to confusing errors." source="PhanRedefinedExtendedClass"/>
  </file>
  <file name="src/EntityResultSet.php">
    <error line="10" severity="warning" message="\Wikibase\Search\Elastic\EntityResultSet extends Class \CirrusSearch\Search\ResultSet declared at ../../extensions/CirrusSearch/includes/Search/ResultSet.php:26 which is also declared at ../../extensions/Wikibase/.phan/stubs/cirrussearch.php:272. This may lead to confusing errors." source="PhanRedefinedExtendedClass"/>
  </file>
  <file name="src/EntityResultType.php">
    <error line="11" severity="warning" message="\Wikibase\Search\Elastic\EntityResultType extends abstract Class \CirrusSearch\Search\BaseResultsType declared at ../../extensions/CirrusSearch/includes/Search/BaseResultsType.php:8 which is also declared at ../../extensions/Wikibase/.phan/stubs/cirrussearch.php:282. This may lead to confusing errors." source="PhanRedefinedExtendedClass"/>
  </file>
  <file name="src/Query/HasDataForLangFeature.php">
    <error line="20" severity="warning" message="\Wikibase\Search\Elastic\Query\HasDataForLangFeature extends abstract Class \CirrusSearch\Query\SimpleKeywordFeature declared at ../../extensions/CirrusSearch/includes/Query/SimpleKeywordFeature.php:18 which is also declared at ../../extensions/Wikibase/.phan/stubs/cirrussearch.php:228. This may lead to confusing errors." source="PhanRedefinedExtendedClass"/>
    <error line="20" severity="warning" message="\Wikibase\Search\Elastic\Query\HasDataForLangFeature inherits Interface \CirrusSearch\Query\FilterQueryFeature declared at ../../extensions/CirrusSearch/includes/Query/FilterQueryFeature.php:18 which is also declared at ../../extensions/Wikibase/.phan/stubs/cirrussearch.php:222. This may lead to confusing errors." source="PhanRedefinedInheritedInterface"/>
  </file>
  <file name="src/Query/HasWbStatementFeature.php">
    <error line="56" severity="warning" message="\Wikibase\Search\Elastic\Query\HasWbStatementFeature extends abstract Class \CirrusSearch\Query\SimpleKeywordFeature declared at ../../extensions/CirrusSearch/includes/Query/SimpleKeywordFeature.php:18 which is also declared at ../../extensions/Wikibase/.phan/stubs/cirrussearch.php:228. This may lead to confusing errors." source="PhanRedefinedExtendedClass"/>
    <error line="56" severity="warning" message="\Wikibase\Search\Elastic\Query\HasWbStatementFeature inherits Interface \CirrusSearch\Query\FilterQueryFeature declared at ../../extensions/CirrusSearch/includes/Query/FilterQueryFeature.php:18 which is also declared at ../../extensions/Wikibase/.phan/stubs/cirrussearch.php:222. This may lead to confusing errors." source="PhanRedefinedInheritedInterface"/>
  </file>
  <file name="src/Query/InLabelFeature.php">
    <error line="26" severity="warning" message="\Wikibase\Search\Elastic\Query\InLabelFeature extends abstract Class \CirrusSearch\Query\SimpleKeywordFeature declared at ../../extensions/CirrusSearch/includes/Query/SimpleKeywordFeature.php:18 which is also declared at ../../extensions/Wikibase/.phan/stubs/cirrussearch.php:228. This may lead to confusing errors." source="PhanRedefinedExtendedClass"/>
    <error line="26" severity="warning" message="\Wikibase\Search\Elastic\Query\InLabelFeature inherits Interface \CirrusSearch\Query\FilterQueryFeature declared at ../../extensions/CirrusSearch/includes/Query/FilterQueryFeature.php:18 which is also declared at ../../extensions/Wikibase/.phan/stubs/cirrussearch.php:222. This may lead to confusing errors." source="PhanRedefinedInheritedInterface"/>
  </file>
  <file name="src/Query/WbStatementQuantityFeature.php">
    <error line="46" severity="warning" message="\Wikibase\Search\Elastic\Query\WbStatementQuantityFeature extends abstract Class \CirrusSearch\Query\SimpleKeywordFeature declared at ../../extensions/CirrusSearch/includes/Query/SimpleKeywordFeature.php:18 which is also declared at ../../extensions/Wikibase/.phan/stubs/cirrussearch.php:228. This may lead to confusing errors." source="PhanRedefinedExtendedClass"/>
    <error line="46" severity="warning" message="\Wikibase\Search\Elastic\Query\WbStatementQuantityFeature inherits Interface \CirrusSearch\Query\FilterQueryFeature declared at ../../extensions/CirrusSearch/includes/Query/FilterQueryFeature.php:18 which is also declared at ../../extensions/Wikibase/.phan/stubs/cirrussearch.php:222. This may lead to confusing errors." source="PhanRedefinedInheritedInterface"/>
  </file>
  <file name="src/WikibasePrefixSearcher.php">
    <error line="21" severity="warning" message="\Wikibase\Search\Elastic\WikibasePrefixSearcher extends Class \CirrusSearch\Searcher declared at ../../extensions/CirrusSearch/includes/Searcher.php:60 which is also declared at ../../extensions/Wikibase/.phan/stubs/cirrussearch.php:73. This may lead to confusing errors." source="PhanRedefinedExtendedClass"/>
  </file>
</checkstyle>

See https://integration.wikimedia.org/ci/job/mwext-php70-phan-docker/32909/console

Root case seems to be 494176.

Pinging @Smalyshev because he worked on 511127 and @Umherirrender because @hashar suggested it in #wikimedia-releng.

Event Timeline

Restricted Application added a project: Discovery-Search. · View Herald TranscriptJun 18 2019, 10:56 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
hashar updated the task description. (Show Details)
Smalyshev raised the priority of this task from Normal to High.Jun 18 2019, 5:20 PM

WikibaseCirrusSearch shouldn't be importing .phan/stubs for analysis...

../../extensions/Wikibase/tests/phan/stubs/cirrussearch.php was in the ignore list, but since it has moved...

Change 517700 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[mediawiki/extensions/WikibaseCirrusSearch@master] Update phan file path following rename in Wikibase

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

WikibaseCirrusSearch shouldn't be importing .phan/stubs for analysis...

The default is to include the whole extension repository, so it also includes .phan

Change 517702 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[mediawiki/extensions/ArticlePlaceholder@master] Update phan file path following rename in Wikibase

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

Change 517703 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[mediawiki/extensions/WikibaseLexemeCirrusSearch@master] Update phan file path following rename in Wikibase

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

Change 517704 had a related patch set uploaded (by Smalyshev; owner: Smalyshev):
[mediawiki/extensions/WikibaseLexemeCirrusSearch@master] Update phan file path following rename in Wikibase

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

Change 517703 merged by Umherirrender:
[mediawiki/extensions/WikibaseLexemeCirrusSearch@master] Update phan file path following rename in Wikibase

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

Change 517704 abandoned by Umherirrender:
Update phan file path following rename in Wikibase

Reason:
Superseeded by Id52f6a521efeea253d9f9f955d682cf23697d08b

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

Change 517700 merged by jenkins-bot:
[mediawiki/extensions/WikibaseCirrusSearch@master] Update phan file path following rename in Wikibase

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

Umherirrender closed this task as Resolved.Jun 18 2019, 6:06 PM
Umherirrender assigned this task to Legoktm.

Change 517702 merged by jenkins-bot:
[mediawiki/extensions/ArticlePlaceholder@master] Update phan file path following rename in Wikibase

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

Thank you for the debugging/fix up! :-]

mmodell changed the subtype of this task from "Task" to "Production Error".Wed, Aug 28, 11:06 PM