Page MenuHomePhabricator

Add Makefile to core to help people get their dev environment setup
Closed, DeclinedPublic

Description

It's very unclear to a newcomer to MediaWiki core what coding guidelines they need to adhere to. I still see various PHP unit, JSLint and QUnit errors reported by Jenkin's suggesting people are unclear or unable to run these things locally.

MobileFrontend has been using a Makefile and sample pre commit hooks to make this clearer. If nothing else it points to what tests a developer is expected to run, where tests reside and how tests are run.

I understand that grunt is used by a few teams and I think a lot of these best practices should be codified into a Makefile to give better visibility to them.

A Makefile is usually the first thing I look for in a project.

I began adding one to core here: https://gerrit.wikimedia.org/r/#/c/75268/ but it was surprisingly met with a few objections. I've now abandoned it has I'd rather not invest time fixing this patch until we have consensus that this is useful but I truly believe it is.

Please can we spec out and agree whether this would be a good thing and what this would look like so it can be implemented?


Version: 1.22.0
Severity: enhancement

Event Timeline

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

I could swear there used to be a makefile that could run the unit tests etc...

In terms of dev environment, there is now a MediaWiki-Docker project maintained within the core repository. Aside from that there is also the web installer that is opened automatically (if you use XAMP/MAMP etc.), and a install.php command-line script for an even more minimal install (e.g. no apache or mysql needed, just plain php).

In terms of tests to run, we now use the standard composer test and npm test entry points for improved discovery. More or better organised/simpler documentation is always a need, but specifically a Makefile I don't think is what we need/want here. But documenting the install.php comand in e.g. an entry point like composer run minimal-install folowed by composer run minimal-serve (using the php built-in server) could certainly be useful for those looking for something that works without anything like Docker/Vagrant/Homebrew etc.

Change 588174 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/core@master] build: Document the one-line dependency-free pure php install method

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

Change 588174 merged by jenkins-bot:
[mediawiki/core@master] build: Document a one-line dependency-free pure php install method

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