**This page is up to date as of 2011, Nov 23** ## How to contribute code 1. Check out the code from the Apache repository either via Git or SVN, get it to build on your machine (instructions on at the wiki [Home](Home.md), we don't currently support building on Windows) 2. If you encounter a bug while building, report it (see below for instructions) 2. Right now, all active development happens against "trunk" (we aren't yet, as of 2011/11/23, using SVN branches or tags). 1. Join the mesos-dev@incubator.apache.org mailing list by sending an email to mesos-dev-subscribe@incubator.apache.org 1. Find a JIRA that is currently unassigned that you want to work on at http://issues.apache.org/jira/browse/MESOS, or create your own (you'll need a JIRA account for this, see below)! 2. This could be a JIRA representing a bug (possibly a bug that you encountered and reported, e.g. when trying to build) or a new feature 1. Assign the JIRA to yourself. To do this, you will need: 2. An Apache JIRA user account (sign up for one [here](https://issues.apache.org/jira/secure/Signup!default.jspa)) 2. You need to be added to the list of Mesos "contributors" by a Mesos committer (send email to mesos-dev@incubator.apache.org) in order to be assigned (or to assign yourself) to a JIRA issue 1. Formulate a plan for resolving the issue, propose your plan via comments in the JIRA 1. Create one or more test cases to exercise the bug or the feature (the Mesos team uses [test-driven development](http://en.wikipedia.org/wiki/Test-driven_development)), before you start coding, make sure these test cases all fail. 1. Make your changes to the code (using whatever IDE/editor you choose) to actually fix the bug or implement the feature. 2. Before beginning, please read the [Mesos C++ Style Guide](Mesos-c++-style-guide.md) 2. Most of your changes will probably be to files inside of <BASE_MESOS_DIR>/src 2. To build, we recommend that you don't build inside of the src directory. We recommend you do the following: 3. From inside of the root Mesos directory: `mkdir build && cd build` 3. `../configure.` (e.g. `configure.macosx`) 3. `make` 3. now all of the files generated by the build process will be contained in the build directory you created, instead of being spread throughout the src directory, which is a bit messier. This is both cleaner, and makes it easy to clean up if you want to get rid of the files generated by `configure` and `make`. I.e. You can reset your build process without risking changes you made in the src directory, by simply deleting the build directory, and creating a new one. 1. Make sure all of your test cases now pass. 1. Think you're code is ready for review? 2. Make sure to pull in any changes that have been committed to trunk. If you are using Git, do this via something like: 3. `git remote update` 3. `git rebase origin/trunk` 3. Check the output of `git diff origin/trunk` and make sure it lists only your changes. If other changes you did not make are listed, try a merge to bring your branch up to date with origin/trunk. 2. Make sure it is building and all test cases are passing (run bin/tests/all-tests). To be extra sure, before moving on to requesting a review request, we recommend running `make clean && make` and then running the test cases. 1. Create a diff of your code changes, including your test case. 2. If you are using Git, and you haven't committed any of your changes to your local clone of the repository, use the command: `git diff > MESOS-XX.patch` where XX is your issue number 2. If you are using SVN, use the command: `svn diff > MESOS-XX.patch` 1. Create a review request at Review Board (RB), http://reviews.apache.org, and attach your diff. More detailed instructions: 2. Log in or create an account at reviews.apache.org (Apache's infrastructure doesn't have any sort of single-sign-in process, so you need to have an account specific to this instance of RB) 2. Create a new review request at https://reviews.apache.org/r/new/ 3. Under the field labeled "Repository" choose "Mesos" 3. Leave the field labeled "Base Directory" blank 3. Upload your diff via the field labeled "Diff" 3. Be sure to add your JIRA issue id (e.g. MESOS-01) to the field labeled "Bugs" (this will automatically link) 3. Under "Description" in addition to details about your changes, include a description of any wiki documentation pages need to be added, or are affected by your changes (e.g. did you change or add any configuration options/flags? Did you add a new binary?) 1. Wait for a code review from another Mesos developer via Review Board, address their feedback and upload updated patches until you receive a "Ship It" from a Mesos committer. 2. Review Board comments should be used for code-specific discussions, and JIRA comments for bigger-picture design discussions. 2. Always respond to each RB comment that you address directly (i.e. each comment can be responded to directly) with either "Done." or a comment explaining how you addressed it. 1. After consensus is reached on your JIRA/patch, you're review request will receive a "Ship It!" from a committer, and then a committer will commit your patch to the SVN repository. Congratulations and thanks for participating in our community! 1. Please ensure that the necessary wiki documentation gets created or updated (i.e. make the changes yourself!) ## Guidelines for using JIRA * We track all issues via Apache's hosted JIRA issue tracker: https://issues.apache.org/jira/browse/MESOS * A JIRA should be created for every task, feature, bug-fix, etc. * Always assign the JIRA to yourself before you start working on it. This helps to avoid duplication of work ## Using Review Board * A code review request should be created for every JIRA that involves a change to the codebase ## Style Guides * [Mesos C++ Style Guide](Mesos-c++-style-guide.md)