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

Compare with Current View Page History

« Previous Version 24 Next »

 

All changes to Geode codebase are tracked via the ASF JIRA. Anybody contributing to Geode is highly encouraged to create JIRA issue describing the nature of the contribution. Remember that even if you start with sending us a pull request ASF JIRA will be required anyway.

When submitting actual code to Apache Geode in a form of a patch contributors have pretty much two alternatives: GitHub pull request or a git-format patch attached to a JIRA ticket.
This document covers the steps for GitHub pull requests, but if a contributor decides to go JIRA + Attachement route the review step of this document should still apply.

Using GitHub

  1. Fork the Apache Geode mirror project on GitHub - https://github.com/apache/geode


     


     

  2. Clone the apache repository locally so you can start working:

     git clone https://github.com/apache/geode
    
  3. After cloning add your fork as an additional remote so you can push code to your fork. Substitute your GitHub username for 'markito' in this example, or use the GitHub 'HTTPS Clone URL':

    cd geode
    git remote add myfork https://github.com/markito/geode
    
  4. Your git remote should look like the following:

     git remote -v
    origin    https://github.com/apache/geode (fetch)
    origin    https://github.com/apache/geode (push)
    myfork    https://github.com/markito/geode (fetch)
    myfork    https://github.com/markito/geode (push)
    
  5. Create a local develop branch (develop is where all new development work goes).

    git checkout develop
    
  6. Then create your feature branch with the number of the JIRA task that describes your work (fix/feature). The convention is to use feature/GEODE-XXX.

    git checkout develop
    git pull
    git checkout -b feature/GEODE-41


    Geode follows git flow conventions. If you want, you can install the command line tool git flow to help you follow those conventions.

  7. Complete your work (commits) and in order to update the ticket with your progress

     git commit -a
    


    Follow the guidelines for good commit messages. Here's an example:

    GEODE-526: Fix oplog unit test race condition
        
    KRF files are created asynchronously. The test needs to wait for the files to be
    created before checking header content.
  8. If you've modified source code, execute the precheckin gradle task in order to perform tests related to the components affected by your change. All tests must pass. When in doubt ask on @dev list.

     ./gradlew precheckin
    
  9. When work is complete, consider whether documentation to be updated or created due to the new feature.
  10. If/When needed to push your local work to GitHub use the following command:

     git push -u myfork feature/GEODE-41
    
  11. Open GitHub web interface and you should see your just pushed branch with a 'Compare & pull request' button



  12. This will lead to Open a pull request page with detailed information on which fork and branch you going from/to. You should add some descriptive information if needed and finally click on Create pull request

     

     

  13. The review process starts and once approved your PR will be merged into develop. if it's not approved or requires some additional work, go back to the commit step.

    Accepting the Pull-request

    As a reviewer/committer do the review using GitHub or if needed request a ReviewBoard submission.

    Once the PR is approved since the GitHub repository as a committer you can just merge the PR using the Merge button at the bottom of the pull request. Click the arrow next to the merge button and select the appropriate merge choice (Usually squash and merge to create a single commit on develop).



  14. If there are conflicts, our you would rather you can merge a PR from the command line

 

  1. (for local review) Fetch the pull request into a feature branch for review (Here's a neat trick to make this easier: https://gist.github.com/gnarf/5406589)

     git fetch origin pull/6/head:feature/GEODE-41
    git checkout feature/GEODE-41
    Where:
    6 -> PR number
    feature/GEODE-41 -> local destination branch
    
  2. (for local review) After review is complete you can merge the feature into develop and remove the branch

    git checkout develop
    git merge feature/GEODE-41
    git branch -d feature/GEODE-41 
  3. Review the changes and rebase if necessary to clean up and modify the history. If there are multiple commits, you may want to squash them together. Remember to add 'This closes #6' to the last commit message so that github will automatically close the PR. If the PR is comprised of just one commit, you can omit the rebase and simply add 'This closes #6' by using 'commit --amend'.

    git log
    git rebase -i            --> Append line "This closes #6" where #6 is the pull request id.
  4. Finally, push the commit to the origin repository.
 git push origin

Given the commit message with the PR number after the push the PR on GitHub will be closed and the JIRA ticket updated.

When using git log command you will see that Author: and Committer: fields are properly updated and credit is given to the contributor.  For example:

commit c562d3439577c0bf12cc0e39157761a8dd69da1f
Author: Dan Smith <dsmith@pivotal.io>
Commit: William Markito <wmarkito@pivotal.io>

Rejecting PRs without committing

If reviewers or committers needs to close a PR if for instance, after proper evaluation it's something that won't get fixed it can be done through an empty commit message

git commit --allow-empty -m "Closes #6 *Won't fix*"
git push origin

Website publishing

The Geode website is maintained as part of the repository, within the geode-site directory. Instructions for updating the website are in the geode-site/website/README.md file.

  • No labels