Permalink
Switch branches/tags
tag_3.0.4_kumquat5 tag_3.0.4_kumquat4 tag_3.0.4_kumquat3 tag_3.0.4_kumquat2 tag_3.0.4_kumquat tag_2.2.14_mango tag-zbaremetal tag-Acton tag-Acton.RC4 tag-Acton.RC3 tag-Acton.RC2 tag-Acton.RC1 tag-219RC1 tag-3.0.5.rc1 tag-3.0.5-prerelease3 tag-3.0.5-prerelease1 tag-3.0.5-beta1 tag-3.0.4 tag-3.0.3 tag-3.0.3-prerelease5 tag-3.0.3-prerelease4 tag-3.0.3-prerelease3 tag-3.0.3-prerelease2 tag-3.0.3-prerelease1 tag-3.0.2 tag-3.0.2.prerelease2 tag-3.0.2.prerelease1 tag-3.0.2-prerelease5 tag-3.0.2-prerelease4 tag-3.0.2-prerelease3 tag-3.0.1 tag-3.0.1-prerelease-1 tag-2.2.15-RC4 tag-2.2.15-RC3 tag-2.2.15-RC2 tag-2.2.15-RC1 tag-2.2.14 tag-2.2.14-RC2 tag-2.2.14-P2 tag-2.2.13 tag-2.2.12 tag-2.2.12-prerelease-3 tag-2.2.12-prerelease-2 tag-2.2.12-prerelease-1 tag-2.2.11 tag-2.2.10 tag-2.2.10-2 tag-2.2.9 tag-2.2.8 tag-2.2.8.RC2 tag-2.2.8.RC1 tag-2.2.7 tag-2.2.7.RC2 tag-2.2.7.RC1 tag-2.2.6 tag-2.2.5 tag-2.2.5-RC3 tag-2.2.5-RC2 tag-2.2.5-RC1 tag-2.2.4 tag-2.2.4-RC1 tag-2.2.3 tag-2.2.2 tag-2.2.1 tag-2.1.11 tag-2.1.10 tag-2.1.10.zucchini tag-2.1.9 tag-2.1.8 tag-2.1.8RC1 portgroup_no_gc_tag patch-13777/13375-fix ovm3 acton-prerelease-3 acton-prerelease-2 acton-prerelease-1 acton-beta1-prerelease-1 TAG_2.2.15_GA TAG_CLOUDPLATFORM_3.0.5_RC2 TAG_CLOUDPLATFORM_3.0.5_GA TAG_CLOUDPLATFORM_3.0.4_RC2 TAG_CLOUDPLATFORM_3.0.4_RC1 TAG_CLOUDPLATFORM_3.0.4_GA2 TAG_CLOUDPLATFORM_3.0.4_GA TAG_CLOUDPLATFORM_2.2.15_GA2 TAG_CLOUDPLATFORM_2.2.15_GA 4.11.1.0 4.11.1 4.11.0.0 4.10.0.0 4.9.3.1 4.9.3.0 4.9.2.0 4.9.1.0 4.9.1-RC1 4.9.0.1 4.9.0 4.8.2.0 4.8.1.1 4.8.1
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
140 lines (94 sloc) 7.39 KB

Contributing to Apache CloudStack (ACS)

Summary

This document covers how to contribute to the ACS project. ACS uses github PRs to manage code contributions. These instructions assume you have a GitHub.com account, so if you don't have one you will have to create one. Your proposed code changes will be published to your own fork of the ACS project and you will submit a Pull Request for your changes to be added.

Lets get started!!!

Bug fixes

It's very important that we can easily track bug fix commits, so their hashes should remain the same in all branches. Therefore, a pull request (PR) that fixes a bug, should be sent against a release branch. This can be either the "current release" or the "previous release", depending on which ones are maintained. Since the goal is a stable master, bug fixes should be "merged forward" to the next branch in order: "previous release" -> "current release" -> master (in other words: old to new)

Developing new features

Development should be done in a feature branch, branched off of master. Send a PR(steps below) to get it into master (2x LGTM applies). PR will only be merged when master is open, will be held otherwise until master is open again. No back porting / cherry-picking features to existing branches!

PendingReleaseNotes file

When developing a new feature or making a (major) change to a existing feature you are encouraged to append this to the PendingReleaseNotes file so that the Release Manager can use this file as a source of information when compiling the Release Notes for a new release.

When adding information to the PendingReleaseNotes file make sure that you write a good and understandable description of the new feature or change which you have developed.

Updating the PendingReleaseNotes file is preferably a part of the original Pull Request, but that is up to the developers' discretion.

Fork the code

In your browser, navigate to: https://github.com/apache/cloudstack

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. Copy the Git repository URL by clicking on the clipboard next to the URL on the right hand side of the page under 'HTTPS clone URL'. You will paste this URL when doing the following git clone command.

On your computer, follow these steps to setup a local repository for working on ACS:

$ git clone https://github.com/YOUR_ACCOUNT/cloudstack.git
$ cd cloudstack
$ git remote add upstream https://github.com/apache/cloudstack.git
$ git checkout master
$ git fetch upstream
$ git rebase upstream/master

Making changes

It is important that you create a new branch to make changes on and that you do not change the master branch (other than to rebase in changes from upstream/master). In this example I will 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 the ACS project.

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.

$ git checkout -b feature_x
   (make your changes)
$ git status
$ git add .
$ git commit -a -m "descriptive commit message for your changes"

The -b specifies that you want to create a new branch called feature_x. You only specify -b the first time you checkout because you are creating a new branch. Once the feature_x branch exists, you can later switch to it with only git checkout feature_x.

Rebase feature_x to include updates from upstream/master

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 ACS project repository) into your local repository. You will want to do this before you start working on a feature as well as right before you submit your changes as a pull request. I recommend you do this process periodically while you work to make sure you are working off the most recent project code.

This process will do the following:

  1. Checkout your local master branch
  2. Synchronize your local master branch with the upstream/master so you have all the latest changes from the project
  3. 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 in upstream/master.

Make a GitHub Pull Request to contribute your changes

When you are happy with your changes and you are ready to contribute them, you will create a Pull Request on GitHub 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.

Please include JIRA id, detailed information about the bug/feature, what all tests are executed, how the reviewer can test this feature etc. Incase of UI PRs, a screenshot is preferred.

IMPORTANT: Make sure you have rebased your feature_x branch to include the latest code from upstream/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:

  1. In your browser, navigate to your forked repository: https://github.com/YOUR_ACCOUNT/cloudstack
  2. Click the new button called 'Compare & pull request' that showed up just above the main area in your forked repository
  3. Validate the pull request will be into the upstream master and will be from your feature_x branch
  4. 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.

Cleaning up after a successful pull request

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.

IMPORTANT: Make sure that your changes are in upstream/master before you delete your feature_x and origin/feature_x branches!

You can delete these deprecated branches with the following:

$ git checkout master
$ git branch -D feature_x
$ git push origin :feature_x

Release Principles

Detailed information about ACS release principles is available at https://cwiki.apache.org/confluence/display/CLOUDSTACK/Release+principles+for+Apache+CloudStack+4.6+and+up