Page MenuHomePhabricator

Wikibase appears to be failing phan on all builds now
Closed, ResolvedPublic

Description

See for example:
https://gerrit.wikimedia.org/r/462297 https://integration.wikimedia.org/ci/job/mwext-php70-phan-docker/14812/console
and
https://gerrit.wikimedia.org/r/447054 https://integration.wikimedia.org/ci/job/mwext-php70-phan-docker/14777/console

both of which end with:

03:14:35 + exec docker run --rm --volume /srv/jenkins-workspace/workspace/mwext-php70-phan-docker/src:/mediawiki --volume /srv/jenkins-workspace/workspace/mwext-php70-phan-docker/tmp:/tmp docker-registry.wikimedia.org/releng/mediawiki-phan:0.1.4 /mediawiki/extensions/Wikibase -m checkstyle
03:14:36 + umask 002
03:14:36 + /mediawiki/tests/phan/bin/phan /mediawiki/extensions/Wikibase -m checkstyle
03:14:59 <?xml version="1.0" encoding="ISO-8859-15"?>
03:14:59 <checkstyle version="6.5">
03:14:59   <file name="lib/includes/Store/Sql/WikiPageEntityRevisionLookup.php">
03:14:59     <error line="48" severity="warning" message="Property \Wikibase\Lib\Store\Sql\WikiPageEntityRevisionLookup::revisionStore has undeclared type \MediaWiki\Storage\RevisionStore" source="PhanUndeclaredTypeProperty"/>
03:14:59     <error line="64" severity="warning" message="Parameter of undeclared type \MediaWiki\Storage\RevisionStore" source="PhanUndeclaredTypeParameter"/>
03:14:59     <error line="198" severity="error" message="Call to method getRevisionById from undeclared class \MediaWiki\Storage\RevisionStore" source="PhanUndeclaredClassMethod"/>
03:14:59     <error line="213" severity="error" message="Catching undeclared class \MediaWiki\Storage\RevisionAccessException" source="PhanUndeclaredClassCatch"/>
03:14:59     <error line="220" severity="error" message="Reference to constant DELETED_TEXT from undeclared class \MediaWiki\Storage\RevisionRecord" source="PhanUndeclaredClassConstant"/>
03:14:59     <error line="220" severity="error" message="Reference to constant FOR_PUBLIC from undeclared class \MediaWiki\Storage\RevisionRecord" source="PhanUndeclaredClassConstant"/>
03:14:59   </file>
03:14:59   <file name="repo/RepoHooks.php">
03:14:59     <error line="236" severity="warning" message="Parameter of undeclared type \MediaWiki\Storage\RevisionRecord" source="PhanUndeclaredTypeParameter"/>
03:14:59     <error line="247" severity="error" message="Call to method getId from undeclared class \MediaWiki\Storage\RevisionRecord" source="PhanUndeclaredClassMethod"/>
03:14:59     <error line="252" severity="error" message="Call to method getId from undeclared class \MediaWiki\Storage\RevisionRecord" source="PhanUndeclaredClassMethod"/>
03:14:59     <error line="253" severity="error" message="Call to method getTimestamp from undeclared class \MediaWiki\Storage\RevisionRecord" source="PhanUndeclaredClassMethod"/>
03:14:59     <error line="425" severity="error" message="Reference to constant DELETED_TEXT from undeclared class \MediaWiki\Storage\RevisionRecord" source="PhanUndeclaredClassConstant"/>
03:14:59     <error line="473" severity="error" message="Reference to constant DELETED_TEXT from undeclared class \MediaWiki\Storage\RevisionRecord" source="PhanUndeclaredClassConstant"/>
03:14:59   </file>
03:14:59   <file name="repo/includes/Api/ResultBuilder.php">
03:14:59     <error line="1082" severity="error" message="Checking instanceof against undeclared class \MediaWiki\Storage\RevisionRecord" source="PhanUndeclaredClassInstanceof"/>
03:14:59   </file>
03:14:59   <file name="repo/includes/Diff/EntityContentDiffView.php">
03:14:59     <error line="102" severity="error" message="Reference to constant DELETED_TEXT from undeclared class \MediaWiki\Storage\RevisionRecord" source="PhanUndeclaredClassConstant"/>
03:14:59     <error line="114" severity="error" message="Reference to constant DELETED_TEXT from undeclared class \MediaWiki\Storage\RevisionRecord" source="PhanUndeclaredClassConstant"/>
03:14:59   </file>
03:14:59   <file name="repo/includes/Store/Sql/WikiPageEntityStore.php">
03:14:59     <error line="64" severity="warning" message="Property \Wikibase\Repo\Store\WikiPageEntityStore::revisionStore has undeclared type \MediaWiki\Storage\RevisionStore" source="PhanUndeclaredTypeProperty"/>
03:14:59     <error line="72" severity="warning" message="Parameter of undeclared type \MediaWiki\Storage\RevisionStore" source="PhanUndeclaredTypeParameter"/>
03:14:59     <error line="211" severity="error" message="Call to method getId from undeclared class \MediaWiki\Storage\RevisionRecord" source="PhanUndeclaredClassMethod"/>
03:14:59     <error line="212" severity="error" message="Call to method getTimestamp from undeclared class \MediaWiki\Storage\RevisionRecord" source="PhanUndeclaredClassMethod"/>
03:14:59     <error line="253" severity="error" message="Call to method getId from undeclared class \MediaWiki\Storage\RevisionRecord" source="PhanUndeclaredClassMethod"/>
03:14:59     <error line="255" severity="error" message="Call to method getId from undeclared class \MediaWiki\Storage\RevisionRecord" source="PhanUndeclaredClassMethod"/>
03:14:59     <error line="354" severity="warning" message="Parameter of undeclared type \MediaWiki\Storage\RevisionRecord" source="PhanUndeclaredTypeParameter"/>
03:14:59     <error line="359" severity="error" message="Call to method hasSlot from undeclared class \MediaWiki\Storage\RevisionRecord" source="PhanUndeclaredClassMethod"/>
03:14:59     <error line="373" severity="error" message="Call to method hasSlot from undeclared class \MediaWiki\Storage\RevisionRecord" source="PhanUndeclaredClassMethod"/>
03:14:59     <error line="436" severity="error" message="Call to method getRevisionById from undeclared class \MediaWiki\Storage\RevisionStore" source="PhanUndeclaredClassMethod"/>
03:14:59   </file>
03:14:59 </checkstyle>
03:14:59 Build step 'Execute shell' marked build as failure
03:14:59 [CHECKSTYLE] Collecting checkstyle analysis files...
03:14:59 [CHECKSTYLE] Searching for all files in /srv/jenkins-workspace/workspace/mwext-php70-phan-docker that match the pattern log/phan-issues
03:14:59 [CHECKSTYLE] No files found. Configuration error?
03:14:59 [CHECKSTYLE] Computing warning deltas based on reference build #14811
03:14:59 [CHECKSTYLE] Ignore new warnings since this is the first valid build
03:14:59 [CHECKSTYLE] Plug-in Result: Success - no threshold has been exceeded
03:14:59 [PostBuildScript] - Execution post build scripts.
03:14:59 [mwext-php70-phan-docker] $ /bin/bash -xe /tmp/jenkins2784197819987966059.sh
03:14:59 + set -eux
03:14:59 + docker run --rm --user=root -v /srv/jenkins-workspace/workspace/mwext-php70-phan-docker:/workspace --entrypoint=/usr/bin/find docker-registry.wikimedia.org/wikimedia-stretch:latest /workspace -mindepth 1 -delete
03:15:01 + rmdir /srv/jenkins-workspace/workspace/mwext-php70-phan-docker
03:15:01 Finished: FAILURE

There doesn't seem to be anything in the recent commit history of either Wikibase or integration-config that would explain this.

Event Timeline

Legoktm renamed this task from Wikibase appears to be failing checkstyle on all builds now to Wikibase appears to be failing phan on all builds now.Oct 11 2018, 5:37 AM
Legoktm subscribed.

This is because phan doesn't understand class_alias yet, and these classes were renamed in core.

Change 465958 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[mediawiki/extensions/Wikibase@master] Update use statements for re-namespacing of Revision-related classes

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

I guess phan for gated extensions is one of the things that doesn't happen as part of the mwgate job in core.

Change 465958 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Update use statements for re-namespacing of Revision-related classes

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

@cscott can you confirm this is all working now? :)

cscott claimed this task.

Well, I rebased my two patches on top of @Legoktm's patch and the builds are passing now, so I'll call that fixed.