Page MenuHomePhabricator

PhanUndeclaredTypeReturnType never
Closed, ResolvedPublicBUG REPORT

Description

See e.g. https://gerrit.wikimedia.org/r/c/mediawiki/extensions/GrowthExperiments/+/719398 / https://integration.wikimedia.org/ci/job/mwext-php72-phan-docker/133771/console :

21:41:12 includes/Specials/SpecialClaimMentee.php:111 PhanUndeclaredTypeReturnType Return type of displayRestrictionError() is undeclared type \never
21:41:12 includes/Specials/SpecialEditGrowthConfig.php:168 PhanTypeMissingReturn Method \GrowthExperiments\Specials\SpecialEditGrowthConfig::displayRestrictionError is declared to return \never in phpdoc but has no return value
21:41:12 includes/Specials/SpecialEditGrowthConfig.php:168 PhanUndeclaredTypeReturnType Return type of displayRestrictionError() is undeclared type \never
21:41:12 includes/Specials/SpecialMentorDashboard.php:198 PhanUndeclaredTypeReturnType Return type of displayRestrictionError() is undeclared type \never

Caused by rMW44fd53fee326: Using @return never documentation on always-throw-function, maybe some extensions use a different version of phan?

Event Timeline

maybe some extensions use a different version of phan?

Yes. LibUp will start automatically rolling out the newer version after the last canary is merged. Do we need to revert or add some other workaround in the meantime?

In T290541#7338682, @Majavah wrote:

maybe some extensions use a different version of phan?

Yes. LibUp will start automatically rolling out the newer version after the last canary is merged. Do we need to revert or add some other workaround in the meantime?

Well, we at least need to unbreak CI for GrowthExperiments :-). Not aware of Phan specifics enough to say how that happens.

Well, we at least need to unbreak CI for GrowthExperiments :-). Not aware of Phan specifics enough to say how that happens.

Either you revert the core patch that needs phan-config 0.11 or upgrade GE to phan-config 0.11. Best choice depends on how many extensions are broken.

Ouch, I didn't think about this.

In T290541#7338886, @Majavah wrote:

Best choice depends on how many extensions are broken.

Any extension which subclasses any of the methods changed in r717773. Hopefully not too many extensions.

LibUp will start automatically rolling out the newer version after the last canary is merged.

Right, and it seems like we have CI issues with that.

I think for now we can just upgrade the repos that are broken. Please do add me as reviewer. If it turns out there are many broken repos, we can still revert.

I'm working on upgrading phan for GE.

Urbanecm_WMF added a project: Growth-Team.

This is blocking all work by the Growth-Team.

Change 719481 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/extensions/GrowthExperiments@master] build: Upgrade mediawiki-phan-config to 0.11.0

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

Change 719481 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] build: Upgrade mediawiki-phan-config to 0.11.0

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

CI works in GE now. Thanks!

This broke CentralAuth too. @Daimona I'd still consider reverting until the Phan update has started rolling out with LibUp.

Yeah, let's keep this open for a day or two, since other repos might be broken and anybody searching phab would end up here. I'm going to fix CA as well, and asked at r718912 whether it's possible to skip the canary check and have LibUp upgrade phan everywhere immediately.

Change 719552 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/extensions/CentralAuth@master] build: Upgrade mediawiki-phan-config to 0.11.0

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

The SpecialPage changes would affect all special pages with custom (non-userright-based) usage restrictions, and there are quite a few of those. The other changes don't seem dangerous at a glance.

Codesearch says GrowthExperiments, Wikibase, BlueSpiceFoundation, EntitySchema, Upload2Commons, CentralAuth, FlexiSkin, MintyDocs, OATHAuth, OAuth, PrivateDomains, UrlShortener, Video, WebAuthn, WhoIsWatching.

LibUp has started upgrading phan everywhere, I'll make sure to review its patches to unbreak those repos. Note that the list might not be entirely correct, e.g. the build is not failing on wikibase, according to r719267, merged 1 hour ago.

Change 719552 merged by jenkins-bot:

[mediawiki/extensions/CentralAuth@master] build: Upgrade mediawiki-phan-config to 0.11.0

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