|
| 1 | +## Legal |
| 2 | + |
| 3 | +By submitting a pull request, you represent that you have the right to license |
| 4 | +your contribution to Apple and the community, and agree by submitting the patch |
| 5 | +that your contributions are licensed under the Apache 2.0 license (see |
| 6 | +`LICENSE.txt`). |
| 7 | + |
| 8 | + |
| 9 | +## How to submit a bug report |
| 10 | + |
| 11 | +Please ensure to specify the following: |
| 12 | + |
| 13 | +* AsyncHTTPClient commit hash |
| 14 | +* Contextual information (e.g. what you were trying to achieve with AsyncHTTPClient) |
| 15 | +* Simplest possible steps to reproduce |
| 16 | + * More complex the steps are, lower the priority will be. |
| 17 | + * A pull request with failing test case is preferred, but it's just fine to paste the test case into the issue description. |
| 18 | +* Anything that might be relevant in your opinion, such as: |
| 19 | + * Swift version or the output of `swift --version` |
| 20 | + * OS version and the output of `uname -a` |
| 21 | + * Network configuration |
| 22 | + |
| 23 | + |
| 24 | +### Example |
| 25 | + |
| 26 | +``` |
| 27 | +AsyncHTTPClient commit hash: 22ec043dc9d24bb011b47ece4f9ee97ee5be2757 |
| 28 | +
|
| 29 | +Context: |
| 30 | +While load testing my program written with AsyncHTTPClient, I noticed |
| 31 | +that one file descriptor is leaked per request. |
| 32 | +
|
| 33 | +Steps to reproduce: |
| 34 | +1. ... |
| 35 | +2. ... |
| 36 | +3. ... |
| 37 | +4. ... |
| 38 | +
|
| 39 | +$ swift --version |
| 40 | +Swift version 4.0.2 (swift-4.0.2-RELEASE) |
| 41 | +Target: x86_64-unknown-linux-gnu |
| 42 | +
|
| 43 | +Operating system: Ubuntu Linux 16.04 64-bit |
| 44 | +
|
| 45 | +$ uname -a |
| 46 | +Linux beefy.machine 4.4.0-101-generic #124-Ubuntu SMP Fri Nov 10 18:29:59 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux |
| 47 | +
|
| 48 | +My system has IPv6 disabled. |
| 49 | +``` |
| 50 | + |
| 51 | +## Writing a Patch |
| 52 | + |
| 53 | +A good AsyncHTTPClient patch is: |
| 54 | + |
| 55 | +1. Concise, and contains as few changes as needed to achieve the end result. |
| 56 | +2. Tested, ensuring that any tests provided failed before the patch and pass after it. |
| 57 | +3. Documented, adding API documentation as needed to cover new functions and properties. |
| 58 | +4. Accompanied by a great commit message, using our commit message template. |
| 59 | + |
| 60 | +### Commit Message Template |
| 61 | + |
| 62 | +We require that your commit messages match our template. The easiest way to do that is to get git to help you by explicitly using the template. To do that, `cd` to the root of our repository and run: |
| 63 | + |
| 64 | + git config commit.template dev/git.commit.template |
| 65 | + |
| 66 | +### Make sure Tests work on Linux |
| 67 | + |
| 68 | +AsyncHTTPClient uses XCTest to run tests on both macOS and Linux. While the macOS version of XCTest is able to use the Objective-C runtime to discover tests at execution time, the Linux version is not. |
| 69 | +For this reason, whenever you add new tests **you have to run a script** that generates the hooks needed to run those tests on Linux, or our CI will complain that the tests are not all present on Linux. To do this, merely execute `ruby ./scripts/generate_linux_tests.rb` at the root of the package and check the changes it made. |
| 70 | + |
| 71 | +## How to contribute your work |
| 72 | + |
| 73 | +Please open a pull request at https://github.com/swift-server/async-http-client. Make sure the CI passes, and then wait for code review. |
0 commit comments