Child pages
  • How To Contribute
Skip to end of metadata
Go to start of metadata

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 have 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 https://git-wip-us.apache.org/repos/asf/crunch.git
  $ cd 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 master

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. 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