You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Contributing Code

The process for contributing code works like this:

  1. Discuss your changes on the crunch-dev mailing list
  2. Create a JIRA issue unless there isn't one already
  3. Prepare a patch containing your changes
  4. Submit the patch by attaching it to the JIRA issue

Pretty simple, right? Let's get to the details.

Discuss your changes

Except for simple, straight forward bug fixes you should discuss any changes you plan to make on the crunch-dev mailing list. Describe the problem to solve and outline the solution if you have one in mind already. Letting us know early makes sure nobody else is working on this and we can also help you with design choices.

Create a JIRA issue

We use JIRA to track all code contributions from non-committers. This way all communication about your contribution stays in one place and you don't have to follow crunch-dev closely.

As soon as you got the green light from crunch-dev, you can create a new JIRA issue unless there is one already. The issue should describe the change you're about to make. We will assign this issue to you if you don't have the privileges to do it yourself.

Prepare a patch

To prepare a patch you need some basic Git commands. If you're not yet familiar with Git, the Getting Started and Contributing to a Project chapters of the Git book will be helpful.

Make sure you have a clean, up to date repository, for example by cloning the public repository:

  $ git clone http://git-wip-us.apache.org/repos/asf/incubator-crunch.git
  $ cd incubator-crunch

Create a new branch named like the JIRA issue:

  $ git checkout -b CRUNCH-42

Implement your changes and run the integration test suite to be sure you didn't break anything:

  $ edit file1 file2 ...
  $ mvn clean install

Add all modified and new files to git's index and commit:

  $ git add file1 file2 ...
  $ git commit

Now create the patch:

  $ git format-patch

Of course, you may also split your changes across multiple commits and provide multiple patches. In general, patches should be rather small and focused which makes reviews easier.

For bonus points clone a fresh Crunch repository and make sure your patches apply cleanly:

  $ git am 0001-CRUNCH-42-Your-changes.patch

Submit the patch

Attach your patches to your JIRA issue along with a comment that you're ready for review. On the "Attach Files" screen don't forget to donate your contribution to Apache by ticking the checkbox "Grant license to ASF for inclusion in ASF works". We will then check the patch and get back to you, possibly pointing out things that need fixing. You can implement fixes on your branch and create additional patches on top of your existing ones.

When your contribution has been accepted, we will merge the code and set the JIRA issue's status to Resolved.

  • No labels