|
| 1 | +# Contributing guidelines |
| 2 | + |
| 3 | + |
| 4 | +## Questions or Problems |
| 5 | + |
| 6 | +Please, do not open issues for general support questions as we want to keep GitHub |
| 7 | +issues for bug reports and feature requests. Instead, we recommend using our [mailing |
| 8 | +list](https://lists.sunet.se/postorius/lists/idpy-discuss.lists.sunet.se/) or asking |
| 9 | +support-related questions on the [Slack workspace](https://identity-python.slack.com/) |
| 10 | +([invitation](https://join.slack.com/t/identity-python/shared_invite/enQtNzEyNjU1NDI1MjUyLTM2MWI5ZGNhMTk1ZThiOTIxNWY2OTY1ODVmMWNjMzUzMTYxNTY5MzE5N2RlYjExZTIyM2MwYjBjZGE4MGVlMTM)). |
| 11 | + |
| 12 | +To save your and our time, we will systematically close all issues that are requests for |
| 13 | +general support and redirect people to the channels above. |
| 14 | + |
| 15 | + |
| 16 | +## Issues and Bugs |
| 17 | + |
| 18 | +If you find a bug in the source code, you can help us by submitting an issue to our |
| 19 | +GitHub Repository. Even better, you can submit a Pull Request with a fix. |
| 20 | + |
| 21 | + |
| 22 | +## Feature Requests |
| 23 | + |
| 24 | +You can request a new feature by submitting an issue to our GitHub Repository. If you |
| 25 | +would like to implement a new feature, please consider the size of the change in order |
| 26 | +to determine the right steps to proceed: |
| 27 | + |
| 28 | +- For a Major Feature, first open an issue and outline your proposal so that it can be |
| 29 | + discussed. This process allows us to better coordinate our efforts, prevent |
| 30 | + duplication of work, and help you to craft the change so that it is successfully |
| 31 | + accepted into the project. |
| 32 | + |
| 33 | +- Small Features can be crafted and directly submitted as a Pull Request. |
| 34 | + |
| 35 | + |
| 36 | +## Improving Documentation |
| 37 | + |
| 38 | +Should you have a suggestion for the documentation, you can open an issue and outline |
| 39 | +the problem or improvement you have - however, creating the doc fix yourself is much |
| 40 | +better! |
| 41 | + |
| 42 | +If you want to help improve the docs, it's a good idea to let others know what you're |
| 43 | +working on to minimize duplication of effort. Create a new issue (or comment on a |
| 44 | +related existing one) to let others know what you're working on. |
| 45 | + |
| 46 | +If you're making a small change (typo, phrasing) don't worry about filing an issue |
| 47 | +first. Fork the repository in-place and make a quick change on the fly. |
| 48 | + |
| 49 | +For large fixes, please build and test the documentation before submitting the PR to be |
| 50 | +sure you haven't accidentally introduced any layout or formatting issues. |
| 51 | + |
| 52 | + |
| 53 | +## Submission Guidelines |
| 54 | + |
| 55 | + |
| 56 | +### Submitting an Issue |
| 57 | + |
| 58 | +Before you submit an issue, please search the issue tracker. |
| 59 | +An issue for your problem might already exist |
| 60 | +and the discussion might inform you of workarounds readily available. |
| 61 | + |
| 62 | +We want to fix all the issues as soon as possible, but before fixing a bug, we need to |
| 63 | +reproduce and confirm it. In order to reproduce bugs, we require that you provide a |
| 64 | +minimal reproduction. Having a minimal reproducible scenario gives us a wealth of |
| 65 | +important information without going back and forth to you with additional questions. |
| 66 | + |
| 67 | +A minimal reproduction allows us to quickly confirm a bug (or point out a coding problem) |
| 68 | +as well as confirm that we are fixing the right problem. |
| 69 | + |
| 70 | +We require a minimal reproduction to save maintainers' time and ultimately be able to |
| 71 | +fix more bugs. Often, developers find coding problems themselves while preparing a |
| 72 | +minimal reproduction. We understand that sometimes it might be hard to extract |
| 73 | +essential bits of code from a larger codebase, but we really need to isolate the problem |
| 74 | +before we can fix it. |
| 75 | + |
| 76 | +Unfortunately, we are not able to investigate / fix bugs without a minimal reproduction, |
| 77 | +so if we don't hear back from you, we are going to close an issue that doesn't have |
| 78 | +enough information to be reproduced. |
| 79 | + |
| 80 | + |
| 81 | +### Submitting a Pull Request (PR) |
| 82 | + |
| 83 | +Before you submit your Pull Request (PR) consider the following guidelines: |
| 84 | + |
| 85 | +1. Search [GitHub](../pulls) for an open or closed PR |
| 86 | + that relates to your submission. You don't want to duplicate existing efforts. |
| 87 | + |
| 88 | +2. Be sure that an issue describes the problem you're fixing, or documents the design |
| 89 | + for the feature you'd like to add. Discussing the design upfront helps to ensure that |
| 90 | + we're ready to accept your work. |
| 91 | + |
| 92 | +3. [Fork](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo) the repo. |
| 93 | + |
| 94 | +4. In your forked repository, make your changes in a new git branch: |
| 95 | + |
| 96 | + ```shell |
| 97 | + $ git checkout -b my-fix-branch main |
| 98 | + ``` |
| 99 | + |
| 100 | +5. Create your patch, **including appropriate test cases**. |
| 101 | + Remember to follow the [Coding Rules](#coding-rules). |
| 102 | + |
| 103 | +6. Run the full test suite, as described in the [developer documentation][dev-doc], |
| 104 | + and ensure that all tests pass. |
| 105 | + |
| 106 | +7. Commit your changes using a descriptive commit message. |
| 107 | + |
| 108 | + ```shell |
| 109 | + $ git commit --all |
| 110 | + ``` |
| 111 | + Note: the optional commit `-a` command line option will automatically "add" and "rm" edited files. |
| 112 | + |
| 113 | +8. Push your branch to GitHub: |
| 114 | + |
| 115 | + ```shell |
| 116 | + $ git push origin my-fix-branch |
| 117 | + ``` |
| 118 | + |
| 119 | +9. In GitHub, create a new pull request. |
| 120 | + |
| 121 | + |
| 122 | +#### Addressing review feedback |
| 123 | + |
| 124 | +If we ask for changes via code reviews then: |
| 125 | + |
| 126 | +1. Make the required updates to the code. |
| 127 | +2. Re-run the test suite to ensure tests are still passing. |
| 128 | +3. Create a fixup commit and push to your GitHub repository. Update your Pull Request: |
| 129 | + |
| 130 | + ```shell |
| 131 | + $ git commit --all --fixup HEAD |
| 132 | + $ git push |
| 133 | + ``` |
| 134 | + |
| 135 | + For more info on working with fixup commits see [here](docs/FIXUP_COMMITS.md). |
| 136 | + |
| 137 | +That's it! Thank you for your contribution! |
| 138 | +
|
| 139 | +
|
| 140 | +## Coding Rules |
| 141 | +
|
| 142 | +To ensure consistency throughout the source code, |
| 143 | +keep these rules in mind as you are working: |
| 144 | +
|
| 145 | +* All features or bug fixes **must be tested** by one or more specs (unit-tests). |
| 146 | +* All public API methods **must be documented**. |
| 147 | +* We follow [Black's style guide](https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html), |
| 148 | + and wrap all code at **120 characters**. |
| 149 | + Pre-configured tools to automatically lint and format code are available, see [DEVELOPER.md](DEVELOPER.md). |
0 commit comments