User:Mooeypoo/VisualEditor Development

Below are the full steps, as I've experienced them multiple times, in setting up a working development environment for MediaWiki and VisualEditor.

Please note that this isn't an installation guide, this article is specifically meant to help contributors set up their system for contributions to MediaWiki core and VisualEditor.

Motivation
Everything in this guide already appears in the various guides online, either in GitHub or in MediaWiki documentation.

However, from my experience, it tends to get a bit confusing to shift from one guide to the other, especially if you're just starting out with this type of development. So, I grouped everything together into one single newbie-friendly tutorial. If you have anything to add to this, feel free.

Assumptions
This guide assumes the user is working with a Linux-based system. I will concentrate on Debian / Ubuntu because that's the most beginner-friendly distribution out there, but each step also has information about other distributions.

If your system is Windows, I recommend either using MediaWiki-Vagrant or install Linux under a Virtual Machine. VirtualBox or VMWare Player both work well in my experience. If you go with Vagrant, ignore this guide and follow the vagrant guide instead, it will handle setting up a development environment for MediaWiki and any extensions you set it up with.

Request a developer account
The first step in getting into MediaWiki development is to ask for a developer access. This will allow you to make contributions through gerrit.
 * 1) Request wikitech account

Note: The 'instance shell account name' is used in the "username" field whenever you contact gerrit to pull, clone, push, or review code. Whenever you see this link "ssh:// @gerrit.wikimedia.org:29418" the 'username' is your instance shell account name you chose. It's also public, so choose wisely. You have to sign up to both sites. Use the same email details.
 * 1) Sign up to Gerrit

Set up git
The best information about installing git is on GitHub documents. To save you the trouble, here it is in sequence for Debian / Ubuntu systems.

Install
$ apt-get install git For other distributions, follow the instructions at the git website.

Set up your details
These details should match the details you signed up to gerrit and wikitech $ git config --global user.name "Your Name Here" $ git config --global user.email "your_email@example.com"

Public keys
To be able to use ssh with gerrit, you must set up a public key gerrit can use to identify you are you who say you are. This procedure was taken almost-verbatim from the GitHub tutorial. $ cd ~/.ssh $ ls# Create a new ssh key, using the provided email as a label $ ssh-keygen -t rsa -C "your_email@example.com" Generating public/private rsa key pair. Enter file in which to save the key (/home/you/.ssh/id_rsa): $ ssh-add id_rsa
 * 1) List the files in your .ssh directory:
 * 1) Add the key in the system

Now you need to add the public key to both wikitech and gerrit. $ sudo apt-get install xclip $ xclip -sel clip < ~/.ssh/id_rsa.pub
 * 1) Downloads and installs xclip. If you don't have `apt-get`, you might need to use another installer (like `yum`)
 * 1) Copies the contents of the id_rsa.pub file to your clipboard


 * 1) Add to wikitech settings
 * 2) Add to gerrit settings