Page MenuHomePhabricator

Jenkins: Overhaul the phpcs macro
Closed, ResolvedPublic

Description

In Jenkins job builder, we currently have two macro for phpcs which can use some help.

phpcs-HEAD should rely on /var/lib/jenkins/bin/git-changed-in-head which let us specify the extensions we are interested in (php php5 inc sample). Also it does not ignore the i18n files which takes a very long time: mwext-Translate-phpcs-HEAD takes a good 18 minutes (if not more): https://integration.wikimedia.org/ci/job/mwext-Translate-phpcs-HEAD/1283/


Version: wmf-deployment
Severity: minor

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:32 AM
bzimport set Reference to bz48420.
bzimport added a subscriber: Unknown Object (MLST).

Related URL: https://gerrit.wikimedia.org/r/63571 (Gerrit Change Ia3cbaddf698eac558d2390a4be5d8c0817bf6317)

mwext-Translate-phpcs-HEAD is no more testing i18n files, making it REALLY faster: https://integration.wikimedia.org/ci/job/mwext-Translate-phpcs-HEAD/1286/console

Deployed the i18n ignore for all extensions.

Can this be marked as fixed now? I think this is good enough.

Gerrit change #63571 added in the i18n.php fliter, I still have to adapt phpcs-HEAD macro to rely on /var/lib/jenkins/bin/git-changed-in-head instead of the huge shell script :)

Related URL: https://gerrit.wikimedia.org/r/69863 (Gerrit Change I7862b0b628748f23fb29c063c3e530f60bbaa795)

Lame matrix:

par  files

head strict | | HEAD
head loose | -n | .

full strict | | HEAD
full loose | -n | .

Change 77279 had a related patch set uploaded by Hashar:
run-phpcs-mw: wrapper around phpcs for CI needs

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

Shell wrapper for the win :-]

Change 77279 merged by Hashar:
run-phpcs-mw.sh: wrapper around phpcs for CI needs

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

Change 77281 had a related patch set uploaded by Hashar:
new phpcs builder macros

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

Change 77282 had a related patch set uploaded by Hashar:
new phpcs jobs for mw/ext/Translate

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

Change 77283 had a related patch set uploaded by Hashar:
new phpcs jobs for mw/ext/Translate

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

Change 77283 merged by jenkins-bot:
new phpcs jobs for mw/ext/Translate (non voting)

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

Change 77281 merged by jenkins-bot:
new phpcs builders and job templates

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

Change 77282 merged by jenkins-bot:
new phpcs jobs for mw/ext/Translate

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

Change 81184 had a related patch set uploaded by Hashar:
new phpcs jobs for mediawiki/core (non voting)

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

Change 81184 merged by jenkins-bot:
new phpcs jobs for mediawiki/core (non voting)

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

I still have to get rid of the old macros in Jenkins Job Builder and to always ends up using the shell wrapper introduced by https://gerrit.wikimedia.org/r/77279

Lowering priority, I am working on other things right now.

Translate extension now passes PHPCS strict since gerrit 88616. Will be made voting soon for Translate.

Use the following to ignore coding standards on for example false positives and lib files:

// @codingStandardsIgnoreStart

[Code part that is ignored.

// @codingStandardsIgnoreStart

// @codingStandardsIgnoreFile Will ignore complete file.

More information at: http://pear.php.net/manual/en/package.php.php-codesniffer.advanced-usage.php

Almost a year since Antoine has worked on this, unassigning.

Is there anything else to overhaul here?
It looks pretty good to me :) (although I might add a few more options in the coming weeks!

I have kept this bug around as per Comment #21:

I still have to get rid of the old macros in Jenkins Job Builder and to
always ends up using the shell wrapper introduced by
https://gerrit.wikimedia.org/r/77279

We have two different set of phpcs jobs. The Jenkins Job builder config needs to be adjust for all repositories using the old set (the new one are the templates applied to Translate and have 'lenient' and 'strict'). Then adjust the Zuul triggers to reflect the change.

If strict pass (i.e. warning+errors), the lenient one (warning only) can be removed from Zuul configuration since it is redundant.

Change 161763 had a related patch set uploaded by Jforrester:
Significantly simply phpcs job configuration

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

Change 161757 had a related patch set uploaded by Krinkle:
Remove unused distinction between phpcs-strict and phpcs-lenient

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

Change 161763 abandoned by Hashar:
Significantly simplify phpcs job configuration

Reason:
The continuous integration configuration files are now held in integration/config.git with Zuul layout files being under /zuul/layout.yaml

If there still is an interest in this patch, please port it to the new repository integration/config.git

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

Change 161757 abandoned by Hashar:
Remove unused distinction between phpcs-strict and phpcs-lenient

Reason:
The continuous integration configuration files are now held in integration/config.git with JJB layout files being under /jjb/

If there still is an interest in this patch, please port it to the new repository integration/config.git

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

Change 166071 had a related patch set uploaded by Jforrester:
Clean up phpcs usage, removing -strict/-lenient distinction

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

Change 166071 had a related patch set uploaded (by Jforrester):
Clean up phpcs macros and jobs (remove strict/lenient split)

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

Patch-For-Review

Change 166071 merged by jenkins-bot:
Clean up phpcs macros and jobs (remove strict/lenient split)

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

Krinkle claimed this task.
Krinkle moved this task from Untriaged to Done on the Continuous-Integration-Infrastructure board.