doc: update AUTHORS list
[platform/upstream/nodejs.git] / CONTRIBUTING.md
1 # Contributing to io.js
2
3 ## Issue Contributions
4
5 When opening new issues or commenting on existing issues on this repository
6 please make sure discussions are related to concrete technical issues with the
7 io.js software.
8
9 Discussion of non-technical topics including subjects like intellectual
10 property, trademark and high level project questions should move to the
11 [node-forward discussions repository](https://github.com/node-forward/discussions)
12 instead.
13
14 ## Code Contributions
15
16 The io.js project has an open governance model and welcomes new contributors.
17 Individuals making significant and valuable contributions are made
18 _Collaborators_ and given commit-access to the project. See the
19 [GOVERNANCE.md](./GOVERNANCE.md) document for more information about how this
20 works.
21
22 This document will guide you through the contribution process.
23
24 ### Step 1: Fork
25
26 Fork the project [on GitHub](https://github.com/iojs/io.js) and check out your
27 copy locally.
28
29 ```text
30 $ git clone git@github.com:username/io.js.git
31 $ cd io.js
32 $ git remote add upstream git://github.com/iojs/io.js.git
33 ```
34
35 #### Which branch?
36
37 Now decide if you want your feature or bug fix to go into the master branch
38 or the stable branch.  As a rule of thumb, bug fixes go into the stable branch
39 while new features go into the master branch.
40
41 The stable branch is effectively frozen; patches that change the io.js
42 API/ABI or affect the run-time behavior of applications get rejected. The
43 current stable branch is set as the default branch on GitHub.
44
45 #### Respect the stability index
46
47 The rules for the master branch are less strict; consult the
48 [stability index](./doc/api/documentation.markdown#stability-index) for details.
49
50 In a nutshell, modules are at varying levels of API stability.  Bug fixes are
51 always welcome but API or behavioral changes to modules at stability level 3
52 and up are off-limits.
53
54 #### Dependencies
55
56 io.js has several bundled dependencies in the *deps/* and the *tools/*
57 directories that are not part of the project proper.  Any changes to files
58 in those directories or its subdirectories should be sent to their respective
59 projects.  Do not send your patch to us, we cannot accept it.
60
61 In case of doubt, open an issue in the
62 [issue tracker](https://github.com/iojs/io.js/issues/) or contact one of the
63 [project Collaborators](https://github.com/iojs/io.js/#Current-Project-Team-Members)
64 ([IRC](http://webchat.freenode.net/?channels=io.js) is often the best medium.)Especially do so if you plan to work on something big.  Nothing is more
65 frustrating than seeing your hard work go to waste because your vision
66 does not align with the project team.
67
68
69 ### Step 2: Branch
70
71 Create a feature branch and start hacking:
72
73 ```text
74 $ git checkout -b my-feature-branch -t origin/v1.x
75 ```
76
77 (Where `v1.x` is the latest stable branch as of this writing.)
78
79
80 ### Step 3: Commit
81
82 Make sure git knows your name and email address:
83
84 ```text
85 $ git config --global user.name "J. Random User"
86 $ git config --global user.email "j.random.user@example.com"
87 ```
88
89 Writing good commit logs is important.  A commit log should describe what
90 changed and why.  Follow these guidelines when writing one:
91
92 1. The first line should be 50 characters or less and contain a short
93    description of the change prefixed with the name of the changed
94    subsystem (e.g. "net: add localAddress and localPort to Socket").
95 2. Keep the second line blank.
96 3. Wrap all other lines at 72 columns.
97
98 A good commit log can look something like this:
99
100 ```
101 subsystem: explaining the commit in one line
102
103 Body of commit message is a few lines of text, explaining things
104 in more detail, possibly giving some background about the issue
105 being fixed, etc. etc.
106
107 The body of the commit message can be several paragraphs, and
108 please do proper word-wrap and keep columns shorter than about
109 72 characters or so. That way `git log` will show things
110 nicely even when it is indented.
111 ```
112
113 The header line should be meaningful; it is what other people see when they
114 run `git shortlog` or `git log --oneline`.
115
116 Check the output of `git log --oneline files_that_you_changed` to find out
117 what subsystem (or subsystems) your changes touch.
118
119
120 ### Step 4: Rebase
121
122 Use `git rebase` (not `git merge`) to sync your work from time to time.
123
124 ```text
125 $ git fetch upstream
126 $ git rebase upstream/v1.x  # or upstream/master
127 ```
128
129
130 ### Step 5: Test
131
132 Bug fixes and features **should come with tests**.  Add your tests in the
133 test/simple/ directory.  Look at other tests to see how they should be
134 structured (license boilerplate, common includes, etc.).
135
136 ```text
137 $ make jslint test
138 ```
139
140 Make sure the linter is happy and that all tests pass.  Please, do not submit
141 patches that fail either check.
142
143 If you are updating tests and just want to run a single test to check it, you
144 can use this syntax to run it exactly as the test harness would:
145
146 ```text
147 $ python tools/test.py -v --mode=release simple/test-stream2-transform
148 ```
149
150 You can run tests directly with node:
151
152 ```text
153 $ node ./test/simple/test-streams2-transform.js
154 ```
155
156
157 ### Step 6: Push
158
159 ```text
160 $ git push origin my-feature-branch
161 ```
162
163 Go to https://github.com/yourusername/io.js and select your feature branch.
164 Click the 'Pull Request' button and fill out the form.
165
166 Pull requests are usually reviewed within a few days.  If there are comments
167 to address, apply your changes in a separate commit and push that to your
168 feature branch.  Post a comment in the pull request afterwards; GitHub does
169 not send out notifications when you add commits.
170
171
172 ## Caine's Requirements
173
174 Hello!
175
176 I am pleased to see your valuable contribution to this project. Would you
177 please mind answering a couple of questions to help me classify this submission
178 and/or gather required information for the core team members?
179
180 ### Questions:
181
182 * _Issue-only_ Does this issue happen in core, or in some user-space
183   module from npm or other source? Please ensure that the test case
184   that reproduces this problem is not using any external dependencies.
185   If the error is not reproducible with just core modules - it is most
186   likely not a io.js problem. _Expected: `yes`_
187 * Which part of core do you think it might be related to?
188   _One of: `debugger, http, assert, buffer, child_process, cluster, crypto,
189   dgram, dns, domain, events, fs, http, https, module, net, os, path,
190   querystring, readline, repl, smalloc, stream, timers, tls, url, util, vm,
191   zlib, c++, docs, other`_ (_label_)
192 * Which versions of io.js do you think are affected by this?
193   _One of: `v0.10, v0.12, v1.0.0`_ (_label_)
194 * _PR-only_ Does `make test` pass after applying this Pull Request.
195   _Expected: `yes`_
196 * _PR-only_ Is the commit message properly formatted? (See
197   CONTRIBUTING.md for more information)
198   _Expected: `yes`_
199
200 Please provide the answers in an ordered list like this:
201
202 1. Answer for the first question
203 2. Answer for the second question
204 3. ...
205
206 Note that I am just a bot with a limited human-reply parsing abilities,
207 so please be very careful with numbers and don't skip the questions!
208
209 _In case of success I will say:_ `...summoning the core team devs!`.
210
211 _In case of validation problem I will say:_ `Sorry, but something is not right
212 here:`.
213
214 Truly yours,
215 Caine.
216
217 ### Responsibilities
218
219 * indutny: crypto, tls, https, child_process, c++
220 * trevnorris: buffer, http, https, smalloc
221 * bnoordhuis: http, cluster, child_process, dgram