Page MenuHomePhabricator

Support phan in MediaWiki's default composer.json
Closed, ResolvedPublic

Description

We have PHPUnit required in composer.json, why not phan also? It's run on CI, so it should be readily available for devs to run before they request review. Why require devs to install it separately globally, and make sure their version matches the version on CI so that get useful results?

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 10 2019, 9:49 AM

Because phan requires PHP >=7.0 (other dev deps require >=5.6.99) and until recently also required specific versions of php-ast, which would have make composer install really inconvenient for a lot of people.

I think we can reconsider this and implement it after core requires PHP >=7.0.

Daimona changed the task status from Open to Stalled.Sep 1 2019, 7:57 PM
Daimona added a subscriber: Daimona.
Daimona changed the task status from Stalled to Open.Oct 5 2019, 10:25 AM

Can be worked on now. For what concerns php-ast, we only need to make sure that phan will use the fallback parser if php-ast is not installed.

Change 541005 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[integration/config@master] docker: mediawiki-phan: Allow mediawiki-phan-config to require phan

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

Change 541006 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/tools/phan@master] Move phan/phan to composer require

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

Daimona claimed this task.Oct 5 2019, 1:34 PM

Change 541005 merged by jenkins-bot:
[integration/config@master] docker: [mediawiki-phan] Allow repos to require phan like normal

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

Mentioned in SAL (#wikimedia-releng) [2019-10-07T15:34:42Z] <James_F> Docker: [mediawiki-phan] Allow requiring phan like normal in composer.json T220589

Change 541287 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[integration/config@master] jjb: Move mediawiki-core-php72-phan-docker, mwext-php72-phan-docker to new image

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

Change 541287 merged by jenkins-bot:
[integration/config@master] jjb: Move mediawiki-core-php72-phan-docker, mwext-php72-phan-docker to new image

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

OK, this is done from the CI end, right? We now "just" need to do a release of mediawiki-phan-config with the dependency and then remove the 'extra' field when bumping all the repos to the new release?

OK, this is done from the CI end, right? We now "just" need to do a release of mediawiki-phan-config with the dependency and then remove the 'extra' field when bumping all the repos to the new release?

Yes. We need to upgrade phan, but first I'd like to remove the part about strengthening config, that can be done later.

Change 541006 merged by jenkins-bot:
[mediawiki/tools/phan@master] Move phan/phan to composer require and upgrade it

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

Change 541351 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[integration/config@master] docker: [mediawiki-phan] Fix syntax error in shell scripts

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

Change 541351 merged by jenkins-bot:
[integration/config@master] docker: [mediawiki-phan] Fix syntax error in shell scripts

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

Change 541559 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[integration/config@master] docker: [mediawiki-phan] Fix phan version validation

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

Change 541559 merged by jenkins-bot:
[integration/config@master] docker: [mediawiki-phan] Fix phan version validation

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

In theory, this is now done. Before calling it resolved, I'd like to wait until the new version of mediawiki-phan is released and at least one repo is using it.

Daimona closed this task as Resolved.Oct 10 2019, 2:18 PM

In theory, this is now done. Before calling it resolved, I'd like to wait until the new version of mediawiki-phan is released and at least one repo is using it.

That's it, now.