Page MenuHomePhabricator

Add phan to MediaWiki extensions and skins for static analysis [cloneable]
Closed, ResolvedPublic

Description

This is a clonable task for Google-Code-in-2017

Phan is a PHP static analysis tool that can identify problems with code without actually executing it. We use it in MediaWiki core and a few other extensions, and I'd like to add it to more. The process is generally straightforward.

Please use the Gerrit topic of "phan" for your commits.

A more in-depth tutorial can be found at https://www.mediawiki.org/wiki/Continuous_integration/Tutorials/Add_phan_to_a_MediaWiki_extension

First we can start with the tarball bundled extensions and skins:

  • Cite
  • CiteThisPage
  • ConfirmEdit
  • Gadgets
  • ImageMap
  • InputBox
  • Interwiki
  • LocalisationUpdate
  • Nuke
  • ParserFunctions
  • PdfHandler
  • Poem
  • Renameuser
  • SpamBlacklist
  • SyntaxHighlight_GeSHi
  • TitleBlacklist
  • WikiEditor
  • CologneBlue skin
  • MonoBook skin
  • Modern skin
  • Vector skin

Related Objects

StatusSubtypeAssignedTask
ResolvedNone
ResolvedUmherirrender
ResolvedMaxSem
ResolvedDaimona
ResolvedDaimona
ResolvedDaimona
ResolvedDaimona
ResolvedDaimona
ResolvedUmherirrender
ResolvedUmherirrender
ResolvedUmherirrender
ResolvedUmherirrender
ResolvedEjegg
ResolvedUmherirrender
ResolvedUmherirrender
DeclinedNone
ResolvedUmherirrender
ResolvedUmherirrender
ResolvedUmherirrender
ResolvedUmherirrender
ResolvedUmherirrender
ResolvedUmherirrender
ResolvedUmherirrender
ResolvedUmherirrender
ResolvedUmherirrender
ResolvedUmherirrender
ResolvedLegoktm
ResolvedLegoktm
ResolvedDaimona
ResolvedEBernhardson

Event Timeline

I can mentor / help mentor this (@Legoktm)

Me, too! :)

One question remains: What do you think about acceptance criteria: When does a student know, that he finished this task? Something like: Add phan to at least one extension/skin? :)

Aklapper renamed this task from Add phan to MediaWiki extensions for static analysis to Add phan to MediaWiki extensions and skins for static analysis [cloneable].Nov 20 2017, 11:47 AM
Aklapper updated the task description. (Show Details)

Change 400079 had a related patch set uploaded (by Rafidaslam; owner: Rafid Aslam):
[mediawiki/extensions/SyntaxHighlight_GeSHi@master] Add phan configuration for static analysis

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

Change 400080 had a related patch set uploaded (by Rafidaslam; owner: Rafid Aslam):
[integration/config@master] Run phan for mediawiki/extensions/ParserMigration

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

Change 400081 had a related patch set uploaded (by Rafidaslam; owner: Rafid Aslam):
[mediawiki/extensions/TitleBlacklist@master] Add phan configuration for static analysis

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

Change 400082 had a related patch set uploaded (by Rafidaslam; owner: Rafid Aslam):
[integration/config@master] Run phan for mediawiki/extensions/TitleBlackList

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

Change 400083 had a related patch set uploaded (by Rafidaslam; owner: Rafid Aslam):
[mediawiki/extensions/WikiEditor@master] Add phan configuration for static analysis

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

Change 400084 had a related patch set uploaded (by Rafidaslam; owner: Rafid Aslam):
[integration/config@master] Run phan for mediawiki/extensions/WikiEditor

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

Is there any way we could use phan in MediaWiki-Vagrant which still runs PHP 5?

Is there any way we could use phan in MediaWiki-Vagrant which still runs PHP 5?

Mediawiki-vagrant is using hhvm not php5, but the question still stands.

Basically you can install php7.0 there is instructions at
https://www.mediawiki.org/wiki/Continuous_integration/Phan#Dependencies

See https://lists.wikimedia.org/pipermail/wikitech-l/2017-December/089294.html - you can try out the stretch version of MediaWiki-Vagrant that comes with PHP 7.0 (but it may also have some bugs in it)

Change 400156 had a related patch set uploaded (by Phantom42; owner: Phantom42):
[mediawiki/skins/Vector@master] Add phan configuration for static analysis

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

Change 400157 had a related patch set uploaded (by Phantom42; owner: Phantom42):
[integration/config@master] Run phan for mediawiki/skins/Vector

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

Change 400158 had a related patch set uploaded (by Phantom42; owner: Phantom42):
[mediawiki/skins/Modern@master] Add phan configuration for static analysis

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

Change 400159 had a related patch set uploaded (by Phantom42; owner: Phantom42):
[integration/config@master] Run phan for mediawiki/skins/Modern

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

