Commit | Line | Data |
600f7f85 |
1 | =pod |
2 | |
3 | =head1 NAME |
4 | |
5 | Moose::Manual::Contributing - How to get involved in Moose |
6 | |
7 | =head1 GETTING INVOLVED |
8 | |
04437dba |
9 | Moose is an open project, and we are always willing to accept bug fixes, |
10 | more tests, and documentation patches. Commit bits are given out freely, and |
11 | the L</STANDARD WORKFLOW> is very simple. The general gist is: clone the Git |
12 | repository, create a new topic branch, hack away, then find a committer to |
13 | review your changes. |
600f7f85 |
14 | |
6c1fa4ad |
15 | Note that this document applies to both Moose and L<Class::MOP> development. |
16 | |
600f7f85 |
17 | =head1 NEW FEATURES |
18 | |
04437dba |
19 | Moose already has a fairly large feature set, and we are currently |
d85337ff |
20 | B<not> looking to add any major new features to it. If you have an |
482cc243 |
21 | idea for a new feature in Moose, you are encouraged to create a |
d85337ff |
22 | MooseX module first. |
23 | |
24 | At this stage, no new features will even be considered for addition |
25 | into the core without first being vetted as a MooseX module, unless |
26 | it is absolutely 100% impossible to implement the feature outside the |
27 | core. |
600f7f85 |
28 | |
04437dba |
29 | If you think it is 100% impossible, please come discuss it with us on IRC or |
482cc243 |
30 | via e-mail. Your feature may need a small hook in the core, or a |
04437dba |
31 | refactoring of some core modules, and we are definitely open to that. |
d85337ff |
32 | |
482cc243 |
33 | Moose was built from the ground up with the idea of being highly extensible, |
34 | and quite often the feature requests we see can be implemented through small |
35 | extensions. Try it, it's much easier than you might think. |
600f7f85 |
36 | |
04437dba |
37 | =head1 PEOPLE |
38 | |
39 | As Moose has matured, some structure has emerged in the process. |
40 | |
41 | =over |
42 | |
43 | =item Contributors - people creating a topic or branch |
44 | |
45 | You. |
46 | |
37a2fef8 |
47 | If you have commit access, you can create a topic on the main Moose.git |
48 | repository. If you don't have a commit bit, give us your SSH key or create your |
49 | own clone of the L<git://git.moose.perl.org/Moose.git> repository. |
04437dba |
50 | |
76127c77 |
51 | The relevant repository URIs are: |
52 | |
53 | =over |
54 | |
55 | =item Read-Only |
56 | |
57 | L<git://git.moose.perl.org/Moose.git> |
58 | |
59 | =item Read+Write |
60 | |
61 | L<gitmo@git.moose.perl.org:Moose.git> |
62 | |
63 | =back |
64 | |
04437dba |
65 | =item Cabal - people who can release moose |
66 | |
67 | These people are the ones who have co-maint on Moose itself and can create a |
68 | release. They're listed under L<Moose/CABAL> in the Moose documentation. They |
4c0880b2 |
69 | are responsible for reviewing branches, and are the only people who are allowed |
70 | to push to stable branches. |
04437dba |
71 | |
72 | =back |
73 | |
74 | =head1 BRANCH LAYOUT |
75 | |
5af926eb |
76 | The repository is divided into several branches to make maintenance easier for |
04437dba |
77 | everyone involved. The branches below are ordered by level of stability. |
78 | |
79 | =over |
80 | |
4c0880b2 |
81 | =item stable/* |
82 | |
83 | The branch from which releases are cut. When making a new major release, the |
84 | release manager makes a new C<stable/$version> branch at the current position |
85 | of C<master>. For minor releases, patches will be committed to C<master>, and |
86 | backported (cherry-picked) to the appropriate stable branch as needed. The |
87 | C<stable> branch is only updated by someone from the Cabal during a release. |
04437dba |
88 | |
4c0880b2 |
89 | =item master |
04437dba |
90 | |
4c0880b2 |
91 | The main development branch. All new code should be written against this |
92 | branch. This branch contains code that has been reviewed, and will be included |
93 | in the next major release. Commits which are judged to not break backwards |
94 | compatibility may be backported into C<stable> to be included in the next minor |
95 | release. |
04437dba |
96 | |
4c0880b2 |
97 | =item rfc/* |
04437dba |
98 | |
4c0880b2 |
99 | Topic branches that are completed and waiting on review. A Cabal member will |
100 | look over branches in this namespace, and either merge them to C<master> if |
101 | they are acceptable, or move them back to a different namespace otherwise. |
04437dba |
102 | |
4c0880b2 |
103 | =item topic/* |
04437dba |
104 | |
4c0880b2 |
105 | Small personal branches that are still in progress. They can be freely rebased. |
106 | They contain targeted features that may span a handful of commits. Any change |
107 | or bugfix should be created in a topic branch. |
04437dba |
108 | |
4c0880b2 |
109 | =item attic/* |
04437dba |
110 | |
4c0880b2 |
111 | Branches which have been reviewed, and rejected. They remain in the repository |
112 | in case we later change our mind, or in case parts of them are still useful. |
113 | |
114 | =item abandoned/* |
115 | |
116 | Topic branches which have had no activity for a long period of time will be |
117 | moved here, to keep the main areas clean. |
04437dba |
118 | |
119 | =back |
120 | |
4c0880b2 |
121 | Larger, more long term branches can also be created in the root namespace (i.e. |
122 | at the same level as master and stable). This is more appropriate if multiple |
123 | people are intending to work on the branch. These branches should not be |
124 | rebased. |
125 | |
04437dba |
126 | =head1 STANDARD WORKFLOW |
127 | |
128 | # update your copy of master |
129 | git checkout master |
130 | git pull --rebase |
131 | |
132 | # create a new topic branch |
4c0880b2 |
133 | git checkout -b topic/my-feature |
04437dba |
134 | |
135 | # hack, commit, feel free to break fast forward |
4c0880b2 |
136 | git commit --amend # allowed |
137 | git rebase --interactive # allowed |
138 | git push --force # allowed |
04437dba |
139 | |
4c0880b2 |
140 | # keep the branch rebased on top of master, for easy reviewing |
04437dba |
141 | git remote update |
4c0880b2 |
142 | git rebase origin/master |
143 | git push --force |
04437dba |
144 | |
4c0880b2 |
145 | # when finished, move the branch to the rfc/ namespace |
146 | git branch -m rfc/my-feature |
147 | git push |
148 | git push origin :topic/my-feature |
04437dba |
149 | |
4c0880b2 |
150 | When your branch is completed, make sure it has been moved to the C<rfc/> |
151 | namespace and is rebased on top of master, and ask for review/approval (see |
152 | L</APPROVAL WORKFLOW>). If it is approved, the reviewer will merge it into |
153 | C<master>. |
04437dba |
154 | |
4c0880b2 |
155 | No actual merging (as in a human resolving conflicts) should be done when |
156 | merging into C<master>, only from C<master> into other branches. |
04437dba |
157 | |
fbfcdc75 |
158 | =head1 APPROVAL WORKFLOW |
159 | |
0b81ea16 |
160 | Moose is an open project but it is also an increasingly important one. Many |
161 | modules depend on Moose being stable. Therefore, we have a basic set of |
162 | criteria for reviewing and merging branches. What follows is a set of rough |
163 | guidelines that ensures all new code is properly vetted before it is merged to |
164 | the master branch. |
fbfcdc75 |
165 | |
166 | It should be noted that if you want your specific branch to be approved, it is |
4c0880b2 |
167 | B<your> responsibility to follow this process and advocate for your branch. The |
168 | preferred way is to send a request to the mailing list for review/approval; |
fbfcdc75 |
169 | this allows us to better keep track of the branches awaiting approval and those |
170 | which have been approved. |
171 | |
172 | =over 4 |
173 | |
174 | =item Small bug fixes, doc patches and additional passing tests. |
175 | |
0b81ea16 |
176 | These items don't really require approval beyond one of the core contributors |
4c0880b2 |
177 | just doing a simple review. For especially simple patches (doc patches |
178 | especially), committing directly to master is fine. |
fbfcdc75 |
179 | |
180 | =item Larger bug fixes, doc additions and TODO or failing tests. |
181 | |
182 | Larger bug fixes should be reviewed by at least one cabal member and should be |
aefb302c |
183 | tested using the F<xt/author/test-my-dependents.t> test. |
fbfcdc75 |
184 | |
185 | New documentation is always welcome, but should also be reviewed by a cabal |
186 | member for accuracy. |
187 | |
0b81ea16 |
188 | TODO tests are basically feature requests, see our L</NEW FEATURES> section |
189 | for more information on that. If your feature needs core support, create a |
4c0880b2 |
190 | C<topic/> branch using the L</STANDARD WORKFLOW> and start hacking away. |
fbfcdc75 |
191 | |
0b81ea16 |
192 | Failing tests are basically bug reports. You should find a core contributor |
193 | and/or cabal member to see if it is a real bug, then submit the bug and your |
194 | test to the RT queue. Source control is not a bug reporting tool. |
fbfcdc75 |
195 | |
196 | =item New user-facing features. |
197 | |
0b81ea16 |
198 | Anything that creates a new user-visible feature needs to be approved by |
eefea5b0 |
199 | B<more than one> cabal member. |
fbfcdc75 |
200 | |
0b81ea16 |
201 | Make sure you have reviewed L</NEW FEATURES> to be sure that you are following |
202 | the guidelines. Do not be surprised if a new feature is rejected for the core. |
fbfcdc75 |
203 | |
204 | =item New internals features. |
205 | |
eefea5b0 |
206 | New features for Moose internals are less restrictive than user facing |
0b81ea16 |
207 | features, but still require approval by B<at least one> cabal member. |
fbfcdc75 |
208 | |
aefb302c |
209 | Ideally you will have run the F<test-my-dependents.t> script to be sure you |
210 | are not breaking any MooseX module or causing any other unforeseen havoc. If |
211 | you do this (rather than make us do it), it will only help to hasten your |
212 | branch's approval. |
fbfcdc75 |
213 | |
214 | =item Backwards incompatible changes. |
215 | |
0b81ea16 |
216 | Anything that breaks backwards compatibility must be discussed by the cabal |
217 | and agreed to by a majority of the members. |
fbfcdc75 |
218 | |
0b81ea16 |
219 | We have a policy for what we see as sane L</BACKWARDS COMPATIBILITY> for |
220 | Moose. If your changes break back-compat, you must be ready to discuss and |
221 | defend your change. |
fbfcdc75 |
222 | |
223 | =back |
224 | |
04437dba |
225 | =head1 RELEASE WORKFLOW |
226 | |
4c0880b2 |
227 | # major releases (including trial releases) |
04437dba |
228 | git checkout master |
4c0880b2 |
229 | |
230 | # minor releases |
231 | git checkout stable |
232 | |
04437dba |
233 | # edit for final version bumping, changelogging, etc |
234 | # prepare release (test suite etc) |
ba64b156 |
235 | perl-reversion -bump |
236 | make manifest |
04437dba |
237 | git commit |
4c0880b2 |
238 | git branch stable/2.XXYY # only for non-trial major releases |
3ba78ad9 |
239 | shipit # does not ship the tarball, but does everything else |
04437dba |
240 | |
4c0880b2 |
241 | # non-trial releases |
242 | cpan-upload ~/shipit-dist/Moose-2.XXYY.tar.gz |
243 | |
244 | # trial releases |
245 | cd ~/shipit-dist |
246 | mv Moose-2.XXYY.tar.gz Moose-2.XXYY-TRIAL.tar.gz |
247 | cpan-upload Moose-2.XXYY-TRIAL.tar.gz |
04437dba |
248 | |
6c1fa4ad |
249 | =head2 Release How-To |
250 | |
251 | Moose (and L<Class::MOP>) releases fall into two categories, each with their |
252 | own level of release preparation. A minor release is one which does not |
253 | include any API changes, deprecations, and so on. In that case, it is |
254 | sufficient to simply test the release candidate against a few different |
255 | different Perls. Testing should be done against at least two recent major |
256 | version of Perl (5.8.8 and 5.10.1, for example). If you have more versions |
257 | available, you are encouraged to test them all. However, we do not put a lot |
258 | of effort into supporting older 5.8.x releases. |
259 | |
260 | For major releases which include an API change or deprecation, you should run |
aefb302c |
261 | the F<xt/author/test-my-dependents.t> test. This tests a long list of MooseX |
262 | and other Moose-using modules from CPAN. In order to run this script, you must |
263 | arrange to have the new version of Moose and/or Class::MOP in Perl's include |
264 | path. You can use C<prove -b> and C<prove -I>, install the module, or fiddle |
265 | with the C<PERL5LIB> environment variable, whatever makes you happy. |
266 | |
267 | This test downloads each module from CPAN, runs its tests, and logs failures |
268 | and warnings to a set of files named F<test-mydeps-$$-*.log>. If there are |
6c1fa4ad |
269 | failures or warnings, please work with the authors of the modules in question |
270 | to fix them. If the module author simply isn't available or does not want to |
271 | fix the bug, it is okay to make a release. |
272 | |
273 | Regardless of whether or not a new module is available, any breakages should |
274 | be noted in the conflicts list in the distribution's F<Makefile.PL>. |
275 | |
276 | Both Class::MOP and Moose have a F<.shipit> file you can use to make sure the |
277 | release goes smoothly. You are strongly encouraged to use this instead of |
278 | doing the final release steps by hand. |
279 | |
04437dba |
280 | =head1 EMERGENCY BUG WORKFLOW (for immediate release) |
281 | |
4c0880b2 |
282 | The stable branch exists for easily making bug fix releases. |
04437dba |
283 | |
284 | git remote update |
4c0880b2 |
285 | git checkout -b topic/my-emergency-fix origin/master |
04437dba |
286 | # hack |
287 | git commit |
288 | |
4c0880b2 |
289 | Then a cabal member merges into C<master>, and backports the change into |
290 | C<stable>: |
04437dba |
291 | |
4c0880b2 |
292 | git checkout master |
04437dba |
293 | git merge topic/my-emergency-fix |
294 | git push |
4c0880b2 |
295 | git checkout stable |
296 | git cherry-pick -x master |
297 | git push |
04437dba |
298 | # release |
04437dba |
299 | |
300 | =head1 PROJECT WORKFLOW |
301 | |
302 | For longer lasting branches, we use a subversion style branch layout, where |
303 | master is routinely merged into the branch. Rebasing is allowed as long as all |
5af926eb |
304 | the branch contributors are using C<git pull --rebase> properly. |
04437dba |
305 | |
306 | C<commit --amend>, C<rebase --interactive>, etc. are not allowed, and should |
307 | only be done in topic branches. Committing to master is still done with the |
308 | same review process as a topic branch, and the branch must merge as a fast |
309 | forward. |
310 | |
9840bb38 |
311 | This is pretty much the way we're doing branches for large-ish things right |
04437dba |
312 | now. |
313 | |
314 | Obviously there is no technical limitation on the number of branches. You can |
315 | freely create topic branches off of project branches, or sub projects inside |
316 | larger projects freely. Such branches should incorporate the name of the branch |
317 | they were made off so that people don't accidentally assume they should be |
318 | merged into master: |
319 | |
320 | git checkout -b my-project--topic/foo my-project |
321 | |
322 | (unfortunately Git will not allow C<my-project/foo> as a branch name if |
323 | C<my-project> is a valid ref). |
324 | |
04437dba |
325 | =head1 BRANCH ARCHIVAL |
326 | |
327 | Merged branches should be deleted. |
328 | |
4c0880b2 |
329 | Failed branches may be kept, but should be to C<attic/> to differentiate them |
330 | from in-progress topic branches. |
04437dba |
331 | |
702e6744 |
332 | Branches that have not been worked on for a long time will be moved to |
4c0880b2 |
333 | C<abandoned/> periodically, but feel free to move the branch back to C<topic/> |
334 | if you want to start working on it again. |
04437dba |
335 | |
600f7f85 |
336 | =head1 TESTS, TESTS, TESTS |
337 | |
d85337ff |
338 | If you write I<any> code for Moose or Class::MOP, you B<must> add |
339 | tests for that code. If you do not write tests then we cannot |
04437dba |
340 | guarantee your change will not be removed or altered at a later date, |
341 | as there is nothing to confirm this is desired behavior. |
d85337ff |
342 | |
343 | If your code change/addition is deep within the bowels of |
344 | Moose/Class::MOP and your test exercises this feature in a non-obvious |
345 | way, please add some comments either near the code in question or in |
346 | the test so that others know. |
600f7f85 |
347 | |
4c0880b2 |
348 | We also greatly appreciate documentation to go with your changes, and an entry |
349 | in the Changes file. Make sure to give yourself credit! Major changes or new |
350 | user-facing features should also be documented in L<Moose::Manual::Delta>. |
600f7f85 |
351 | |
d85337ff |
352 | =head1 BACKWARDS COMPATIBILITY |
600f7f85 |
353 | |
04437dba |
354 | Change is inevitable, and Moose is not immune to this. We do our best |
86b96832 |
355 | to maintain backwards compatibility, but we do not want the code base |
d85337ff |
356 | to become overburdened by this. This is not to say that we will be |
357 | frivolous with our changes, quite the opposite, just that we are not |
358 | afraid of change and will do our best to keep it as painless as |
359 | possible for the end user. |
600f7f85 |
360 | |
4c0880b2 |
361 | Our policy for handling backwards compatibility is documented in more detail in |
362 | L<Moose::Manual::Support>. |
600f7f85 |
363 | |
d85337ff |
364 | All backwards incompatible changes B<must> be documented in |
04437dba |
365 | L<Moose::Manual::Delta>. Make sure to document any useful tips or workarounds |
366 | for the change in that document. |
600f7f85 |
367 | |
368 | =head1 AUTHOR |
369 | |
370 | Stevan Little E<lt>stevan@iinteractive.comE<gt> |
371 | |
04437dba |
372 | Chris (perigrin) Prather |
373 | |
374 | Yuval (nothingmuch) Kogman |
375 | |
4c0880b2 |
376 | Jesse Luehrs E<lt>doy at tozt dot netE<gt> |
377 | |
600f7f85 |
378 | =head1 COPYRIGHT AND LICENSE |
379 | |
380 | Copyright 2009 by Infinity Interactive, Inc. |
381 | |
382 | L<http://www.iinteractive.com> |
383 | |
384 | This library is free software; you can redistribute it and/or modify |
385 | it under the same terms as Perl itself. |
386 | |
d85337ff |
387 | =cut |