A.2. Contributing to Documentation or Other Strings

If you spot an error in a string in a UI, utility, script, log message, or elsewhere, or you think something could be made more clear, or you think text needs to be added where it doesn't currently exist, the first step is to file a JIRA. Be sure to set the component to Documentation in addition any other involved components. Most components have one or more default owners, who monitor new issues which come into those queues. Regardless of whether you feel able to fix the bug, you should still file bugs where you see them.

If you want to try your hand at fixing your newly-filed bug, assign it to yourself. You will need to clone the HBase Git repository to your local system and work on the issue there. When you have developed a potential fix, submit it for review. If it addresses the issue and is seen as an improvement, one of the HBase committers will commit it to one or more branches, as appropriate.

Procedure A.1. Suggested Work flow for Submitting Patches

This procedure goes into more detail than Git pros will need, but is included in this appendix so that people unfamiliar with Git can feel confident contributing to HBase while they learn.

  1. If you have not already done so, clone the Git repository locally. You only need to do this once.

  2. Fairly often, pull remote changes into your local repository by using the git pull command, while your master branch is checked out.

  3. For each issue you work on, create a new branch. One convention that works well for naming the branches is to name a given branch the same as the JIRA it relates to:

    $ git checkout -b HBASE-123456
  4. Make your suggested changes on your branch, committing your changes to your local repository often. If you need to switch to working on a different issue, remember to check out the appropriate branch.

  5. When you are ready to submit your patch, first be sure that HBase builds cleanly and behaves as expected in your modified branch. If you have made documentation changes, be sure the documentation and website builds.

    Note

    Before you use the site target the very first time, be sure you have built HBase at least once, in order to fetch all the Maven dependencies you need.

    $ mvn clean install -DskipTests               # Builds HBase
    $ mvn clean site -DskipTests                  # Builds the website and documentation

    If any errors occur, address them.

  6. If it takes you several days or weeks to implement your fix, or you know that the area of the code you are working in has had a lot of changes lately, make sure you rebase your branch against the remote master and take care of any conflicts before submitting your patch.

    $ git checkout HBASE-123456
    $ git rebase origin/master                
                    
  7. Generate your patch against the remote master. Run the following command from the top level of your git repository (usually called hbase):

    $ git diff --no-prefix origin/master > HBASE-123456.patch

    The name of the patch should contain the JIRA ID. Look over the patch file to be sure that you did not change any additional files by accident and that there are no other surprises. When you are satisfied, attach the patch to the JIRA and click the Patch Available button. A reviewer will review your patch. If you need to submit a new version of the patch, leave the old one on the JIRA and add a version number to the name of the new patch.

  8. After a change has been committed, there is no need to keep your local branch around. Instead you should run git pull to get the new change into your master branch.

comments powered by Disqus