github.com/baraj55/containernetworking-cni@v0.7.2-0.20200219164625-56ace59a9e7f/CONTRIBUTING.md (about) 1 # How to Contribute 2 3 CNI is [Apache 2.0 licensed](LICENSE) and accepts contributions via GitHub 4 pull requests. This document outlines some of the conventions on development 5 workflow, commit message formatting, contact points and other resources to make 6 it easier to get your contribution accepted. 7 8 We gratefully welcome improvements to documentation as well as to code. 9 10 # Certificate of Origin 11 12 By contributing to this project you agree to the Developer Certificate of 13 Origin (DCO). This document was created by the Linux Kernel community and is a 14 simple statement that you, as a contributor, have the legal right to make the 15 contribution. See the [DCO](DCO) file for details. 16 17 # Email and Chat 18 19 The project uses the cni-dev email list and IRC chat: 20 - Email: [cni-dev](https://groups.google.com/forum/#!forum/cni-dev) 21 - IRC: #[containernetworking](irc://irc.freenode.net:6667/#containernetworking) channel on [freenode.net](https://freenode.net/) 22 23 Please avoid emailing maintainers found in the MAINTAINERS file directly. They 24 are very busy and read the mailing lists. 25 26 ## Getting Started 27 28 - Fork the repository on GitHub 29 - Read the [README](README.md) for build and test instructions 30 - Play with the project, submit bugs, submit pull requests! 31 32 ## Contribution workflow 33 34 This is a rough outline of how to prepare a contribution: 35 36 - Create a topic branch from where you want to base your work (usually branched from master). 37 - Make commits of logical units. 38 - Make sure your commit messages are in the proper format (see below). 39 - Push your changes to a topic branch in your fork of the repository. 40 - If you changed code: 41 - add automated tests to cover your changes, using the [Ginkgo](https://onsi.github.io/ginkgo/) & [Gomega](https://onsi.github.io/gomega/) style 42 - if the package did not previously have any test coverage, add it to the list 43 of `TESTABLE` packages in the `test.sh` script. 44 - run the full test script and ensure it passes 45 - Make sure any new code files have a license header (this is now enforced by automated tests) 46 - Submit a pull request to the original repository. 47 48 ## How to run the test suite 49 We generally require test coverage of any new features or bug fixes. 50 51 Here's how you can run the test suite on any system (even Mac or Windows) using 52 [Vagrant](https://www.vagrantup.com/) and a hypervisor of your choice: 53 54 ```bash 55 vagrant up 56 vagrant ssh 57 # you're now in a shell in a virtual machine 58 sudo su 59 cd /go/src/github.com/containernetworking/cni 60 61 # to run the full test suite 62 ./test.sh 63 64 # to focus on a particular test suite 65 cd libcni 66 go test 67 ``` 68 69 # Acceptance policy 70 71 These things will make a PR more likely to be accepted: 72 73 * a well-described requirement 74 * tests for new code 75 * tests for old code! 76 * new code and tests follow the conventions in old code and tests 77 * a good commit message (see below) 78 79 In general, we will merge a PR once two maintainers have endorsed it. 80 Trivial changes (e.g., corrections to spelling) may get waved through. 81 For substantial changes, more people may become involved, and you might get asked to resubmit the PR or divide the changes into more than one PR. 82 83 ### Format of the Commit Message 84 85 We follow a rough convention for commit messages that is designed to answer two 86 questions: what changed and why. The subject line should feature the what and 87 the body of the commit should describe the why. 88 89 ``` 90 scripts: add the test-cluster command 91 92 this uses tmux to setup a test cluster that you can easily kill and 93 start for debugging. 94 95 Fixes #38 96 ``` 97 98 The format can be described more formally as follows: 99 100 ``` 101 <subsystem>: <what changed> 102 <BLANK LINE> 103 <why this change was made> 104 <BLANK LINE> 105 <footer> 106 ``` 107 108 The first line is the subject and should be no longer than 70 characters, the 109 second line is always blank, and other lines should be wrapped at 80 characters. 110 This allows the message to be easier to read on GitHub as well as in various 111 git tools. 112 113 ## 3rd party plugins 114 So you've built a CNI plugin. Where should it live? 115 116 Short answer: We'd be happy to link to it from our [list of 3rd party plugins](README.md#3rd-party-plugins). 117 But we'd rather you kept the code in your own repo. 118 119 Long answer: An advantage of the CNI model is that independent plugins can be 120 built, distributed and used without any code changes to this repository. While 121 some widely used plugins (and a few less-popular legacy ones) live in this repo, 122 we're reluctant to add more. 123 124 If you have a good reason why the CNI maintainers should take custody of your 125 plugin, please open an issue or PR.