|
| 1 | +# Contributing to the Project |
| 2 | + |
| 3 | +Thank you for your interest in contributing to this project |
| 4 | + |
| 5 | +## Table of Contents |
| 6 | + |
| 7 | +* [Code Of Conduct](#code-of-conduct) |
| 8 | +* [How to Contribute](#how-to-contribute) |
| 9 | + * [Discuss](#discuss) |
| 10 | + * [Create an Issue](#create-an-issue) |
| 11 | + * [Submit a Pull Request](#submit-a-pull-request) |
| 12 | + * [Report on Flaky Tests](#report-on-flaky-tests) |
| 13 | +* [Etiquette for pull requests](#etiquette-for-pull-requests) |
| 14 | +* [Contact Us](#contact-us) |
| 15 | + |
| 16 | +## Code Of Conduct |
| 17 | + |
| 18 | +See the [Code Of Conduct](CODE_OF_CONDUCT.md). |
| 19 | + |
| 20 | +## How to Contribute |
| 21 | + |
| 22 | +### Discuss |
| 23 | + |
| 24 | +If you want to share an idea to further enhance the project or discuss potential use cases, please feel free to create a |
| 25 | +discussion at the `GitHub Discussions page`] |
| 26 | +If you feel there is a bug or an issue, contribute to the discussions in `existing issues` |
| 27 | +otherwise [create a new issue](#create-an-issue). |
| 28 | + |
| 29 | +### Create an Issue |
| 30 | + |
| 31 | +If you have identified a bug or want to formulate a working item that you want to concentrate on, feel free to create a |
| 32 | +new issue at our project's corresponding `GitHub Issues page`. Before doing so, please consider searching for |
| 33 | +potentially suitable `existing issues`. |
| 34 | + |
| 35 | +We also |
| 36 | +use [GitHub's default label set](https://docs.github.com/en/issues/using-labels-and-milestones-to-track-work/managing-labels) |
| 37 | +extended by custom ones to classify issues and improve findability. |
| 38 | + |
| 39 | +If an issue appears to cover changes that will have a (huge) impact on the code base and needs to |
| 40 | +first be discussed, or if you just have a question regarding the usage of the software, please |
| 41 | +create a `discussion` before raising an issue. |
| 42 | + |
| 43 | +Please note that if an issue covers a topic or the response to a question that may be interesting |
| 44 | +for other developers or contributors, or for further discussions, it should be converted to a |
| 45 | +discussion and not be closed. |
| 46 | + |
| 47 | +### Adhere to Coding Style Guide |
| 48 | + |
| 49 | +We aim for a coherent and consistent code base, thus the coding style detailed in the [styleguide](STYLEGUIDE.md) should |
| 50 | +be followed. |
| 51 | + |
| 52 | +### Submit a Pull Request |
| 53 | + |
| 54 | +We would appreciate if your pull request applies to the following points: |
| 55 | + |
| 56 | +* Conform to following [Etiquette for pull requests](#etiquette-for-pull-requests): |
| 57 | + |
| 58 | +* Make sure to adjust copyright headers appropriately. |
| 59 | + |
| 60 | +* The git commit messages should comply to the following format: |
| 61 | + ``` |
| 62 | + <prefix>(<scope>): <description> |
| 63 | + ``` |
| 64 | +
|
| 65 | + Use the [imperative mood](https://github.com/git/git/blob/master/Documentation/SubmittingPatches) |
| 66 | + as in "Fix bug" or "Add feature" rather than "Fixed bug" or "Added feature" and |
| 67 | + [mention the GitHub issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) |
| 68 | + e.g. `chore(transfer process): improve logging`. |
| 69 | +
|
| 70 | +* Add meaningful tests to verify your submission acts as expected. |
| 71 | +
|
| 72 | +* Where code is not self-explanatory, add documentation providing extra clarification. |
| 73 | +
|
| 74 | +* PR descriptions should use the current [PR template](.github/PULL_REQUEST_TEMPLATE.md) |
| 75 | +
|
| 76 | +* Submit a draft pull request at early-stage and add people previously working on the same code as |
| 77 | + reviewer. Make sure automatic checks pass before marking it as "ready for review": |
| 78 | +
|
| 79 | + * _Continuous Integration_ performing various test conventions. |
| 80 | +
|
| 81 | +### Report on Flaky Tests |
| 82 | +
|
| 83 | +If you discover a randomly failing ("flaky") test, please take the time to check whether an issue for that already |
| 84 | +exists and if not, create an issue yourself, providing meaningful description and a link to the failing run. Please also |
| 85 | +label it with `Bug` and `github`. Then assign it to whoever was the original author of the relevant piece of code or |
| 86 | +whoever worked on it last. If assigning the issue is not possible due to missing rights, please just comment and |
| 87 | +@mention the author/last editor. |
| 88 | +
|
| 89 | +Please do not just restart the run, as this would overwrite the results. If you need to, a better way of doing this is |
| 90 | +to push an empty commit. This will trigger another run. |
| 91 | +
|
| 92 | +```bash |
| 93 | +git commit --allow-empty -m "trigger CI" && git push |
| 94 | +``` |
| 95 | + |
| 96 | +If an issue labeled with `Bug` and `github` is assigned to you, please prioritize addressing this issue as other |
| 97 | +people will be affected. |
| 98 | +We are taking the quality of our code very serious and reporting on flaky tests is an important step toward improvement |
| 99 | +in that area. |
| 100 | + |
| 101 | +## Etiquette for pull requests |
| 102 | + |
| 103 | +### As an author |
| 104 | + |
| 105 | +Submitting pull requests should be done while adhering to a couple of simple rules. |
| 106 | + |
| 107 | +- Familiarize yourself with [coding style](STYLEGUIDE.md), architectural patterns and other contribution guidelines. |
| 108 | +- No surprise PRs please. Before you submit a PR, open a discussion or an issue outlining your planned work and give |
| 109 | + people time to comment. It may even be advisable to contact committers using the `@mention` feature. Unsolicited PRs |
| 110 | + may get ignored or rejected. |
| 111 | +- Create focused PRs: your work should be focused on one particular feature or bug. Do not create broad-scoped PRs that |
| 112 | + solve multiple issues as reviewers may reject those PR bombs outright. |
| 113 | +- Provide a clear description and motivation in the PR description in GitHub. This makes the reviewer's life much |
| 114 | + easier. It is also helpful to outline the broad changes that were made, e.g. "Changes the schema of XYZ-Entity: |
| 115 | + the `age` field changed from `long` to `String`". |
| 116 | +- If you introduce new 3rd party dependencies, be sure to note them in the PR description and explain why they are |
| 117 | + necessary. |
| 118 | +- Stick to the established code style, please refer to the [styleguide document](STYLEGUIDE.md). |
| 119 | +- All tests should be green, especially when your PR is in `"Ready for review"` |
| 120 | +- Mark PRs as `"Ready for review"` only when you're prepared to defend your work. By that time you have completed your |
| 121 | + work and shouldn't need to push any more commits other than to incorporate review comments. |
| 122 | +- Merge conflicts should be resolved by squashing all commits on the PR branch, rebasing onto `main` and |
| 123 | + force-pushing. Do this when your PR is ready to review. |
| 124 | +- If you require a reviewer's input while it's still in draft, please contact the designated reviewer using |
| 125 | + the `@mention` feature and let them know what you'd like them to look at. |
| 126 | +- Re-request reviews after all remarks have been adopted. This helps reviewers track their work in GitHub. |
| 127 | +- If you disagree with a committer's remarks, feel free to object and argue, but if no agreement is reached, you'll have |
| 128 | + to either accept the decision or withdraw your PR. |
| 129 | +- Be civil and objective. No foul language, insulting or otherwise abusive language will be tolerated. |
| 130 | +- The PR titles must follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/). |
| 131 | + - The title must follow the format as `<type>(<optional scope>): <description>`. |
| 132 | + `build`, `chore`, `ci`, `docs`, `feat`, `fix`, `perf`, `refactor`, `revert`, `style`, `test` are allowed for |
| 133 | + the `<type>`. |
| 134 | + - The length must be kept under 80 characters. |
| 135 | + |
| 136 | +### As a reviewer |
| 137 | + |
| 138 | +- Have a look at [Pull Request Review Pyramide](https://www.morling.dev/blog/the-code-review-pyramid/) |
| 139 | +- Please complete reviews within two business days or delegate to another committer, removing yourself as a reviewer. |
| 140 | +- If you have been requested as reviewer, but cannot do the review for any reason (time, lack of knowledge in particular |
| 141 | + area, etc.) please comment that in the PR and remove yourself as a reviewer, suggesting a stand-in. |
| 142 | +- Don't be overly pedantic. |
| 143 | +- Don't argue basic principles (code style, architectural decisions, etc.) |
| 144 | +- Use the `suggestion` feature of GitHub for small/simple changes. |
| 145 | +- The following could serve you as a review checklist: |
| 146 | + - no unnecessary dependencies in `build.gradle.kts` |
| 147 | + - sensible unit tests, prefer unit tests over integration tests wherever possible (test runtime). Also check the |
| 148 | + usage of test tags. |
| 149 | + - code style |
| 150 | + - simplicity and "uncluttered-ness" of the code |
| 151 | + - overall focus of the PR |
| 152 | +- Don't just wave through any PR. Please take the time to look at them carefully. |
| 153 | +- Be civil and objective. No foul language, insulting or otherwise abusive language will be tolerated. The goal is to |
| 154 | + _encourage_ contributions. |
| 155 | + |
| 156 | +## Contact Us |
| 157 | + |
| 158 | +If you have questions or suggestions, do not hesitate to contact the project developers via https://github.com/sovity. |
| 159 | + |
| 160 | +## Attribution |
| 161 | + |
| 162 | +This file is adapted from the [eclipse-edc](https://github.com/eclipse-dataspaceconnector/DataSpaceConnector) project. |
0 commit comments