Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Provide Patches: We encourage you to assign the relevant JIRA issue to yourself and supply a patch for it. The patch you provide can be code, documentation, build changes, or any combination of these. More information on this is available in the following sections.

Providing Patches

In order to provide patches, follow these guidelines:

  • Make sure there is a JIRA:
    1. If you are working on fixing a problem that already has an associated JIRA, then go ahead and assign it to yourself.
    2. If it is already assigned to someone else, check with the current assignee before moving it over to your queue.
    3. If the current assignee has already worked out some part of the fix, suggest that you can take that change over from them and complete the remaining parts.
  • Attach the patches as you go through development:
    • While small fixes are easily done in a single patch, it is preferable that you attach patches to the JIRA as you go along. This serves as an early feedback mechanism where interested folks can look it over and suggest changes where necessary. It also ensures that if for some reason you are not able to find the time to complete the change, someone else can take up your initial patches and drive them to completion.
  • Before you submit your patch:
    1. Your change should be well-formatted and readable. Please use two spaces for indentation (no tabs).
    2. Carefully consider whether you have handled all boundary conditions and have provided sufficiently defensive code where necessary.
    3. Add one or more unit tests, if your change is not covered by existing automated tests.
    4. Insert javadocs and code comments where appropriate.
    5. Update the Flume User Guide (source) if your change affects the Flume config file or any user interface. Include those changes in your patch.
    6. Make sure you update the relevant developer documentation, wiki pages, etc. if your change affects the development environment.
  • Test your changes before submitting a review:
    • Before you make the JIRA status as "Patch Available", please test your changes thoroughly. Try any new feature or fix out for yourself, and make sure that it works.
    • Make sure that all unit/integration tests are passing, and that the functionality you have worked on is tested through existing or new tests.
    • You can run all the tests by going to the root level of the source tree and typing mvn clean install.
  • How to create a patch file:
    • The preferred naming convention for Flume patches is FLUME-12345.patch, or FLUME-12345-0.patch where 12345 is the JIRA number. You might want to name successive versions of the patch something like FLUME-12345-2.patch as you iterate on your changes based on review feedback and re-submit them.
    • The command to generate the patch is "git diff". Example:
      Code Block
      $ git diff > /path/to/FLUME-1234-0.patch
  • How to apply someone else's patch file:
    • You can apply someone else's patch with the GNU patch tool. Example:
      Code Block
      
      $ cd ~/src/flume # or wherever you keep the root of your Flume source tree
      $ patch -p1 < FLUME-1234.patch
      
    • Contributors may variously submit patches in a couple of different formats. If you get some dialog from the patch tool asking which file you want to patch, try variously the "-p1" or "-p0" flags to patch. Without any additional arguments, git diff generates patches that are applied using patch -p1. If you use git diff --no-prefix to generate your patch, you have to apply it using patch -p0. The ReviewBoard tool understands both formats and is able to apply both types automatically.
  • Submitting your patch for review:
    1. To submit a patch, attach the patch file to the JIRA and change the status of the JIRA to "Patch Available".
    2. If the change is non-trivial, please also post it for review on the Review Board. Use the Repository "flume-git" on Review Board.
  • Identify a reviewer:
    1. When posting on review board (repository: "flume-git"), always add the Group "Flume" to the list of reviewers.
    2. Optionally, you may also add a specific reviewer to the review. You can pick any of the project committers for review. Note that identifying a reviewer does not stop others from reviewing your change. Be prepared for having your change reviewed by others at any time.
    3. If you have posted your change for review and no one has had a chance to review it yet, you can gently remind everyone by dropping a note on the developer mailing list with a link to the review.
  • Work with reviewers to get your change fleshed out:
    1. When your change is reviewed, please engage with the reviewer via JIRA or review board to get necessary clarifications and work out other details.
    2. The goal is to ensure that the final state of your change is acceptable to the reviewer so that they can +1 it.

Reviewing Code

Flume uses the Apache Review Board for doing code reviews. In order for a change to be reviewed, it should be either posted on the review board or attached to the JIRA. If the change is a minor change affecting only few lines and does not seem to impact main logic of the affected sources, it need not be posted on the review board. However, if the code change is large or otherwise impacting the core logic of the affected sources, it should be posted on the review board. Feel free to comment on the JIRA requesting the assignee to post the patch for review on review board.

...

If a change has met all your criteria for review, please +1 the change to indicate that you are happy with it.

Providing Patches

In order to provide patches, follow these guidelines:

  • Make sure there is a JIRA: If you are working on fixing a problem that already has an associated JIRA, then go ahead and assign it to yourself. If it is already assigned to someone else, check with the current assignee before moving it over to your queue. If the current assignee has already worked out some part of the fix, suggest that you can take that change over from them and complete the remaining parts.
  • Attach the patches as you go through development: While small fixes are easily done in a single patch, it is preferable that you attach patches to the JIRA as you go along. This serves as an early feedback mechanism where interested folks can look it over and suggest changes where necessary. It also ensures that if for some reason you are not able to find the time to complete the change, someone else can take up your initial patches and drive them to completion.
  • Before you submit your patch: Address the below before you post your patch for review.
    1. Your change should be well-formatted and readable. Please use two spaces for indentation (no tabs).
    2. Carefully consider whether you have handled all boundary conditions and have provided sufficiently defensive code where necessary.
    3. Add one or more unit tests, if your change is not covered by existing automated tests.
    4. Insert javadocs and code comments where appropriate.
    5. Update the Flume User Guide (source) if your change affects the Flume config file or any user interface. Include those changes in your patch.
    6. Make sure you update the relevant developer documentation, wiki pages, etc. if your change affects the development environment.
  • Test your changes before submitting a review: Before you make the JIRA status as 'Patch Available', please test your changes thoroughly. Make sure that all tests are passing and that the functionality you have worked on is tested through existing or new tests.
  • Submitting a patch: To submit a patch, first make sure that you have attached it to the JIRA and changed the status of the JIRA to 'Patch Available'. If the change is non-trivial, then please also post the patch for review on review board under the repository "flume-git". The command to generate the patch is:
    Code Block
    $ git diff > /path/to/patch-file.patch

...

with

...

it.