Hackathons/Laptop setup

The goal of the Hackathon laptop setup is to help you get a working development and community communication environment quickly! These steps should take somewhere between 30 minutes and 1 hour.

Goal #1: install an IRC client
IRC is a real-time chat protocol that MediaWiki developers and others use to talk about the project and as a medium for users and developers to help each other.

During the hackathon, you will all be chatting with each other on the #mediawiki IRC channel!


 * Windows
 * OS X
 * Linux

If you'll be doing anything that resembles software testing or development, or if you just generally enjoy installing things on your computer, read on!

Web based alternative: In case you are having trouble setting up desktop based clients, check out irccloud.com which would save logs for you as well.

Goal #2: create a Phabricator account
Wikimedia uses Phabricator for task management, bug reporting, etc. To be able to interact with tasks, create a Phabricator account by clicking "Log In" here. If you need help with Phabricator, here are instructions how to get started: https://www.mediawiki.org/wiki/Phabricator/Help.

Goal #3: practice navigating from the command line
Many of the tools of MediaWiki development are primarily used via the command line, including git and git review. Let's get some practice with navigating the computer from the command line.


 * Windows
 * OS X
 * Linux

Goal #4: prepare SSH
SSH allows you to securely access a shell (like the command line window you used earlier) on a remote machine. You will need to set up ssh to use Git and Gerrit successfully.


 * SSH setup

Goal #5: install Git
Git is a popular revision control system that is used by Wikimedia projects.


 * Windows
 * OS X
 * Linux

create a Gerrit account
Gerrit is the code review tool used within Wikimedia projects, including many MediaWiki extensions. You'll need an account on Gerrit only if you are considering to work on a project which is hosted there.


 * Gerrit setup

set-up Python
This section has instructions for installing Python and running Python from a command prompt. You will need that to use the "git review" tool. You will require this setup only if you are creating a Gerrit account.


 * Windows
 * OS X
 * Linux

install git-review
git-review is a tool that simplifies code review. It automates the process of sending changes to Gerrit. You will require this setup only if you are creating a Gerrit account.

Goal #7: practice using a plain text editor
Make sure you know how to use a plain text editor. If you don't have experience using one of those, ask an instructor for help installing one.


 * Windows
 * OS X
 * Linux

Goal #8: Fetch Mediawiki codebase and setup the development environment
Hacking on MediaWiki core is usually not an ideal place for new developers to start contributing (learn more here). But, there are others alternatives to MediaWiki core that you could consider. Also, there are others technical areas in Wikimedia where you can contribute your skills.

Only if you have identified that you will be working on a project that involves MediaWiki codebase, read on!

You have three options according to your need/time/machine configurations and network speed, and all of them have their pros and cons.

Setup MediaWiki-Docker (Simple)
MediaWiki Docker is a development environment built on Docker and Docker Compose. Follow the instructions to get started. Depending on your network speed, it should take about 10-15 minutes to have your environment set up.

Setup Mediawiki-Vagrant (Complex)
MediaWiki-Vagrant is a portable MediaWiki development environment. It uses Vagrant and VirtualBox to automate the creation of a virtual machine that runs MediaWiki.

Follow the MediaWiki-Vagrant quick start instructions to setup your own virtual machine running MediaWiki.

If you are doing all of this work at the hackathon, ask around to see if there are any USB drives with the MediaWiki-Vagrant software on them available for you to use. Installing from the USB image can literally save you hours of time waiting for things to download if the venue's network connection is congested or slow. There may also be a MediaWiki-Vagrant install party or bootcamp session at the hackathon that you can attend to get help with your initial install.

Manually download the code to your OS, install LAMP/similar services
In case mediawiki-vagrant seems bulky for your machine configurations, you can setup the development environment by following Download from Git/Tutorial. The steps are straightforward, and would look mostly like:
 * 1) Download and install LAMP or similar stack in your Operating System.
 * 2) Download and install couple of packages like git-core, git-review etc.
 * 3) Clone mediawiki-core to your Apache (can vary) document root.
 * 4) Install dependencies, if any - and run the server from your OS.

Setup JetBrains PhpStorm (recommended) IDE for Mediawiki code development
Setting up JetBrains IDEs will make your life easy when hacking on Mediawiki code. You can find more information here, and the steps are:
 * 1) Download + install PhpStorm (you can even avail a community license for your product according to JetBrains IDEs)
 * 2) Apply Mediawiki code styles to the IDE as per JetBrains IDEs
 * 3) Open the mediawiki-core folder or similar from your Vagrant install following MediaWiki-Vagrant/Advanced usage with your IDE
 * 4) Run some test edits like a var_dump("hello"); in LocalSettings.php to check if things are working.

Connecting to PHPStorm debugger

 * 1) Instructions coming soon...

Goal #9: Setup the development environment for a new developer friendly project
Only if you have decided to work on a project from the Wikimedia's New Developers guide, set up the development environment for a project by following the link next to "Get the source code".

Step 10: check-off
Finally, you need to find a volunteer and demonstrate that you've gone through all these steps properly. Find a staff person (if you're not sure who can help you, raise your hand).

The staffer and you will check that you can do the following things:


 * Type a message into the #wikimania IRC channel indicating that you're done setting up your computer, then send it!
 * Open a command prompt, and explain what "cd" does.
 * Open a command prompt (in Windows open Git Bash) and type "git". Demonstrate that the command is found!
 * In a command prompt, type "git review" and press enter, and show that the command is found.
 * Open up the Gerrit developer accounts page, and show that you have requested a Gerrit account.
 * Open up your personal wiki in a web browser and show the helper that you can log in and log out.

Hooray!

Success!
You are done with laptop setup!

Take a break, stretch, meet some neighbors, and ask the staff if you have any questions about this material.

Now, back to the Hackathon
&laquo; Back to the Hackathon