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