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