add myself to CABAL
[gitmo/Moose.git] / lib / Moose / Manual / Contributing.pod
CommitLineData
600f7f85 1=pod
2
3=head1 NAME
4
5Moose::Manual::Contributing - How to get involved in Moose
6
7=head1 GETTING INVOLVED
8
04437dba 9Moose is an open project, and we are always willing to accept bug fixes,
10more tests, and documentation patches. Commit bits are given out freely, and
11the L</STANDARD WORKFLOW> is very simple. The general gist is: clone the Git
12repository, create a new topic branch, hack away, then find a committer to
13review your changes.
600f7f85 14
15=head1 NEW FEATURES
16
04437dba 17Moose already has a fairly large feature set, and we are currently
d85337ff 18B<not> looking to add any major new features to it. If you have an
19idea for a new feature in Moose, you are invited instead to create a
20MooseX module first.
21
22At this stage, no new features will even be considered for addition
23into the core without first being vetted as a MooseX module, unless
24it is absolutely 100% impossible to implement the feature outside the
25core.
600f7f85 26
04437dba 27If you think it is 100% impossible, please come discuss it with us on IRC or
28via e-mail. However, your feature may need a small hook in the core, or a
29refactoring of some core modules, and we are definitely open to that.
d85337ff 30
31Moose was built from the ground up with the idea of being highly
32extensible, and quite often the feature requests we see can be
33implemented through a couple of small and well placed extensions. Try
34it, it is much easier then you might think.
600f7f85 35
04437dba 36=head1 PEOPLE
37
38As Moose has matured, some structure has emerged in the process.
39
40=over
41
42=item Contributors - people creating a topic or branch
43
44You.
45
46If you have commit access, you can create a topic on the main Moose.git,
47otherwise either give us your SSH key or create your own clone of the
5af926eb 48L<git://git.moose.perl.org/Moose.git> repository or fork of the GitHub mirror.
04437dba 49
50=item Core Committers - people reviewing and merging a branch
51
52These people have worked with the Moose codebase for a while.
53
54They've been responsible for large features or branches and can help review
fbfcdc75 55your changes and apply them to the master branch using the basic
56L</APPROVAL WORKFLOW>.
04437dba 57
58They are also fairly well versed in Git, in order to merge the branches with
59no mistakes (especially when the merge fails), and to provide advice to
60contributors.
61
62=item Cabal - people who can release moose
63
64These people are the ones who have co-maint on Moose itself and can create a
65release. They're listed under L<Moose/CABAL> in the Moose documentation. They
66merge from Master to Stable.
67
68=back
69
70=head1 BRANCH LAYOUT
71
5af926eb 72The repository is divided into several branches to make maintenance easier for
04437dba 73everyone involved. The branches below are ordered by level of stability.
74
75=over
76
77=item Stable (refs/heads/stable)
78
79The branch from which releases are cut. When making a new release, the
80release manager merges from master to stable. The stable branch is only
81updated by someone from the Cabal during a release.
82
83=item Master (refs/heads/master)
84
85The branch for new development. This branch is merged into and branched from.
86
87=item Branches (refs/heads/*)
88
89Large community branches for big development "projects".
90
6106b7a2 91=item Topics (refs/heads/topic/*)
04437dba 92
93Small personal branches that have been published for review, but can get
9840bb38 94freely rebased. Targeted features that may span a handful of commits.
04437dba 95
96Any change or bugfix should be created in a topic branch.
97
98=back
99
100=head1 STANDARD WORKFLOW
101
102 # update your copy of master
103 git checkout master
104 git pull --rebase
105
106 # create a new topic branch
107 git checkout -b topic/my-feature
108
109 # hack, commit, feel free to break fast forward
110 git commit --amend # allowed
111 git rebase --interactive # allowed
112 git push --force origin topic/my_feature # allowed
113
fbfcdc75 114Then ask for a review/approval (see L</APPROVAL WORKFLOW>), and merge
115to master. If it merges cleanly and nobody has any objections, then it
116can be pushed to master.
04437dba 117
118If it doesn't merge as a fast forward, the author of the branch needs to run
119
120 git remote update
121 git rebase origin/master # or merge
122
123and bring the branch up to date, so that it can be merged as a fast forward
124into master.
125
126No actual merging (as in a human resolving conflicts) should be done when
127merging into master, only from master into other branches.
128
129=head2 Preparing a topic branch
130
131Before a merge, a topic branch can be cleaned up by the author.
132
133This can be done using interactive rebase to combine commits, etc, or even
134C<git merge --squash> to make the whole topic into a single commit.
135
136Structuring changes like this makes it easier to apply git revert at a later
137date, and encourages a clean and descriptive history that documents what the
138author was trying to do, without the various hangups that happened while they
139were trying to do it (commits like "oops forgot that file" are not only
140unnecessary noise, they also make running things like git bisect or git revert
141harder).
142
143However, by far the biggest benefit is that the number of commits that go into
144master is eventually reduced, and they are simple and coherent, making it much
145easier for people maintaining branches to stay up to date.
146
147All large changes should be documented in L<Moose::Manual::Delta>.
148
fbfcdc75 149=head1 APPROVAL WORKFLOW
150
0b81ea16 151Moose is an open project but it is also an increasingly important one. Many
152modules depend on Moose being stable. Therefore, we have a basic set of
153criteria for reviewing and merging branches. What follows is a set of rough
154guidelines that ensures all new code is properly vetted before it is merged to
155the master branch.
fbfcdc75 156
157It should be noted that if you want your specific branch to be approved, it is
158B<your> responsibility to follow this process and advocate for your branch.
159The preferred way is to send a request to the mailing list for review/approval,
160this allows us to better keep track of the branches awaiting approval and those
161which have been approved.
162
163=over 4
164
165=item Small bug fixes, doc patches and additional passing tests.
166
0b81ea16 167These items don't really require approval beyond one of the core contributors
168just doing a simple review.
fbfcdc75 169
170=item Larger bug fixes, doc additions and TODO or failing tests.
171
172Larger bug fixes should be reviewed by at least one cabal member and should be
0b81ea16 173tested using the F<cpan-stable-smolder> script in the moose-dev-utils
174repository.
fbfcdc75 175
176New documentation is always welcome, but should also be reviewed by a cabal
177member for accuracy.
178
0b81ea16 179TODO tests are basically feature requests, see our L</NEW FEATURES> section
180for more information on that. If your feature needs core support, create a
181topic/ branch using the L</STANDARD WORKFLOW> and start hacking away.
fbfcdc75 182
0b81ea16 183Failing tests are basically bug reports. You should find a core contributor
184and/or cabal member to see if it is a real bug, then submit the bug and your
185test to the RT queue. Source control is not a bug reporting tool.
fbfcdc75 186
187=item New user-facing features.
188
0b81ea16 189Anything that creates a new user-visible feature needs to be approved by
190B<more then one> cabal member.
fbfcdc75 191
0b81ea16 192Make sure you have reviewed L</NEW FEATURES> to be sure that you are following
193the guidelines. Do not be surprised if a new feature is rejected for the core.
fbfcdc75 194
195=item New internals features.
196
0b81ea16 197New features for Moose internals are less restrictive then user facing
198features, but still require approval by B<at least one> cabal member.
fbfcdc75 199
0b81ea16 200Ideally you will have run the smolder script to be sure you are not breaking
201any MooseX module or causing any other unforeseen havoc. If you do this
202(rather then make us do it), it will only help to hasten your branch's
203approval.
fbfcdc75 204
205=item Backwards incompatible changes.
206
0b81ea16 207Anything that breaks backwards compatibility must be discussed by the cabal
208and agreed to by a majority of the members.
fbfcdc75 209
0b81ea16 210We have a policy for what we see as sane L</BACKWARDS COMPATIBILITY> for
211Moose. If your changes break back-compat, you must be ready to discuss and
212defend your change.
fbfcdc75 213
214=back
215
04437dba 216=head1 RELEASE WORKFLOW
217
218 git checkout master
219 # edit for final version bumping, changelogging, etc
220 # prepare release (test suite etc)
221 git commit
222 git checkout stable
223 git merge master # must be a fast forward
224 git push both
225 # ship & tag
226
227Development releases are made without merging into the stable branch.
228
229=head1 EMERGENCY BUG WORKFLOW (for immediate release)
230
231Anyone can create the necessary fix by branching off of the stable branch:
232
233 git remote update
fd9e0bac 234 git checkout -b topic/my-emergency-fix origin/stable
04437dba 235 # hack
236 git commit
237
238Then a cabal member merges into stable:
239
240 git checkout stable
241 git merge topic/my-emergency-fix
242 git push
243 # release
244 git checkout master
245 git merge stable
246
247=head1 PROJECT WORKFLOW
248
249For longer lasting branches, we use a subversion style branch layout, where
250master is routinely merged into the branch. Rebasing is allowed as long as all
5af926eb 251the branch contributors are using C<git pull --rebase> properly.
04437dba 252
253C<commit --amend>, C<rebase --interactive>, etc. are not allowed, and should
254only be done in topic branches. Committing to master is still done with the
255same review process as a topic branch, and the branch must merge as a fast
256forward.
257
9840bb38 258This is pretty much the way we're doing branches for large-ish things right
04437dba 259now.
260
261Obviously there is no technical limitation on the number of branches. You can
262freely create topic branches off of project branches, or sub projects inside
263larger projects freely. Such branches should incorporate the name of the branch
264they were made off so that people don't accidentally assume they should be
265merged into master:
266
267 git checkout -b my-project--topic/foo my-project
268
269(unfortunately Git will not allow C<my-project/foo> as a branch name if
270C<my-project> is a valid ref).
271
272=head1 THE "PU" BRANCH
273
274To make things easier for longer lived branches (whether topics or projects),
275the 'pu' branch is basically what happens if you merge all of the branches and
276topics together with master.
277
278We can update this as necessary (e.g. on a weekly basis if there is merit),
279notifying the authors of the respective branches if their branches did not merge
280(and why).
281
282To update 'pu':
283
284 git checkout pu
285 git remote update
286 git reset --hard origin/master
287 git merge @all_the_branches
288
289If the merge is clean, 'pu' is updated with C<push --force>.
290
291If the merge is not clean, the offending branch is removed from
292C<@all_the_branches>, with a small note of the conflict, and we try again.
293
294The authors of the failed branches should be told to try to merge their branch
295into 'pu', to see how their branch interacts with other branches.
296
297'pu' is probably broken most of the time, but lets us know how the different
298branches interact.
299
300=head1 BRANCH ARCHIVAL
301
302Merged branches should be deleted.
303
304Failed branches may be kept, but consider moving to refs/attic/ (e.g.
305http://danns.co.uk/node/295) to keep git branch -l current.
306
307Any branch that could still realistically be merged in the future, even if it
308hasn't had work recently, should not be archived.
309
600f7f85 310=head1 TESTS, TESTS, TESTS
311
d85337ff 312If you write I<any> code for Moose or Class::MOP, you B<must> add
313tests for that code. If you do not write tests then we cannot
04437dba 314guarantee your change will not be removed or altered at a later date,
315as there is nothing to confirm this is desired behavior.
d85337ff 316
317If your code change/addition is deep within the bowels of
318Moose/Class::MOP and your test exercises this feature in a non-obvious
319way, please add some comments either near the code in question or in
320the test so that others know.
600f7f85 321
d85337ff 322We also greatly appreciate documentation to go with your changes, and
323an entry in the Changes file. Make sure to give yourself credit!
600f7f85 324
d85337ff 325=head1 BACKWARDS COMPATIBILITY
600f7f85 326
04437dba 327Change is inevitable, and Moose is not immune to this. We do our best
86b96832 328to maintain backwards compatibility, but we do not want the code base
d85337ff 329to become overburdened by this. This is not to say that we will be
330frivolous with our changes, quite the opposite, just that we are not
331afraid of change and will do our best to keep it as painless as
332possible for the end user.
600f7f85 333
04437dba 334The rule is that if you do something that is not backwards compatible, you
335B<must> do I<at least> one deprecation cycle (more if it is larger change).
336For really larger or radical changes dev releases may be needed as well (the
337Cabal will decide on this on a case-per-case basis).
600f7f85 338
04437dba 339The preference with regard to deprecation is to warn loudly and often so that
340users will have time to fix their usages.
600f7f85 341
d85337ff 342All backwards incompatible changes B<must> be documented in
04437dba 343L<Moose::Manual::Delta>. Make sure to document any useful tips or workarounds
344for the change in that document.
600f7f85 345
346=head1 AUTHOR
347
348Stevan Little E<lt>stevan@iinteractive.comE<gt>
349
04437dba 350Chris (perigrin) Prather
351
352Yuval (nothingmuch) Kogman
353
600f7f85 354=head1 COPYRIGHT AND LICENSE
355
356Copyright 2009 by Infinity Interactive, Inc.
357
358L<http://www.iinteractive.com>
359
360This library is free software; you can redistribute it and/or modify
361it under the same terms as Perl itself.
362
d85337ff 363=cut