|
1 |
| -#Contributing to Selenium |
2 |
| -Please review the [Getting Involved](http://docs.seleniumhq.org/about/getting-involved.jsp) guide first. |
| 1 | +# Contributing to Selenium |
3 | 2 |
|
4 |
| -##Creating a PR |
5 |
| -Please read [Contributing Code to Selenium](http://docs.seleniumhq.org/about/getting-involved.jsp#contributing-code-to-selenium). |
| 3 | +The Selenium project welcomes contributions! It is maintained, |
| 4 | +developed, and made by individuals just like yourself. |
6 | 5 |
|
7 |
| -##Reporting an issue |
8 |
| -Please read [Bug Reports and Feature Requests](http://docs.seleniumhq.org/about/getting-involved.jsp#bug-reports-and-feature-requests) |
| 6 | +There are a number of ways in which you can help: |
| 7 | + |
| 8 | +## Issue Contributions |
| 9 | + |
| 10 | +When opening new issues or commenting on existing issues on this |
| 11 | +repository please make sure discussions are related to concrete |
| 12 | +technical issues with the Selenium software. |
| 13 | + |
| 14 | +It's imperative that issue reports outline the steps to reproduce the |
| 15 | +defect. If the issue can't be reproduced it will be closed. |
| 16 | + |
| 17 | +Discussion of high level project ideas or non-technical topics should |
| 18 | +move to the [selenium-developers@ mailing |
| 19 | +list](https://groups.google.com/forum/#!forum/selenium-developers) |
| 20 | +instead. |
| 21 | + |
| 22 | +### Issue Labels |
| 23 | + |
| 24 | +Issues are labelled to make them easier to categorise and find by |
| 25 | + |
| 26 | +* which **component** they relate to (java, cpp, dotnet, py, rb) |
| 27 | +* which **driver** is affected |
| 28 | +* their presumed **difficulty** (easy, less easy, hard) |
| 29 | +* what **type** of issue they are (defect, race condition, cleanup) |
| 30 | + |
| 31 | +## Documentation Contributions |
| 32 | + |
| 33 | +Selenium is a big software project and documentation is key to |
| 34 | +understanding how things work and learning effective ways to exploit |
| 35 | +its potential. |
| 36 | + |
| 37 | +The official documentation of Selenium is still served from our Google |
| 38 | +Code [**site** repository](https://code.google.com/p/selenium/source/list?repo=site). |
| 39 | +We are however phasing out this documentation which focuses too much |
| 40 | +on Selenium RC and other antiquated pieces, in favour of a rewrite. |
| 41 | + |
| 42 | +The new documentation is a project started to rewrite Selenium's |
| 43 | +documentation from scratch. This is an ongoing effort (not targetted |
| 44 | +at any specific release) to provide an updated handbook on how to use |
| 45 | +Selenium effectively. We hope to bring over the pieces of the old |
| 46 | +documentation that makes sense. |
| 47 | + |
| 48 | +Contributions toward the new docs follow the same process described in |
| 49 | +the next section about code contributions. You should spend some time |
| 50 | +familiarising yourself with the documentation by reading |
| 51 | +[more about it](https://seleniumhq.github.io/docs/intro.html#about_this_documentation). |
| 52 | + |
| 53 | +## Code Contributions |
| 54 | + |
| 55 | +The Selenium project welcomes new contributors. Individuals making |
| 56 | +significant and valuable contributions over time are made _Committers_ |
| 57 | +and given commit-access to the project. |
| 58 | + |
| 59 | +This document will guide you through the contribution process. |
| 60 | + |
| 61 | +### Step 1: Forking |
| 62 | + |
| 63 | +Fork the project [on Github](https://github.com/seleniumhq/selenium) |
| 64 | +and check out your copy locally. |
| 65 | + |
| 66 | +```text |
| 67 | +% git clone [email protected]:username/selenium.git |
| 68 | +% cd selenium |
| 69 | +% git remote add upstream git://github.com/seleniumhq/selenium.git |
| 70 | +``` |
| 71 | + |
| 72 | +#### Dependencies |
| 73 | + |
| 74 | +We bundle dependencies in the _third-party/_ directory that is not |
| 75 | +part of the project proper. Any changes to files in this directory or |
| 76 | +its subdirectories should be sent upstream to the respective projects. |
| 77 | +Please don't send your patch to us as we cannot accept it. |
| 78 | + |
| 79 | +We do accept help in upgrading our existing dependencies or removing |
| 80 | +superfluous dependencies. If you need to add a new dependency it's |
| 81 | +often a good idea to reach out to the committers on the IRC channel or |
| 82 | +the mailing list to check that your approach aligns with the project's |
| 83 | +ideas. Nothing is more frustrating that seeing your hard work go to |
| 84 | +waste because your vision doesn't align with the project's. |
| 85 | + |
| 86 | +#### License Headers |
| 87 | + |
| 88 | +Every file in the Selenium project must carry the following license |
| 89 | +header boilerplate: |
| 90 | + |
| 91 | +```text |
| 92 | +Licensed to the Software Freedom Conservancy (SFC) under one |
| 93 | +or more contributor license agreements. See the NOTICE file |
| 94 | +distributed with this work for additional information |
| 95 | +regarding copyright ownership. The SFC licenses this file |
| 96 | +to you under the Apache License, Version 2.0 (the |
| 97 | +"License"); you may not use this file except in compliance |
| 98 | +with the License. You may obtain a copy of the License at |
| 99 | +
|
| 100 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 101 | +
|
| 102 | +Unless required by applicable law or agreed to in writing, |
| 103 | +software distributed under the License is distributed on an |
| 104 | +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 105 | +KIND, either express or implied. See the License for the |
| 106 | +specific language governing permissions and limitations |
| 107 | +under the License. |
| 108 | +``` |
| 109 | + |
| 110 | +There's no need to include a copyright statement in the file's header. |
| 111 | +The copyright attributions can be reviewed in the |
| 112 | +[NOTICE](https://github.com/SeleniumHQ/selenium/blob/master/NOTICE) |
| 113 | +file found in the top-level directory. |
| 114 | + |
| 115 | +### Step 2: Branching |
| 116 | + |
| 117 | +Create a feature branch and start hacking: |
| 118 | + |
| 119 | +```text |
| 120 | +% git checkout -b my-feature-branch |
| 121 | +``` |
| 122 | + |
| 123 | +We practice HEAD-based development, which means all changes are aplied |
| 124 | +directly on top of master. |
| 125 | + |
| 126 | +### Step 3: Committing |
| 127 | + |
| 128 | +FIrst make sure git knows your name and email address: |
| 129 | + |
| 130 | +```text |
| 131 | +% git config --global user.name 'Santa Claus' |
| 132 | +% git config --global user.email '[email protected]' |
| 133 | +``` |
| 134 | + |
| 135 | +**Writing good committ messages is important.** A commit message |
| 136 | +should describe what changed, why, and reference issues fixed (if |
| 137 | +any). Follow these guidelines when writing one: |
| 138 | + |
| 139 | +1. The first line should be around 50 characters or less and contain a |
| 140 | + short description of the change. |
| 141 | +2. Keep the second line blank. |
| 142 | +3. Wrap all other lines at 72 columns. |
| 143 | +4. Include `Fixes #_N_`, where _N_ is the issue number the commit |
| 144 | + fixes, if any. |
| 145 | + |
| 146 | +A good commit message can look like this: |
| 147 | + |
| 148 | +```text |
| 149 | +subsystem: explaining the commit in one line |
| 150 | +
|
| 151 | +Body of commit message is a few lines of text, explaining things |
| 152 | +in more detail, possibly giving some background about the issue |
| 153 | +being fixed, etc. |
| 154 | +
|
| 155 | +The body of the commit message can be several paragraphs, and |
| 156 | +please do proper word-wrap and keep columns shorter than about |
| 157 | +72 characters or so. That way `git log` will show things |
| 158 | +nicely even when it is indented. |
| 159 | +
|
| 160 | +Fixes #141 |
| 161 | +``` |
| 162 | + |
| 163 | +The first line must be meaningful as it's what people see when they |
| 164 | +run `git shortlog` or `git log --online`. |
| 165 | + |
| 166 | +### Step 4: Rebasing |
| 167 | + |
| 168 | +Use `git rebase` (not `git merge`) to sync your work from time to time. |
| 169 | + |
| 170 | +```text |
| 171 | +% git fetch upstream |
| 172 | +% git rebase upstream/master |
| 173 | +``` |
| 174 | + |
| 175 | +### Step 5: Testing |
| 176 | + |
| 177 | +Bug fixes and features **should have tests**. Look at other tests to |
| 178 | +see how they should be structured. |
| 179 | + |
| 180 | +Before you submit your pull request make sure you pass all the tests: |
| 181 | + |
| 182 | +```text |
| 183 | +% ./go clean test |
| 184 | +``` |
| 185 | + |
| 186 | +### Step 6: Sign the CLA |
| 187 | + |
| 188 | +Before we can accept , we first ask people to sign a |
| 189 | +[Contributor License Agreement](https://spreadsheets.google.com/spreadsheet/viewform?hl=en_US&formkey=dFFjXzBzM1VwekFlOWFWMjFFRjJMRFE6MQ#gid=0) |
| 190 | +(or CLA). We ask this so that we know that contributors have the right |
| 191 | +to donate the code. |
| 192 | + |
| 193 | +When you open your pull request we ask that you indicate that you've |
| 194 | +signed the CLA. This will reduce the time it takes for us to integrate |
| 195 | +it. |
| 196 | + |
| 197 | +### Step 7: Pushing |
| 198 | + |
| 199 | +```text |
| 200 | +% git push origin my-feature-branch |
| 201 | +``` |
| 202 | + |
| 203 | +Go to https://github.com/yourusername/selenium.git and press the _Pull |
| 204 | +Request_ and fill out the form. **Please indicate that you've signed |
| 205 | +the CLA** (see step 6). |
| 206 | + |
| 207 | +Pull requests are usually reviewed within a few days. If there are |
| 208 | +comments to address, apply your changes in new commits (preferably |
| 209 | +[fixups](http://git-scm.com/docs/git-commit)) and push to the same |
| 210 | +branch. |
| 211 | + |
| 212 | +#### Explanation of a PR's Different Stages |
| 213 | + |
| 214 | +From your create your pull request, through code review and towards |
| 215 | +integration, it will be assigned different Github labels. The labels |
| 216 | +serve for the committers to more easily keep track of work that's |
| 217 | +pending or awaiting action. |
| 218 | + |
| 219 | +##### Component Labels |
| 220 | + |
| 221 | +Component labels are yellow and carry the **C** prefix. They highlight |
| 222 | +the subsystem or component your PR makes changes in. |
| 223 | + |
| 224 | +##### Driver Labels |
| 225 | + |
| 226 | +The driver labels (**D**) indicate if the changes are related to a |
| 227 | +WebDriver implementation or the Selenium atoms. |
| 228 | + |
| 229 | +##### Review Labels |
| 230 | + |
| 231 | +The review labels (**R**) are: |
| 232 | + |
| 233 | +* **awaiting answer**: awaits an answer from you |
| 234 | +* **awaiting merge**: waits for a committer to integrate the PR |
| 235 | +* **awaiting reviewer**: pending code review |
| 236 | +* **blocked on external**: a change in an upstream repo is required |
| 237 | +* **needs code changes**: waiting for you to fix a review issue |
| 238 | +* **needs rebase**: the branch isn't in sync with master and needs to |
| 239 | + be rebased |
| 240 | + |
| 241 | +### Step 8: Integration |
| 242 | + |
| 243 | +When code review is complete, a committer will take your PR and |
| 244 | +integrate it on Selenium's master branch. Because we like to keep a |
| 245 | +linear history on th master branch, we will normally squash and rebase |
| 246 | +your branch history. |
0 commit comments