Versions Compared

Key

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


 

Table of Contents
typeflat

All changes to the Geode codebase are tracked via the via ASF JIRA. Anybody contributing to Geode is highly encouraged to create a 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 the 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 the JIRA + Attachement Attachment route, the review step of this document should still apply.

...

  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:

    Code Block
     git clone https://git-wip-us.apache.org/repos/asf/geode.gitgithub.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':

    Code Block
    cd geode
    git remote add myfork https://github.com/markito/geode
    


  4. Your git remote should look like the following:

    Code Block
     git remote -v
    origin    https://git-wip-us.apache.org/repos/asf/geode.gitgithub.com/apache/geode (fetch)
    origin    https://git-wip-us.apache.org/repos/asf/geode.gitgithub.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).

    Code Block
    git checkout develop
    

    Geode follows git-flow conventions so if you do have git-flow installed in your system just do:

    Code Block
     git flow init
    

    Answer master on the first question ("Which branch should be used for bringing forth production releases?").  Press enter for the remaining questions to select the default options. 

     


  6. Then create your feature branch with the number of the JIRA task that describes your work (fix/feature).

    Code Block
     git flow feature start GEODE-41
    Switched to a new branch 'feature/GEODE-41'
    Summary of actions:
    - A new branch 'feature/GEODE-41' was created, based on 'develop'
    - You are now on branch 'feature/GEODE-41'
    Now, start committing on your feature. When done, use:
    git flow feature finish GEODE-41
    

    If you don't have git flow, you can just create a feature branch manuallyYou can call the branch whatever your want (it's your fork!) but the convention is to use feature/GEODE-XXX.

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



  7. Before committing and pushing your work, run the code formatter to format your code according to geode conventions

    Code Block
    ./gradlew spA


  8. Run any relevant tests and the basic build against your changes

    Code Block
    ./gradlew build


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

    Code Block
     git commit -a
    


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

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

    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.

    Code Block
     ./gradlew precheckin
    


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

    Code Block
     git push -u myfork feature/GEODE-41
    


  12. Open the GitHub web interface and you should see your just-pushed branch with a 'Compare & pull request' button:



  13. This will lead to the 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
    Image Removed 

     

    . Once your PR is created, the CI system will run checks against your PR, which may take a couple of hours. You may want to create your PR as a draft PR so that you can see if your PR passes the checks before opening it up for review.  All checks must pass before your PR can be merged.

    Image Added


The review process starts

...

. Once approved, your PR will be need to be merged into develop.

...

If it's not approved or requires some additional work, make changes and go back to the commit step.

Accepting

...

a Pull-request

...

Once the PR is approved

...

,

...

  1. Clone the ASF git repository (if you haven't done yet)

    Code Block
     git clone https://git-wip-us.apache.org/repos/asf/geode.git
    
  2. Add GitHub remote

    Code Block
     git remote add github https://github.com/apache/geode
    
  3. (for local review) Fetch the pull request into a feature branch for review

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

    Code Block
     git flow feature finish -rF GEODE-41
    Switched to branch 'develop'
    Your branch is up-to-date with 'origin/develop'.
    Updating f7af251..1f2e32a
    Fast-forward
    COMPILING.txt | 4 +++-
    1 file changed, 3 insertions(+), 1 deletion(-)
    Deleted branch feature/GEODE-41 (was 1f2e32a).
    Summary of actions:
    - The feature branch 'feature/GEODE-41' was merged into 'develop'
    - Feature branch 'feature/GEODE-41' has been removed
    - You are now on branch 'develop'
    
  5. 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'.

    Code Block
    git log
    git rebase -i
  6. Finally, push the commit to the origin repository.
Code Block
 git push origin

...

Code Block
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

...

if you are 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).
Image Added


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.