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