|
1 |
| -# Contributing to Opscode Cookbooks |
2 |
| - |
3 |
| -We are glad you want to contribute to Opscode Cookbooks! The first |
4 |
| -step is the desire to improve the project. |
5 |
| - |
6 |
| -You can find the answers to additional frequently asked questions |
7 |
| -[on the wiki](http://wiki.opscode.com/display/chef/How+to+Contribute). |
8 |
| - |
9 |
| -You can find additional information about |
10 |
| -[contributing to cookbooks](http://wiki.opscode.com/display/chef/How+to+Contribute+to+Opscode+Cookbooks) |
11 |
| -on the wiki as well. |
12 |
| - |
13 |
| -## Quick-contribute |
14 |
| - |
15 |
| -* Create an account on our [bug tracker](http://tickets.opscode.com) |
16 |
| -* Sign our contributor agreement (CLA) |
17 |
| -[ online](https://secure.echosign.com/public/hostedForm?formid=PJIF5694K6L) |
18 |
| -(keep reading if you're contributing on behalf of your employer) |
19 |
| -* Create a ticket for your change on the |
20 |
| - [bug tracker](http://tickets.opscode.com) |
21 |
| -* Link to your patch as a rebased git branch or pull request from the |
22 |
| - ticket |
23 |
| -* Resolve the ticket as fixed |
24 |
| - |
25 |
| -We regularly review contributions and will get back to you if we have |
26 |
| -any suggestions or concerns. |
27 |
| - |
28 |
| -## The Apache License and the CLA/CCLA |
29 |
| - |
30 |
| -Licensing is very important to open source projects, it helps ensure |
31 |
| -the software continues to be available under the terms that the author |
32 |
| -desired. Chef uses the Apache 2.0 license to strike a balance between |
33 |
| -open contribution and allowing you to use the software however you |
34 |
| -would like to. |
35 |
| - |
36 |
| -The license tells you what rights you have that are provided by the |
37 |
| -copyright holder. It is important that the contributor fully |
38 |
| -understands what rights they are licensing and agrees to them. |
39 |
| -Sometimes the copyright holder isn't the contributor, most often when |
40 |
| -the contributor is doing work for a company. |
41 |
| - |
42 |
| -To make a good faith effort to ensure these criteria are met, Opscode |
43 |
| -requires a Contributor License Agreement (CLA) or a Corporate |
44 |
| -Contributor License Agreement (CCLA) for all contributions. This is |
45 |
| -without exception due to some matters not being related to copyright |
46 |
| -and to avoid having to continually check with our lawyers about small |
47 |
| -patches. |
48 |
| - |
49 |
| -It only takes a few minutes to complete a CLA, and you retain the |
50 |
| -copyright to your contribution. |
51 |
| - |
52 |
| -You can complete our contributor agreement (CLA) |
53 |
| -[ online](https://secure.echosign.com/public/hostedForm?formid=PJIF5694K6L). |
54 |
| -If you're contributing on behalf of your employer, have your employer |
55 |
| -fill out our |
56 |
| -[Corporate CLA](https://secure.echosign.com/public/hostedForm?formid=PIE6C7AX856) |
57 |
| -instead. |
58 |
| - |
59 |
| -## Ticket Tracker (JIRA) |
60 |
| - |
61 |
| -The [ticket tracker](http://tickets.opscode.com) is the most important |
62 |
| -documentation for the code base. It provides significant historical |
63 |
| -information, such as: |
64 |
| - |
65 |
| -* Which release a bug fix is included in |
66 |
| -* Discussion regarding the design and merits of features |
67 |
| -* Error output to aid in finding similar bugs |
68 |
| - |
69 |
| -Each ticket should aim to fix one bug or add one feature. |
70 |
| - |
71 |
| -## Using git |
72 |
| - |
73 |
| -You can get a quick copy of the repository for this cookbook by |
74 |
| -running `git clone |
75 |
| -git://github.com/opscode-coobkooks/COOKBOOKNAME.git`. |
76 |
| - |
77 |
| -For collaboration purposes, it is best if you create a Github account |
78 |
| -and fork the repository to your own account. Once you do this you will |
79 |
| -be able to push your changes to your Github repository for others to |
80 |
| -see and use. |
81 |
| - |
82 |
| -If you have another repository in your GitHub account named the same |
83 |
| -as the cookbook, we suggest you suffix the repository with -cookbook. |
84 |
| - |
85 |
| -### Branches and Commits |
86 |
| - |
87 |
| -You should submit your patch as a git branch named after the ticket, |
88 |
| -such as COOK-1337. This is called a _topic branch_ and allows users to |
89 |
| -associate a branch of code with the ticket. |
90 |
| - |
91 |
| -It is a best practice to have your commit message have a _summary |
92 |
| -line_ that includes the ticket number, followed by an empty line and |
93 |
| -then a brief description of the commit. This also helps other |
94 |
| -contributors understand the purpose of changes to the code. |
95 |
| - |
96 |
| - [COOK-1757] - platform_family and style |
97 |
| - |
98 |
| - * use platform_family for platform checking |
99 |
| - * update notifies syntax to "resource_type[resource_name]" instead of |
100 |
| - resources() lookup |
101 |
| - * COOK-692 - delete config files dropped off by packages in conf.d |
102 |
| - * dropped debian 4 support because all other platforms have the same |
103 |
| - values, and it is older than "old stable" debian release |
104 |
| - |
105 |
| -Remember that not all users use Chef in the same way or on the same |
106 |
| -operating systems as you, so it is helpful to be clear about your use |
107 |
| -case and change so they can understand it even when it doesn't apply |
108 |
| -to them. |
109 |
| - |
110 |
| -### Github and Pull Requests |
111 |
| - |
112 |
| -All of Opscode's open source cookbook projects are available on |
113 |
| -[Github](http://www.github.com/opscode-cookbooks). |
114 |
| - |
115 |
| -We don't require you to use Github, and we will even take patch diffs |
116 |
| -attached to tickets on the tracker. However Github has a lot of |
117 |
| -convenient features, such as being able to see a diff of changes |
118 |
| -between a pull request and the main repository quickly without |
119 |
| -downloading the branch. |
120 |
| - |
121 |
| -If you do choose to use a pull request, please provide a link to the |
122 |
| -pull request from the ticket __and__ a link to the ticket from the |
123 |
| -pull request. Because pull requests only have two states, open and |
124 |
| -closed, we can't easily filter pull requests that are waiting for a |
125 |
| -reply from the author for various reasons. |
126 |
| - |
127 |
| -### More information |
128 |
| - |
129 |
| -Additional help with git is available on the |
130 |
| -[Working with Git](http://wiki.opscode.com/display/chef/Working+with+Git) |
131 |
| -wiki page. |
132 |
| - |
133 |
| -## Functional and Unit Tests |
134 |
| - |
135 |
| -This cookbook is set up to run tests under |
136 |
| -[Opscode's test-kitchen](https://github.com/opscode/test-kitchen). It |
137 |
| -uses minitest-chef to run integration tests after the node has been |
138 |
| -converged to verify that the state of the node. |
139 |
| - |
140 |
| -Test kitchen should run completely without exception using the default |
141 |
| -[baseboxes provided by Opscode](https://github.com/opscode/bento). |
142 |
| -Because Test Kitchen creates VirtualBox machines and runs through |
143 |
| -every configuration in the Kitchenfile, it may take some time for |
144 |
| -these tests to complete. |
145 |
| - |
146 |
| -If your changes are only for a specific recipe, run only its |
147 |
| -configuration with Test Kitchen. If you are adding a new recipe, or |
148 |
| -other functionality such as a LWRP or definition, please add |
149 |
| -appropriate tests and ensure they run with Test Kitchen. |
150 |
| - |
151 |
| -If any don't pass, investigate them before submitting your patch. |
152 |
| - |
153 |
| -Any new feature should have unit tests included with the patch with |
154 |
| -good code coverage to help protect it from future changes. Similarly, |
155 |
| -patches that fix a bug or regression should have a _regression test_. |
156 |
| -Simply put, this is a test that would fail without your patch but |
157 |
| -passes with it. The goal is to ensure this bug doesn't regress in the |
158 |
| -future. Consider a regular expression that doesn't match a certain |
159 |
| -pattern that it should, so you provide a patch and a test to ensure |
160 |
| -that the part of the code that uses this regular expression works as |
161 |
| -expected. Later another contributor may modify this regular expression |
162 |
| -in a way that breaks your use cases. The test you wrote will fail, |
163 |
| -signalling to them to research your ticket and use case and accounting |
164 |
| -for it. |
165 |
| - |
166 |
| -If you need help writing tests, please ask on the Chef Developer's |
167 |
| -mailing list, or the #chef-hacking IRC channel. |
168 |
| - |
169 |
| -## Code Review |
170 |
| - |
171 |
| -Opscode regularly reviews code contributions and provides suggestions |
172 |
| -for improvement in the code itself or the implementation. |
173 |
| - |
174 |
| -We find contributions by searching the ticket tracker for _resolved_ |
175 |
| -tickets with a status of _fixed_. If we have feedback we will reopen |
176 |
| -the ticket and you should resolve it again when you've made the |
177 |
| -changes or have a response to our feedback. When we believe the patch |
178 |
| -is ready to be merged, we will tag the _Code Reviewed_ field with |
179 |
| -_Reviewed_. |
180 |
| - |
181 |
| -Depending on the project, these tickets are then merged within a week |
182 |
| -or two, depending on the current release cycle. |
183 |
| - |
184 |
| -## Release Cycle |
185 |
| - |
186 |
| -The versioning for Opscode Cookbook projects is X.Y.Z. |
187 |
| - |
188 |
| -* X is a major release, which may not be fully compatible with prior |
189 |
| - major releases |
190 |
| -* Y is a minor release, which adds both new features and bug fixes |
191 |
| -* Z is a patch release, which adds just bug fixes |
192 |
| - |
193 |
| -A released version of a cookbook will end in an even number, e.g. |
194 |
| -"1.2.4" or "0.8.0". When development for the next version of the |
195 |
| -cookbook begins, the "Z" patch number is incremented to the next odd |
196 |
| -number, however the next release of the cookbook may be a major or |
197 |
| -minor incrementing version. |
198 |
| - |
199 |
| -Releases of Opscode's cookbooks are usually announced on the Chef user |
200 |
| -mailing list. Releases of several cookbooks may be batched together |
201 |
| -and announced on the [Opscode Blog](http://www.opscode.com/blog). |
202 |
| - |
203 |
| -## Working with the community |
204 |
| - |
205 |
| -These resources will help you learn more about Chef and connect to |
206 |
| -other members of the Chef community: |
207 |
| - |
208 |
| -* [chef](http://lists.opscode.com/sympa/info/chef) and |
209 |
| - [chef-dev](http://lists.opscode.com/sympa/info/chef-dev) mailing |
210 |
| - lists |
211 |
| -* #chef and #chef-hacking IRC channels on irc.freenode.net |
212 |
| -* [Community Cookbook site](http://community.opscode.com) |
213 |
| -* [Chef wiki](http://wiki.opscode.com/display/chef) |
214 |
| -* Opscode Chef [product page](http://www.opscode.com/chef) |
215 |
| - |
216 |
| - |
217 |
| -## Cookbook Contribution Do's and Don't's |
218 |
| - |
219 |
| -Please do include tests for your contribution. If you need help, ask |
220 |
| -on the |
221 |
| -[chef-dev mailing list](http://lists.opscode.com/sympa/info/chef-dev) |
222 |
| -or the |
223 |
| -[#chef-hacking IRC channel](http://community.opscode.com/chat/chef-hacking). |
224 |
| -Not all platforms that a cookbook supports may be supported by Test |
225 |
| -Kitchen. Please provide evidence of testing your contribution if it |
226 |
| -isn't trivial so we don't have to duplicate effort in testing. Chef |
227 |
| -10.14+ "doc" formatted output is sufficient. |
228 |
| - |
229 |
| -Please do indicate new platform (families) or platform versions in the |
230 |
| -commit message, and update the relevant ticket. |
231 |
| - |
232 |
| -If a contribution adds new platforms or platform versions, indicate |
233 |
| -such in the body of the commit message(s), and update the relevant |
234 |
| -COOK ticket. When writing commit messages, it is helpful for others if |
235 |
| -you indicate the COOK ticket. For example: |
236 |
| - |
237 |
| - git commit -m '[COOK-1041] - Updated pool resource to correctly |
238 |
| - delete.' |
239 |
| - |
240 |
| -Please do use [foodcritic](http://acrmp.github.com/foodcritic) to |
241 |
| -lint-check the cookbook. Except FC007, it should pass all correctness |
242 |
| -rules. FC007 is okay as long as the dependent cookbooks are *required* |
243 |
| -for the default behavior of the cookbook, such as to support an |
244 |
| -uncommon platform, secondary recipe, etc. |
245 |
| - |
246 |
| -Please do ensure that your changes do not break or modify behavior for |
247 |
| -other platforms supported by the cookbook. For example if your changes |
248 |
| -are for Debian, make sure that they do not break on CentOS. |
249 |
| - |
250 |
| -Please do not modify the version number in the metadata.rb, Opscode |
251 |
| -will select the appropriate version based on the release cycle |
252 |
| -information above. |
253 |
| - |
254 |
| -Please do not update the CHANGELOG.md for a new version. Not all |
255 |
| -changes to a cookbook may be merged and released in the same versions. |
256 |
| -Opscode will update the CHANGELOG.md when releasing a new version of |
257 |
| -the cookbook. |
| 1 | +1. Fork the repository using Github. |
| 2 | +1. Checkout a named feature branch created from the `develop` branch. |
| 3 | +1. Write tests using chefspec or serverspec as appropriate. |
| 4 | +1. Complete modifications or corrections. |
| 5 | +1. Run the tests, ensuring they all pass. |
| 6 | +1. Submit a Pull Request to the `develop` branch using Github. |
0 commit comments