Thanks for your interest in improving the project! This document provides a step-by-step guide for general contributions to Chaos Mesh.
Before starting work on something major, please reach out to us via GitHub, Slack, email, etc. We will make sure no one else is already working on it and ask you to open a GitHub issue. Also, we will provide necessary guidance should you need it.
Specifically, if you want to develop a specific chaos type, you may also find Development Guide useful.
If you have a specific idea of a fix or update, follow these steps below to submit a PR:
- Step 1: Make changes
- Step 2: Run unit tests
- Step 3: Start Chaos Mesh locally and do manual tests
- Step 4: Commit and push your changes
- Step 5: Create a pull request
- Step 6: Get a code review
-
Fork the Chaos Mesh repo, and then clone it:
git clone git@github.com:your-github-username/chaos-mesh.git
-
Set your cloned local to track the upstream repository:
cd chaos-mesh git remote add upstream https://github.com/chaos-mesh/chaos-mesh -
Disable pushing to upstream master:
git remote set-url --push upstream no_push git remote -v
The output should look like:
origin git@github.com:your-github-username/chaos-mesh.git (fetch) origin git@github.com:your-github-username/chaos-mesh.git (push) upstream https://github.com/chaos-mesh/chaos-mesh (fetch) upstream no_push (push)
-
Get your local master up-to-date and create your working branch:
git fetch upstream git checkout master git rebase upstream/master git checkout -b new-feature
-
Make the change on the code.
You can now edit the code on the
new-featurebranch.If you want to update the
crd.yamlaccording to the CRD structs, run the following commands:make generate make manifests/crd.yaml
-
Check the code change by running the following command:
make check
This will show errors if your changes do not pass the check (e.g. fmt, lint). Please fix them before submitting the PR.
Before running your code in a real Kubernetes cluster, make sure it passes all unit tests:
make testReferring to the Configure the Development Environment.
Now you can test your changes on the deployed cluster.
Congratulations! Now you have finished all tests and are ready to commit your code.
-
Run the following commands to keep your branch in sync:
git fetch upstream git rebase upstream/master
-
Commit your changes:
git add -A git commit --signoff
-
Push your changes to the remote branch:
git push origin new-feature
Please follow the pull request template when creating a pull request.
Once your pull request has been opened, it will be assigned to at least two reviewers. The reviewers will do a thorough code review of correctness, bugs, opportunities for improvement, documentation and comments, and style.
Commit changes made in response to review comments to the same branch on your fork.