1 # io.js Collaborator Guide
5 * [Issues and Pull Requests](#issues-and-pull-requests)
6 * [Accepting Modifications](#accepting-modifications)
7 - [Involving the TC](#involving-the-tc)
8 * [Landing Pull Requests](#landing-pull-requests)
9 - [Technical HOWTO](#technical-howto)
10 - [I Just Made a Mistake](#i-just-made-a-mistake)
12 This document contains information for Collaborators of the io.js
13 project regarding maintaining the code, documentation and issues.
15 Collaborators should be familiar with the guidelines for new
16 contributors in [CONTRIBUTING.md](./CONTRIBUTING.md) and also
17 understand the project governance model as outlined in
18 [GOVERNANCE.md](./GOVERNANCE.md).
20 ## Issues and Pull Requests
22 Courtesy should always be shown to individuals submitting issues and
23 pull requests to the io.js project.
25 Collaborators should feel free to take full responsibility for
26 managing issues and pull requests they feel qualified to handle, as
27 long as this is done while being mindful of these guidelines, the
28 opinions of other Collaborators and guidance of the TC.
30 Collaborators may **close** any issue or pull request they believe is
31 not relevant for the future of the io.js project. Where this is
32 unclear, the issue should be left open for several days to allow for
33 additional discussion. Where this does not yield input from io.js
34 Collaborators or additional evidence that the issue has relevance, the
35 issue may be closed. Remember that issues can always be re-opened if
38 ## Accepting Modifications
40 All modifications to the io.js code and documentation should be
41 performed via GitHub pull requests, including modifications by
42 Collaborators and TC members.
44 All pull requests must be reviewed and accepted by a Collaborator with
45 sufficient expertise who is able to take full responsibility for the
46 change. In the case of pull requests proposed by an existing
47 Collaborator, an additional Collaborator is required for sign-off.
49 In some cases, it may be necessary to summon a qualified Collaborator
50 to a pull request for review by @-mention.
52 If you are unsure about the modification and are not prepared to take
53 full responsibility for the change, defer to another Collaborator.
55 Before landing pull requests, sufficient time should be left for input
56 from other Collaborators. Leave at least 48 hours during the week and
57 72 hours over weekends to account for international time differences
58 and work schedules. Trivial changes (e.g. those which fix minor bugs
59 or improve performance without affecting API or causing other
60 wide-reaching impact) may be landed after a shorter delay.
62 Where there is no disagreement amongst Collaborators, a pull request
63 may be landed given appropriate review. Where there is discussion
64 amongst Collaborators, consensus should be sought if possible. The
65 lack of consensus may indicate the need to elevate discussion to the
66 TC for resolution (see below).
68 All bugfixes require a test case which demonstrates the defect. The
69 test should *fail* before the change, and *pass* after the change.
73 Collaborators may opt to elevate pull requests or issues to the TC for
74 discussion by assigning the ***tc-agenda*** tag. This should be done
77 - has a significant impact on the codebase,
78 - is inherently controversial; or
79 - has failed to reach consensus amongst the Collaborators who are
80 actively participating in the discussion.
82 The TC should serve as the final arbiter where required.
84 ## Landing Pull Requests
86 Always modify the original commit message to include additional meta
87 information regarding the change process:
89 - A `Reviewed-By: Name <email>` line for yourself and any
90 other Collaborators who have reviewed the change.
91 - A `PR-URL:` line that references the full GitHub URL of the original
92 pull request being merged so it's easy to trace a commit back to the
93 conversation that led up to that change.
94 - A `Fixes: X` line, where _X_ is either includes the full GitHub URL
95 for an issue, and/or the hash and commit message if the commit fixes
96 a bug in a previous commit. Multiple `Fixes:` lines may be added if
99 See the commit log for examples such as
100 [this one](https://github.com/nodejs/io.js/commit/b636ba8186) if unsure
101 exactly how to format your commit messages.
105 - Double check PRs to make sure the person's _full name_ and email
106 address are correct before merging.
107 - Except when updating dependencies, all commits should be self
108 contained (meaning every commit should pass all tests). This makes
109 it much easier when bisecting to find a breaking change.
113 _Optional:_ ensure that you are not in a borked `am`/`rebase` state
120 Checkout proper target branch
123 $ git checkout master
130 $ git merge --ff-only origin/master
133 Apply external patches
136 $ curl -L https://github.com/nodejs/io.js/pull/xxx.patch | git am --whitespace=fix
139 Check and re-review the changes
142 $ git diff origin/master
145 Check number of commits and commit messages
148 $ git log origin/master...master
151 If there are multiple commits that relate to the same feature or
152 one with a feature and separate with a test for that feature,
153 you'll need to use `squash` or `fixup`:
156 $ git rebase -i origin/master
159 This will open a screen like this (in the default shell editor):
162 pick 6928fc1 crypto: add feature A
163 pick 8120c4c add test for feature A
164 pick 51759dc feature B
165 pick 7d6f433 test for feature B
167 # Rebase f9456a2..7d6f433 onto f9456a2
170 # p, pick = use commit
171 # r, reword = use commit, but edit the commit message
172 # e, edit = use commit, but stop for amending
173 # s, squash = use commit, but meld into previous commit
174 # f, fixup = like "squash", but discard this commit's log message
175 # x, exec = run command (the rest of the line) using shell
177 # These lines can be re-ordered; they are executed from top to bottom.
179 # If you remove a line here THAT COMMIT WILL BE LOST.
181 # However, if you remove everything, the rebase will be aborted.
183 # Note that empty commits are commented out
186 Replace a couple of `pick`s with `fixup` to squash them into a
190 pick 6928fc1 crypto: add feature A
191 fixup 8120c4c add test for feature A
192 pick 51759dc feature B
193 fixup 7d6f433 test for feature B
196 Replace `pick` with `reword` to change the commit message:
199 reword 6928fc1 crypto: add feature A
200 fixup 8120c4c add test for feature A
201 reword 51759dc feature B
202 fixup 7d6f433 test for feature B
205 Save the file and close the editor. You'll be asked to enter a new
206 commit message for that commit. This is a good moment to fix incorrect
207 commit logs, ensure that they are properly formatted, and add
213 $ git push origin master
216 ### I Just Made a Mistake
218 With `git`, there's a way to override remote trees by force pushing
219 (`git push -f`). This should generally be seen as forbidden (since
220 you're rewriting history on a repository other people are working
221 against) but is allowed for simpler slip-ups such as typos in commit
222 messages. However, you are only allowed to force push to any io.js
223 branch within 10 minutes from your original push. If someone else
224 pushes to the branch or the 10 minute period passes, consider the