The Holon Platform is released under the Apache 2.0 license, if you would like to contribute to the platform this document should help you get started. We welcome pull requests but ask that you carefully read this document first to understand how best to submit them, what kind of changes are likely to be accepted, and what to expect from the Holon Platform team when evaluating your submission.
This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to dev@holon-platform.com.
We use GitHub issues to track bugs and enhancements. If you have a general usage question please ask on Stack Overflow.
The Holon Platform team monitor the holon-platform
tag.
If you are reporting a bug, please help to speed up problem diagnosis by providing as much information as possible.
For detailed information about pull requests and issues, take a look at GitHub's excellent help documentation first.
Is there already an issue that addresses your concern? Do a bit of searching in each repository issues section to see if you can find something similar. If you do not find something similar, please create a new issue before submitting a pull request unless the change is truly trivial (for example, typo fixes).
Please solve only one problem per path and separate each logical change into a separate patch. For example, if your changes include both bug fixes and performance enhancements, separate those changes into two or more patches.
If one patch depends on another patch in order for a change to be complete, note "this patch depends on patch X" in your patch description.
When dividing your change into a series of patches, take special care to ensure that the project builds and runs properly after each patch in the series.
Before we accept a patch or pull request we will need you to sign the Contributor License Agreement. Signing the contributor's agreement does not grant anyone commit rights to the repository, but it does mean that we can accept your contributions, and you will get an author credit if we do.
To build the source you will need to install Apache Maven v3.3.0 or above and JDK 1.8.
The master branch represents work toward the next release of each platform module. Please submit all pull requests there, even bug fixes and minor improvements.
In your browser, navigate to the Holon Platform repository on which you will work.
Fork the repository by clicking on the Fork button on the top right hand side. The fork will happen and you will be taken to your own fork of the repository in your GitHub account. Copy the Git repository URL (You can use the Clone or download repository button and copy the Clone with HTTPS URL) which will be used to clone the forked repository.
Follow these steps using Git bash to setup a local repository:
$ git clone https://github.com/YOUR_ACCOUNT/holon-repo.git
$ cd holon-repo
$ git remote add upstream https://github.com/holon-platform/holon-repo.git
$ git checkout master
$ git fetch upstream
$ git rebase upstream/master
It is important that you create a new branch to make changes on and that you do not change the master
branch. Let's assume you will be making your changes to a branch called feature_x
. This feature_x
branch will be created on your local repository and will be pushed to your forked repository on GitHub. Once this branch is on your fork, you will create a pull request for the changes to be added to Holon Platform repository master
branch.
It is best practice to create a new branch each time you want to contribute to the project and only track the changes for that pull request in this branch.
So, before working on your local repository code, checkout (and create it, if you have not done so yet) the branch to which you will making your changes:
$ git checkout -b feature_x
The
-b
specifies that you want to create a new branch calledfeature_x
. You only specify-b
the first time you checkout because you are creating a new branch. Once thefeature_x
branch exists, you can later switch to it with onlygit checkout feature_x
.
It is important that you maintain an up-to-date master
branch in your local repository. This is done by rebasing in the code changes from upstream/master
(the official Holon Platform repository you forked from) into your local repository. You will want to do this before you start working on a feature/issue as well as right before you submit your changes as a pull request. It's reccomended to do this process periodically while you work to make sure you are working off the most recent project code.
Using the feature_x
example branch, the following steps are needed:
- Checkout your local
master
branch - Synchronize your local
master
branch with theupstream/master
so you have all the latest changes from the project - Rebase the latest project code into your
feature_x
branch so it is up-to-date with the upstream code
$ git checkout master
$ git fetch upstream
$ git rebase upstream/master
$ git checkout feature_x
$ git rebase master
Now your
feature_x
branch is up-to-date with all the code inupstream/master
.
For non-trivial patches, we would like the patch to include automated tests. Unit tests are preferred. Test cases should succeed with the patch and fail without the patch.
If the patch is a performance improvement, please include some benchmark data that tells us how much the performance is improved.
Please configure git to use your real first and last name for any commits you intend to submit as pull requests, as submitted against the Contributor License Agreement (CLA):
Author: First Last <user@mail.com>
Please format your commit messages in the following way:
Short (50 chars or less) summary of changes (#1234)
More detailed explanatory text, if necessary.
Further paragraphs come after blank lines.
- Use imperative statements in the subject line; reference a ticket number if applicable.
- Restrict the subject line to 50 characters or less if possible.
- Describe the problem solved and what was done to solve the problem.
Make sure that all tests pass prior to submitting your pull request.
When you are ready to contribute your changes, you will create a pull request to do so. This is done by pushing your local changes to your forked repository (default remote name is origin
) and then initiating a pull request on GitHub.
Make sure you have rebased your
feature_x
branch to include the latest code fromupstream/master
before you do this.
$ git push origin master
$ git push origin feature_x
Now that the feature_x
branch has been pushed to your GitHub repository, you can initiate the pull request.
To initiate the pull request, do the following:
- In your browser, navigate to your forked repository:
https://github.com/YOUR_ACCOUNT/holon-repo
- Click the new button called Compare & pull request that showed up just above the main area in your forked repository
- Validate the pull request will be into the upstream
master
and will be from yourfeature_x
branch - Enter a detailed description of the work you have done and then click Send pull request
If you are requested to make modifications to your proposed changes, make the changes locally on your feature_x
branch, re-push the feature_x
branch to your fork. The existing pull request should automatically pick up the change and update accordingly.
Your pull request will almost certainly get comments from reviewers on ways in which the patch can be improved. Please respond to those comments and be sure to tell the reviewers what changes you are making.
After you have submitted your change, be patient...! Ideally we try to get a response within one business day. You should receive comments within a week; if that does not happen, make sure that you have sent your patches to the right place.
The Holon Platform team mission is to keep code quality and stability as high as possible, and to keep complexity at a minimum. Your changes, if accepted, may be heavily modified prior to merging. You will retain "Author:" attribution for your Git commits and it is granted that the bulk of your changes remain intact. You may be asked to rework the submission.
Once the feature_x
branch has been committed into the upstream/master
branch, your local feature_x
branch and the origin/feature_x
branch are no longer needed. If you want to make additional changes, restart the process with a new branch.
You can delete these deprecated branches with the following:
$ git checkout master
$ git branch -D feature_x
$ git push origin :feature_x
First of all, check the Holon Platform code structure and conventions document, which describes the basic philosophy with which platform code is developed and organized.
- Use tabs for indentation (not spaces)
- Eliminate all trailing whitespace
- Preserve existing formatting
- Use UTF-8 encoding for Java sources
- Use Unix (LF), not DOS (CRLF) line endings
Braces mostly follow the Kernighan and Ritchie style (a.k.a., "Egyptian brackets") for nonempty blocks and block-like constructs:
- No line break before the opening brace but prefixed by a single space
- Line break after the opening brace
- Line break before the closing brace
- Line break after the closing brace if that brace terminates a statement or the body of a method, constructor, or named class
- Line break before else, catch and finally statements
Use CONSTANT_CASE
for constant names: all uppercase letters, with words separated by underscores.
Every constant is a static final
field, but not all static final
fields are constants. Constant case should therefore be chosen only if the field is really a constant.
/*
* Copyright 2002-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ...;
Always check the date range in the license header. For example, if you've modified a file in 2017 whose header still reads:
/*
* Copyright 2002-2011 the original author or authors.
Then be sure to update it to 2017 accordingly:
/*
* Copyright 2002-2017 the original author or authors.
For example:
/**
* ...
*
* @author First Last
* @since 5.0
* @see ...
*/
Join the contribute Gitter room for any question and to contact us.
Feel free to write us at dev@holon-platform.com for any question, proposal or information request.
Read more about best practices in this github guide.