Contributing to Forseti
We welcome your patches and contributions to this project. This page describes the few small guidelines we'll need you to follow.
Submitting a Contributor License Agreement
Contributions to Forseti must be accompanied by a Contributor License Agreement (CLA). The CLA gives us permission to use and redistribute your contributions as part of the project. You or your employer retain the copyright to your contribution. To see any CLA you currently have on file or sign a new one, access Contributor License Agreements.
In most cases, you only need to submit a CLA once. If you've already submitted a CLA for any project, you probably won't need to submit a new CLA.
Following style guidelines and conventions
To maintain consistency, we ask that you follow the style guidelines suggested in the Google Python Style Guide and any existing styles in the current codebase. Style is checked using pylint. To confirm your pull request (PR) passes the Travis pylint test, the following test must run without any output:
$ workon YOUR_VIRTUALENV # Optional $ pip install pylint # From the root of forseti-security using pylint >= 1.6.5 $ PYTHONPATH=./ pylint --rcfile=./pylintrc
Submitting a pull request
To submit a pull request for Forseti, follow the process below:
Fork the project, clone your fork to your machine, and configure the upstream remote.
# Fork the project via GitHub UI. # Clone your forked repository into a local directory. $ git clone FORKED_REPOSITORY_URL # Navigate to your the directory. $ cd <path to your directory from above> # Assign the original repository to a remote called "upstream". # Using HTTPS $ git remote add upstream https://github.com/forseti-security/forseti-security.git # Using SSH $ git remote add upstream email@example.com:forseti-security/forseti-security.git # Verify new upstream remote is added correctly. $ git remote -v origin firstname.lastname@example.org:YOUR_FORK (fetch) origin email@example.com:YOUR_FORK (push) upstream firstname.lastname@example.org:forseti-security/forseti-security.git (fetch) upstream email@example.com:forseti-security/forseti-security.git (push)
Fetch the latest changes from upstream into your cloned repository:
$ git fetch upstream $ git checkout master $ git merge upstream/master
Create a new local development branch for your feature or bug fix:
$ git checkout -b YOUR_DEVELOPMENT_BRANCH
Create your change.
Create tests for your change.
- You should write applicable unit tests for your changes, especially for changes involving substantial logic.
- Learn how to run the tests.
Commit your changes and push them to your development branch:
$ git push origin YOUR_DEVELOPMENT_BRANCH
Open a pull request to begin the code review.
- All submissions, including submissions by project members, require a code review.
- The Github UI will display whether you have any merge conflicts that need to be resolved.
- All tests must pass before we review your PR. To ensure this happens we
recommend copying the
After your PR is approved and all merge conflicts are resolved, we'll merge your PR.