|
| 1 | +--- |
| 2 | +title: How To Contribute |
| 3 | +sidebar_label: How To Contribute |
| 4 | +--- |
| 5 | + |
| 6 | +# How to contribute |
| 7 | + |
| 8 | +*Contributing to an Apache project* is about more than just writing code -- |
| 9 | +it's about doing what you can to make the project better. There are lots |
| 10 | +of ways to contribute! |
| 11 | + |
| 12 | +<a name="HowToContribute-BeInvolved"></a> |
| 13 | +## Get Involved |
| 14 | + |
| 15 | +Discussions at Apache happen on the mailing list. To get involved, you should join the [Mahout mailing lists](../community/mailing-lists). In particular: |
| 16 | + |
| 17 | +* The **user list** (to help others) |
| 18 | +* The **development list** (to join discussions of changes) -- This is the best place |
| 19 | +to understand where the project is headed. |
| 20 | +* The **commit list** (to see changes as they are made) |
| 21 | + |
| 22 | +Please keep discussions about Mahout on list so that everyone benefits. |
| 23 | +Emailing individual committers with questions about specific Mahout issues |
| 24 | +is discouraged. See [https://www.apache.org/theapacheway/](https://www.apache.org/theapacheway/) |
| 25 | +. Apache has a number of [email tips for contributors][1] as well. |
| 26 | + |
| 27 | +<a name="HowToContribute-WhattoWorkOn?"></a> |
| 28 | +## What to Work On? |
| 29 | + |
| 30 | +What do you like to work on? There are a ton of things in Mahout that we |
| 31 | +would love to have contributions for: documentation, performance improvements, better tests, etc. |
| 32 | +The best place to start is by looking into our [issue tracker](https://issues.apache.org/jira/browse/MAHOUT) and |
| 33 | +seeing what bugs have been reported and seeing if any look like you could |
| 34 | +take them on. Small, well written, well tested patches are a great way to |
| 35 | +get your feet wet. It could be something as simple as fixing a typo. The |
| 36 | +more important piece is you are showing you understand the necessary steps |
| 37 | +for making changes to the code. Mahout is a pretty big beast at this |
| 38 | +point, so changes, especially from non-committers, need to be evolutionary |
| 39 | +not revolutionary since it is often very difficult to evaluate the merits |
| 40 | +of a very large patch. Think small, at least to start! |
| 41 | + |
| 42 | +Beyond JIRA, hang out on the dev@ mailing list. That's where we discuss |
| 43 | +what we are working on in the internals and where you can get a sense of |
| 44 | +where people are working. |
| 45 | + |
| 46 | +Also, documentation is a great way to familiarize yourself with the code |
| 47 | +and is always a welcome addition to the codebase and this website. Feel free |
| 48 | +to contribute texts and tutorials! Committers will make sure they are added |
| 49 | +to this website, and we have a [guide for making website updates][2]. |
| 50 | +We also have a [wide variety of books and slides][3] for learning more about |
| 51 | +machine learning algorithms. |
| 52 | + |
| 53 | +If you are interested in working towards being a committer, general guidelines are available in the [Apache Community documentation](https://community.apache.org/contributors/). |
| 54 | + |
| 55 | +<a name="HowToContribute-ContributingCode(Features,BigFixes,Tests,etc...)"></a> |
| 56 | +## Contributing Code (Features, Big Fixes, Tests, etc...) |
| 57 | + |
| 58 | +This section identifies the ''optimal'' steps community member can take to |
| 59 | +submit a changes or additions to the Mahout code base. This can be new |
| 60 | +features, bug fixes optimizations of existing features, or tests of |
| 61 | +existing code to prove it works as advertised (and to make it more robust |
| 62 | +against possible future changes). |
| 63 | + |
| 64 | +Please note that these are the "optimal" steps, and community members that |
| 65 | +don't have the time or resources to do everything outlined on this below |
| 66 | +should not be discouraged from submitting their ideas "as is" per "Yonik |
| 67 | +Seeley's (Solr committer) Law of Patches": |
| 68 | + |
| 69 | +*A half-baked patch in Jira, with no documentation, no tests and no backwards compatibility is better than no patch at all.* |
| 70 | + |
| 71 | +Just because you may not have the time to write unit tests, or cleanup |
| 72 | +backwards compatibility issues, or add documentation, doesn't mean other |
| 73 | +people don't. Putting your patch out there allows other people to try it |
| 74 | +and possibly improve it. |
| 75 | + |
| 76 | +<a name="HowToContribute-Gettingthesourcecode"></a> |
| 77 | +## Getting the source code |
| 78 | + |
| 79 | +First of all, you need to get the Mahout source code from [GitHub](https://github.com/apache/mahout). Most development is done on the "main" branch. The first step to making a contribution is to fork Mahout's main branch to your GitHub repository. |
| 80 | + |
| 81 | + |
| 82 | +<a name="HowToContribute-MakingChanges"></a> |
| 83 | +## Making Changes |
| 84 | + |
| 85 | +Before you start, you should send a message to the [Mahout developer mailing list](../community/mailing-lists) |
| 86 | +(note: you have to subscribe before you can post), or file a ticket in our [issue tracker](https://issues.apache.org/jira/browse/MAHOUT). |
| 87 | +Describe your proposed changes and check that they fit in with what others are doing and have planned for the project. Be patient, it may take folks a while to understand your requirements. |
| 88 | + |
| 89 | + 1. Create a JIRA Issue in the [issue tracker](https://issues.apache.org/jira/browse/MAHOUT) (if one does not already exist) |
| 90 | + 2. Pull the code from your GitHub repository |
| 91 | + 3. Ensure that you are working with the latest code from the [apache/mahout](https://github.com/apache/mahout) main branch. |
| 92 | + 3. Modify the source code and add some (very) nice features. |
| 93 | + - Be sure to adhere to the following points: |
| 94 | + - All public classes and methods should have informative Javadoc |
| 95 | + comments. |
| 96 | + - Code should be formatted according to standard |
| 97 | + [Java coding conventions](http://www.oracle.com/technetwork/java/codeconventions-150003.pdf), |
| 98 | + with two exceptions: |
| 99 | + - indent two spaces per level, not four. |
| 100 | + - lines can be 120 characters, not 80. |
| 101 | + - Contributions should pass existing unit tests. |
| 102 | + - New unit tests should be provided to demonstrate bugs and fixes. |
| 103 | + 4. Commit the changes to your local repository. |
| 104 | + 4. Push the code back up to your GitHub repository. |
| 105 | + 5. Create a [Pull Request](https://help.github.com/articles/creating-a-pull-request) to the to apache/mahout repository on Github. |
| 106 | + - Include the corresponding JIRA Issue number and description in the title of the pull request: |
| 107 | + - ie. MAHOUT-xxxx: < JIRA-Issue-Description > |
| 108 | + 6. Committers and other members of the Mahout community can then comment on the Pull Request. Be sure to watch for comments, respond and make any necessary changes. |
| 109 | + |
| 110 | +Please be patient. Committers are busy people too. If no one responds to your Pull Request after a few days, please make friendly reminders on the mailing list. Please |
| 111 | +incorporate other's suggestions into into your changes if you think they're reasonable. Finally, remember that even changes that are not committed are useful to the community. |
| 112 | + |
| 113 | +<a name="HowToContribute-UnitTests"></a> |
| 114 | +#### Unit Tests |
| 115 | + |
| 116 | +Please make sure that all unit tests succeed before creating your Pull Request. |
| 117 | + |
| 118 | +Run *mvn clean test*, if you see *BUILD SUCCESSFUL* after the tests have finished, all is ok, but if you see *BUILD FAILED*, |
| 119 | +please carefully read the errors messages and check your code. |
| 120 | + |
| 121 | +#### Do's and Don'ts |
| 122 | + |
| 123 | +Please do not: |
| 124 | + |
| 125 | +* reformat code unrelated to the bug being fixed: formatting changes should |
| 126 | +be done in separate issues. |
| 127 | +* comment out code that is now obsolete: just remove it. |
| 128 | +* insert comments around each change, marking the change: folks can use |
| 129 | +subversion to figure out what's changed and by whom. |
| 130 | +* make things public which are not required by end users. |
| 131 | + |
| 132 | +Please do: |
| 133 | + |
| 134 | +* try to adhere to the coding style of files you edit; |
| 135 | +* comment code whose function or rationale is not obvious; |
| 136 | +* update documentation (e.g., ''package.html'' files, the website, etc.) |
| 137 | + |
| 138 | + |
| 139 | +<a name="HowToContribute-Review/ImproveExistingPatches"></a> |
| 140 | +## Review/Improve Existing Pull Requests |
| 141 | + |
| 142 | +If there's a JIRA issue that already has a Pull Request with changes that you think are really good, and works well for you -- please add a comment saying so. If there's room |
| 143 | +for improvement (more tests, better javadocs, etc...) then make the changes on your GitHub branch and add a comment about them. If a lot of people review a Pull Request and give it a |
| 144 | +thumbs up, that's a good sign for committers when deciding if it's worth spending time to review it -- and if other people have already put in |
| 145 | +effort to improve the docs/tests for an issue, that helps even more. |
| 146 | + |
| 147 | +For more information see [Handling GitHub PRs](http://mahout.apache.org/documentation/developers/github). |
| 148 | + |
| 149 | + |
| 150 | + [1]: http://www.apache.org/dev/contrib-email-tips |
| 151 | + [2]: http://mahout.apache.org/documentation/developers/how-to-update-the-website.html |
| 152 | + [3]: http://mahout.apache.org/general/books-tutorials-and-talks.html |
0 commit comments