Page MenuHomePhabricator

Add phan to MediaWiki extensions and skins for static analysis [cloneable]
Open, Needs TriagePublic

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

Details

Related Gerrit Patches:
mediawiki/skins/Modern : masterAdd phan configuration for static analysis
integration/config : masterRun phan for mediawiki/skins/Modern
mediawiki/skins/Vector : masterAdd phan configuration for static analysis
integration/config : master[Vector] Run phan
integration/config : masterRun phan for CologneBlue and MonoBook skins
mediawiki/skins/CologneBlue : masterAdd phan for skin CologneBlue
mediawiki/skins/MonoBook : masterAdd phan for MonoBook skin
mediawiki/extensions/TitleBlacklist : masterAdd phan configuration for static analysis
mediawiki/extensions/Cite : masterAdd phan configuration for static analysis
mediawiki/extensions/CiteThisPage : masterAdd phan configuration for static analysis
mediawiki/extensions/SyntaxHighlight_GeSHi : masterAdd phan configuration for static analysis and fix phan warnings
mediawiki/extensions/WikiEditor : masterAdd phan configuration for static analysis
integration/config : masterRun phan for mediawiki/extensions/SyntaxHighlight_GeSHi
integration/config : masterRun phan for mediawiki/extensions/TitleBlackList
integration/config : masterRun phan for mediawiki/extensions/WikiEditor
integration/config : masterRun phan for mediawiki/extensions/Cite
integration/config : masterRun phan for mediawiki/extensions/CiteThisPage

Related Objects

StatusAssignedTask
OpenNone
ResolvedUmherirrender
ResolvedMaxSem
ResolvedDaimona
ResolvedDaimona
ResolvedDaimona
ResolvedDaimona
ResolvedDaimona
ResolvedUmherirrender
ResolvedUmherirrender
ResolvedUmherirrender
ResolvedUmherirrender
StalledNone
ResolvedUmherirrender
ResolvedUmherirrender
DeclinedNone
ResolvedUmherirrender
ResolvedUmherirrender
ResolvedUmherirrender
ResolvedUmherirrender
ResolvedUmherirrender
ResolvedUmherirrender
ResolvedUmherirrender
ResolvedUmherirrender
ResolvedUmherirrender
ResolvedUmherirrender
ResolvedLegoktm
ResolvedLegoktm
ResolvedDaimona
ResolvedEBernhardson

Event Timeline

Legoktm created this task.Nov 2 2017, 1:27 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 2 2017, 1:27 AM

I can mentor / help mentor this (@Legoktm)

Florian added a subscriber: Florian.EditedNov 14 2017, 7:26 PM

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)Dec 25 2017, 10:08 PM
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

Legoktm updated the task description. (Show Details)Feb 24 2018, 7:47 PM
Legoktm updated the task description. (Show Details)Feb 25 2018, 12:50 AM

Change 400157 abandoned by Legoktm:
[Vector] Run phan

Reason:
Done in https://gerrit.wikimedia.org/r/430295

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

Beeyan added a subscriber: Beeyan.May 2 2018, 2:57 PM
Beeyan removed a subscriber: Beeyan.

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

Legoktm updated the task description. (Show Details)May 3 2018, 4:15 AM

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

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

Tgr added a subscriber: Tgr.Feb 26 2019, 3:51 AM

Should this be closed as resolved, or moved to Outreach-Programs-Projects?

Gopavasanth updated the task description. (Show Details)Oct 11 2019, 6:36 PM