|
| 1 | +# Contributing to Ironsource API Library |
| 2 | + |
| 3 | +We would love you to contribute to Ironsource API Library! |
| 4 | +As a contributor, here are the guidelines we would like you to follow: |
| 5 | + |
| 6 | +- [Code of Conduct](#coc) |
| 7 | +- [Question or Problem?](#question) |
| 8 | +- [Issues and Bugs](#issue) |
| 9 | +- [Feature Requests](#feature) |
| 10 | +- [Submission Guidelines](#submit) |
| 11 | +- [Commit Message Guidelines](#commit) |
| 12 | +- [Signing the CLA](#cla) |
| 13 | + |
| 14 | + |
| 15 | +## <a name="coc"></a> Code of Conduct |
| 16 | + |
| 17 | +Help us keep Ironsource API Library open and inclusive. |
| 18 | +Please read and follow our [Code of Conduct][coc]. |
| 19 | + |
| 20 | + |
| 21 | +## <a name="question"></a> Got a Question or Problem? |
| 22 | + |
| 23 | +Do not open issues for general support questions as we want to keep GitHub issues for bug reports and feature requests. |
| 24 | +Instead, [contact ironSource support](https://developers.is.com/submit-a-request) |
| 25 | + |
| 26 | +## <a name="issue"></a> Found a Bug? |
| 27 | + |
| 28 | +If you find a bug in the source code, you can help us by [submitting an issue](#submit-issue) to our [GitHub Repository][github]. |
| 29 | +Even better, you can [submit a Pull Request](#submit-pr) with a fix. |
| 30 | + |
| 31 | + |
| 32 | +## <a name="feature"></a> Missing a Feature? |
| 33 | +You can *request* a new feature by [submitting an issue](#submit-issue) to our GitHub Repository. |
| 34 | +If you would like to *implement* a new feature, please consider the size of the change in order to determine the right steps to proceed: |
| 35 | + |
| 36 | +* For a **Major Feature**, first open an issue and outline your proposal so that it can be discussed. |
| 37 | + This process allows us to better coordinate our efforts, prevent duplication of work, and help you to craft the change so that it is successfully accepted into the project. |
| 38 | + |
| 39 | + **Note**: Adding a new topic to the documentation, or significantly re-writing a topic, counts as a major feature. |
| 40 | + |
| 41 | +* **Small Features** can be crafted and directly [submitted as a Pull Request](#submit-pr). |
| 42 | + |
| 43 | + |
| 44 | +## <a name="submit"></a> Submission Guidelines |
| 45 | + |
| 46 | + |
| 47 | +### <a name="submit-issue"></a> Submitting an Issue |
| 48 | + |
| 49 | +Before you submit an issue, please search the issue tracker, maybe an issue for your problem already exists and the discussion might inform you of workarounds readily available. |
| 50 | + |
| 51 | +We want to fix all the issues as soon as possible, but before fixing a bug we need to reproduce and confirm it. |
| 52 | +In order to reproduce bugs, we require that you provide a minimal reproduction. |
| 53 | +Having a minimal reproducible scenario gives us a wealth of important information without going back and forth to you with additional questions. |
| 54 | + |
| 55 | +A minimal reproduction allows us to quickly confirm a bug (or point out a coding problem) as well as confirm that we are fixing the right problem. |
| 56 | + |
| 57 | +We require a minimal reproduction to save maintainers' time and ultimately be able to fix more bugs. |
| 58 | +Often, developers find coding problems themselves while preparing a minimal reproduction. |
| 59 | +We understand that sometimes it might be hard to extract essential bits of code from a larger codebase but we really need to isolate the problem before we can fix it. |
| 60 | + |
| 61 | +Unfortunately, we are not able to investigate / fix bugs without a minimal reproduction, so if we don't hear back from you, we are going to close an issue that doesn't have enough info to be reproduced. |
| 62 | + |
| 63 | +You can file new issues by selecting from our [new issue templates](https://github.com/ironSource/mobile-api-lib-python/issues/new/choose) and filling out the issue template. |
| 64 | + |
| 65 | + |
| 66 | +### <a name="submit-pr"></a> Submitting a Pull Request (PR) |
| 67 | + |
| 68 | +Before you submit your Pull Request (PR) consider the following guidelines: |
| 69 | + |
| 70 | +1. Search [GitHub](https://github.com/ironSource/mobile-api-lib-python/pulls) for an open or closed PR that relates to your submission. |
| 71 | + You don't want to duplicate existing efforts. |
| 72 | + |
| 73 | +2. Be sure that an issue describes the problem you're fixing, or documents the design for the feature you'd like to add. |
| 74 | + Discussing the design upfront helps to ensure that we're ready to accept your work. |
| 75 | + |
| 76 | +3. Please review our [Contributor License Agreement (CLA)](#cla) before sending PRs. |
| 77 | + **By creating a pull request you accept the *Contributor License Agreement (CLA)*** |
| 78 | + |
| 79 | +4. [Fork](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo) the angular/angular repo. |
| 80 | + |
| 81 | +5. In your forked repository, make your changes in a new git branch: |
| 82 | + |
| 83 | + ```shell |
| 84 | + git checkout -b my-fix-branch main |
| 85 | + ``` |
| 86 | + |
| 87 | +6. Create your patch, **including appropriate test cases**. |
| 88 | + |
| 89 | + |
| 90 | +7. Run the unit tests |
| 91 | + ```shell |
| 92 | + npm run test |
| 93 | + ``` |
| 94 | + ***optional:*** |
| 95 | + If you have your own ironSource credentials that you wish to test with add them to your local .env |
| 96 | + ```shell |
| 97 | + API_CI_SECRET= |
| 98 | + API_CI_TOKEN= |
| 99 | + API_CI_USER= |
| 100 | + ``` |
| 101 | + or |
| 102 | + ```shell |
| 103 | + DEMO_ACCOUNT_SECRET= |
| 104 | + DEMO_ACCOUNT_TOKEN= |
| 105 | + DEMO_ACCOUNT_USER= |
| 106 | + ``` |
| 107 | + |
| 108 | + then run: |
| 109 | + ```shell |
| 110 | + npm run integrationTest |
| 111 | + ``` |
| 112 | + |
| 113 | +8. Run lint: |
| 114 | + ```shell |
| 115 | + npm run lint |
| 116 | + ``` |
| 117 | + |
| 118 | +9. Commit your changes using a descriptive commit message that follows our [commit message conventions](#commit). |
| 119 | + Adherence to these conventions is necessary because release notes are automatically generated from these messages. |
| 120 | + |
| 121 | + ```shell |
| 122 | + git commit --all |
| 123 | + ``` |
| 124 | + Note: the optional commit `-a` command line option will automatically "add" and "rm" edited files. |
| 125 | + |
| 126 | +10. Push your branch to GitHub: |
| 127 | + |
| 128 | + ```shell |
| 129 | + git push origin my-fix-branch |
| 130 | + ``` |
| 131 | + |
| 132 | +11. In GitHub, send a pull request to `ironSource/mobile-api-lib-python:main`. |
| 133 | + |
| 134 | +### Reviewing a Pull Request |
| 135 | + |
| 136 | +The Ironsource API Library team reserves the right not to accept pull requests from community members who haven't been good citizens of the community. Such behavior includes not following the [code of conduct][coc] |
| 137 | +
|
| 138 | +#### Addressing review feedback |
| 139 | +
|
| 140 | +If we ask for changes via code reviews then: |
| 141 | +
|
| 142 | +1. Make the required updates to the code. |
| 143 | +
|
| 144 | +2. Re-run the Ironsource API Library test to ensure tests are still passing. |
| 145 | +
|
| 146 | +3. Create a fixup commit and push to your GitHub repository (this will update your Pull Request): |
| 147 | +
|
| 148 | + ```shell |
| 149 | + git commit --all --fixup HEAD |
| 150 | + git push |
| 151 | + ``` |
| 152 | +
|
| 153 | +That's it! Thank you for your contribution! |
| 154 | + |
| 155 | + |
| 156 | + |
| 157 | +## <a name="commit"></a> Commit Message Format |
| 158 | + |
| 159 | +Please follow the [conventional-commits format][commit] |
| 160 | + |
| 161 | +Commit format: |
| 162 | +``` |
| 163 | +<type>(<scope>): <short summary> |
| 164 | + │ │ │ |
| 165 | + │ │ └─⫸ Summary in present tense. Not capitalized. No period at the end. |
| 166 | + │ │ |
| 167 | + │ └─⫸ Commit Scope: component_name|service_name|feature_name|.... |
| 168 | + │ |
| 169 | + └─⫸ Commit Type: build|ci|feat|fix|refactor|test|perf |
| 170 | +``` |
| 171 | + |
| 172 | +The `<type>` and `<summary>` fields are mandatory, the `(<scope>)` field is optional. |
| 173 | + |
| 174 | + |
| 175 | +##### Type |
| 176 | + |
| 177 | +Must be one of the following: |
| 178 | + |
| 179 | +* **build**: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm) |
| 180 | +* **ci**: Changes to our CI configuration files and scripts (example scopes: Circle, BrowserStack, SauceLabs) |
| 181 | +* **feat**: A new feature |
| 182 | +* **fix**: A bug fix |
| 183 | +* **perf**: A code change that improves performance |
| 184 | +* **refactor**: A code change that neither fixes a bug nor adds a feature |
| 185 | +* **test**: Adding missing tests or correcting existing tests |
| 186 | + |
| 187 | + |
| 188 | +##### Scope |
| 189 | +The scope should be the name of the npm module affected |
| 190 | + |
| 191 | + |
| 192 | +##### Summary |
| 193 | + |
| 194 | +Use the summary field to provide a succinct description of the change: |
| 195 | + |
| 196 | +* use the imperative, present tense: "change" not "changed" nor "changes" |
| 197 | +* don't capitalize the first letter |
| 198 | +* no dot (.) at the end |
| 199 | +
|
| 200 | +
|
| 201 | +#### <a name="commit-body"></a>Commit Message Body |
| 202 | +
|
| 203 | +
|
| 204 | +Explain the motivation for the change in the commit message body. This commit message should explain _why_ you are making the change. |
| 205 | +You can include a comparison of the previous behavior with the new behavior in order to illustrate the impact of the change. |
| 206 | +
|
| 207 | +
|
| 208 | +
|
| 209 | +### Revert commits |
| 210 | +
|
| 211 | +If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit. |
| 212 | +
|
| 213 | +The content of the commit message body should contain: |
| 214 | +
|
| 215 | +- information about the SHA of the commit being reverted in the following format: `This reverts commit <SHA>`, |
| 216 | +- a clear description of the reason for reverting the commit message. |
| 217 | +
|
| 218 | +
|
| 219 | +
|
| 220 | +
|
| 221 | +[github]: https://github.com/ironSource/mobile-api-lib-python |
| 222 | +[coc]: https://github.com/ironSource/mobile-api-lib-python/blob/main/CODE_OF_CONDUCT.md |
| 223 | +[cla]: https://github.com/ironSource/opensource-contributor-license-agreement |
| 224 | +[commit]: https://www.conventionalcommits.org/en/v1.0.0/ |
0 commit comments