Change 400174 had a related patch set uploaded (by Phantom42; owner: Phantom42):
[mediawiki/extensions/Cite@master] Add phan configuration for static analysis

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

Change 400185 had a related patch set uploaded (by Phantom42; owner: Phantom42):
[mediawiki/extensions/CiteThisPage@master] Add phan configuration for static analysis

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

Change 400186 had a related patch set uploaded (by Phantom42; owner: Phantom42):
[integration/config@master] Run phan for mediawiki/extensions/Cite

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

Change 400187 had a related patch set uploaded (by Phantom42; owner: Phantom42):
[integration/config@master] Run phan for mediawiki/extensions/CiteThisPage

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

Change 400187 had a related patch set uploaded (by Legoktm; owner: Phantom42):
[integration/config@master] Run phan for mediawiki/extensions/CiteThisPage

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

Change 400186 had a related patch set uploaded (by Legoktm; owner: Phantom42):
[integration/config@master] Run phan for mediawiki/extensions/Cite

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

Change 400084 had a related patch set uploaded (by Legoktm; owner: Rafid Aslam):
[integration/config@master] Run phan for mediawiki/extensions/WikiEditor

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

Change 400082 had a related patch set uploaded (by Legoktm; owner: Rafid Aslam):
[integration/config@master] Run phan for mediawiki/extensions/TitleBlackList

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

Change 400080 had a related patch set uploaded (by Legoktm; owner: Rafid Aslam):
[integration/config@master] Run phan for mediawiki/extensions/SyntaxHighlight_GeSHi

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

Change 400187 merged by jenkins-bot:
[integration/config@master] Run phan for mediawiki/extensions/CiteThisPage

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

Change 400186 merged by jenkins-bot:
[integration/config@master] Run phan for mediawiki/extensions/Cite

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

Change 400084 merged by jenkins-bot:
[integration/config@master] Run phan for mediawiki/extensions/WikiEditor

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

Change 400082 merged by jenkins-bot:
[integration/config@master] Run phan for mediawiki/extensions/TitleBlackList

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

Change 400080 merged by jenkins-bot:
[integration/config@master] Run phan for mediawiki/extensions/SyntaxHighlight_GeSHi

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

Change 400083 merged by jenkins-bot:
[mediawiki/extensions/WikiEditor@master] Add phan configuration for static analysis

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

Change 400081 merged by jenkins-bot:
[mediawiki/extensions/TitleBlacklist@master] Add phan configuration for static analysis

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

Change 400079 merged by jenkins-bot:
[mediawiki/extensions/SyntaxHighlight_GeSHi@master] Add phan configuration for static analysis and fix phan warnings

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

Change 400185 merged by jenkins-bot:
[mediawiki/extensions/CiteThisPage@master] Add phan configuration for static analysis

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

Legoktm updated the task description. (Show Details)
Legoktm updated the task description. (Show Details)

Change 400174 merged by jenkins-bot:
[mediawiki/extensions/Cite@master] Add phan configuration for static analysis

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

Change 404170 had a related patch set uploaded (by Zoranzoki21; owner: Zoranzoki21):
[mediawiki/skins/CologneBlue@master] Add phan for skin CologneBlue

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

Change 404171 had a related patch set uploaded (by Zoranzoki21; owner: Zoranzoki21):
[mediawiki/skins/MonoBook@master] Add phan for MonoBook skin

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

Change 404172 had a related patch set uploaded (by Zoranzoki21; owner: Zoranzoki21):
[integration/config@master] Run phan for CologneBlue and MonoBook skins

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

Change 404171 abandoned by Zoranzoki21:
Add phan for MonoBook skin

Reason:
I no want to work on this

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

Change 404170 abandoned by Zoranzoki21:
Add phan for skin CologneBlue

Reason:
I no want to work on this anymore

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

Change 404172 abandoned by Zoranzoki21:
Run phan for CologneBlue and MonoBook skins

Reason:
Only I lost time.

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

Change 400156 merged by jenkins-bot:
[mediawiki/skins/Vector@master] Add phan configuration for static analysis

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

Change 400159 merged by jenkins-bot:
[integration/config@master] Run phan for mediawiki/skins/Modern

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

Change 400158 merged by jenkins-bot:
[mediawiki/skins/Modern@master] Add phan configuration for static analysis

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

hashar moved this task from In progress to Repo setup on the Continuous-Integration-Config board.
hashar added subscribers: Daimona, Umherirrender, hashar.

As I understand it, this task was for Google Summer of Code 2017 and intended to be cloneable for students to add Phan.

@Daimona has been nicely baby sitting Phan and @ Umherirrender has driven the effort to enable Phan on all Wikimedia deployed extensions and skins (T224783).

So this task has served its purpose ;)