SQL/XML Dumps/Becoming a dumps co-maintainer/Setup

So you want to become a co-maintainer of the dumps. Awesome! This document will describe the steps you need to take in order to get set up for development, testing, packaging, and deployment of all of the dumps we maintain.

This is a living document; if it has not been updated in a while, please nag the authors.

Getting the code
Make sure you have git installed for cloning repositories. Make sure you configure it so that your name and email address will be added correctly to any patches you make. Then set yourself up with a Wikitech user and a gerrit SSH key. Once you've done that, you should clone the following, using the command

for each repo.


 * puppet: operations/puppet.git
 * xml/sql dumps: operations/dumps.git
 * mwbzutils: operations/dumps/mwbzutils.git
 * MediaWiki: mediawiki/core.git
 * MediaWiki extensions:
 * ActiveAbstract:mediawiki/extensions/ActiveAbstract.git

Development environment
For development you may use the IDE of your choice. The current primary dumps maintainer uses emacs + LSP for PHP and emacs + elpy for Python; for more information on that setup, see Emacs as a PHP IDE and the discussion page.

You'll want to make sure you have your configuration for each language set up to handle spaces and tabs according to the relevant style guidelines.

Code and style guidelines
Each project has code standards and style guidelines you should follow, some more formal than others.


 * puppet: Puppet_coding
 * xml/sql dumps: generally follow pylint and flake8
 * mwbzutils: in horrible shape, never mind :-(
 * MediaWiki and extensions: Manual:Coding_conventions/PHP

You will want the following tools to check syntax or style of your repos:


 * puppet: puppet-lint
 * xml/sql dumps: pylint and flake8
 * MediaWiki and extensions: phpcs and MediaWiki-CodeSniffer  which you will want to get via composer if you are working with the master branch.

Testing locally
It is very convenient to be able to test code locally on a desktop or laptop, and this should be the first step after you make any change to the code. Some users have a local installation of MediaWiki that they test against, while others use a Docker environment or a VM. Each codebase has different requirements for testing:


 * puppet: changes can be run through the puppet compiler This can also be done locally, details coming soon.
 * xml/sql dumps: from within the  directory, you may run   for unit tests of much of the code. You will need the mwbzutils binaries built and installed to run these, and you will need python3.
 * mwbzutils: you will need to build the binaries first, so you should have a c compiler (e.g. gcc) ad the  utility. From within the repo, you can run   to run a number of tests on those.
 * MediaWiki: many phpunit tests can be run without a local installation. You can run a single test from the top level of the repo by php tests/phpunit/phpunit.php tests/phpunit/rest-of-path-to-test.php, or all the tests in a directory under  by  . Note that some tests in the phpunit directory tree are actually integration tests tests and will require a MediaWiki installation.