Skip to content

Commit c30a6ed

Browse files
authoredMay 25, 2022
MINOR: Contribution guidelines for developers (#221)
* MINOR: Contribution guidelines for developers * MINOR: Update README.md to include link to contribution guidelines
1 parent 1b29e67 commit c30a6ed

File tree

2 files changed

+189
-0
lines changed

2 files changed

+189
-0
lines changed
 

‎CONTRIBUTING.md

+188
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
# Contributing
2+
3+
In order for us to consider merging a contribution, you will need to sign our
4+
**C**ontributor **L**icense **A**greement.
5+
6+
> The purpose of a CLA is to ensure that the guardian of a project's outputs has the necessary ownership or grants of rights over all contributions to allow them to distribute under the chosen licence.
7+
> [Wikipedia](http://en.wikipedia.org/wiki/Contributor_License_Agreement)
8+
9+
You can read and sign our full Contributor License Agreement [here](http://clabot.confluent.io/cla).
10+
11+
## Reporting Bugs and Issues
12+
13+
Report bugs and issues by creating a new GitHub issue. Prior to creating an issue, please search
14+
through existing issues so that you are not creating duplicate ones. If a pull request exists that
15+
corresponds to the issue, mention this pull request on the GitHub issue.
16+
17+
## Guidelines for Contributing Code, Examples, Documentation
18+
19+
Code changes are submitted via a pull request (PR). When submitting a PR use the following
20+
guidelines:
21+
22+
* Follow the style guide below
23+
* Add/update documentation appropriately for the change you are making.
24+
* Non-trivial changes should include unit tests covering the new functionality and potentially integration tests.
25+
* Bug fixes should include unit tests and/or integration tests proving the issue is fixed.
26+
* Try to keep pull requests short and submit separate ones for unrelated features.
27+
* Keep formatting changes in separate commits to make code reviews easier and distinguish them from actual code changes.
28+
29+
### Code Style
30+
This connector repository is using a coding style that generally follows the [Google Java coding standard guide](https://google.github.io/styleguide/javaguide.html).
31+
32+
Some conventions worth mentioning are:
33+
34+
* Indentation (single tab) is 2 spaces.
35+
* All import statements are listed explicitly. The wildcard (*) is not used in imports.
36+
* Imports are groups as follows:
37+
```
38+
import all packages not listed below (all other imports)
39+
<blank line>
40+
import all javax.* packages
41+
import all java.* packages
42+
<blank line>
43+
import all io.confluent.* packages
44+
<blank line>
45+
import static packages
46+
```
47+
* Javadoc is highly recommended and often required during reviews in interfaces and public or protected classes and methods.
48+
49+
### Titles and changelogs
50+
51+
The title of a pull request is used as an entry on the release notes (aka changelogs) of the
52+
connector in every release.
53+
54+
For this reason, please use a brief but descriptive title for your pull request. If GitHub shortens
55+
your pull request title when you issue the pull request adding the excessive part to the pull
56+
request description, make sure that you correct the title before or after you issue the pull
57+
request.
58+
59+
If the fix is a minor fix you are encouraged to use the tag `MINOR:` followed by your pull request
60+
title. You may link the corresponding issue to the description of your pull request but adding it to
61+
the title will not be useful during changelog generation.
62+
63+
When reverting a previous commit, use the prefix `Revert ` on the pull request title (automatically
64+
added by GitHub when a pull request is created to revert an existing commit).
65+
66+
### Tests
67+
Every pull request should contain a sufficient amount of tests that assess your suggested code
68+
changes. It’s highly recommended that you also check the code coverage of the production code you
69+
are adding to make sure that your changes are covered sufficiently by the test code.
70+
71+
### Description
72+
Including a good description when you issue your pull requests helps significantly with reviews.
73+
Feel free to follow the template that is when issuing a pull request and mention how your changes
74+
are tested.
75+
76+
### Backporting Commits
77+
If your code changes are essentially bug fixes that make sense to backport to existing releases make sure to target the earliest release branch (e.g. 2.0.x) that should contain your changes. When selecting the release branch you should also consider how easy it will be to resolve any conflicts in newer release branches, including the `master` branch.
78+
79+
## Github Workflow
80+
81+
1. Fork the connector repository into your GitHub account: https://github.com/confluentinc/kafka-connect-storage-common/fork
82+
83+
2. Clone your fork of the GitHub repository, replacing `<username>` with your GitHub username.
84+
85+
Use ssh (recommended):
86+
87+
```bash
88+
git clone git@github.com:<username>/kafka-connect-storage-common.git
89+
```
90+
91+
Or https:
92+
93+
```bash
94+
git clone https://github.com/<username>/kafka-connect-storage-common.git
95+
```
96+
97+
3. Add a remote to keep up with upstream changes.
98+
99+
```bash
100+
git remote add upstream https://github.com/confluentinc/kafka-connect-storage-common.git
101+
```
102+
103+
If you already have a copy, fetch upstream changes.
104+
105+
```bash
106+
git fetch upstream
107+
```
108+
109+
or
110+
111+
```bash
112+
git remote update
113+
```
114+
115+
4. Create a feature branch to work in.
116+
117+
```bash
118+
git checkout -b feature-xyz upstream/master
119+
```
120+
121+
5. Work in your feature branch.
122+
123+
```bash
124+
git commit -a --verbose
125+
```
126+
127+
6. Periodically rebase your changes
128+
129+
```bash
130+
git pull --rebase
131+
```
132+
133+
7. When done, combine ("squash") related commits into a single one
134+
135+
```bash
136+
git rebase -i upstream/master
137+
```
138+
139+
This will open your editor and allow you to re-order commits and merge them:
140+
- Re-order the lines to change commit order (to the extent possible without creating conflicts)
141+
- Prefix commits using `s` (squash) or `f` (fixup) to merge extraneous commits.
142+
143+
8. Submit a pull-request
144+
145+
```bash
146+
git push origin feature-xyz
147+
```
148+
149+
Go to your fork main page
150+
151+
```bash
152+
https://github.com/<username>/kafka-connect-storage-common.git
153+
```
154+
155+
If you recently pushed your changes GitHub will automatically pop up a `Compare & pull request`
156+
button for any branches you recently pushed to. If you click that button it will automatically
157+
offer you to submit your pull-request to the `confluentinc` connector repository.
158+
159+
- Give your pull-request a meaningful title as described [above](#titles-and-changelogs).
160+
- In the description, explain your changes and the problem they are solving.
161+
162+
9. Addressing code review comments
163+
164+
Repeat steps 5. through 7. to address any code review comments and rebase your changes if necessary.
165+
166+
Push your updated changes to update the pull request
167+
168+
```bash
169+
git push origin [--force] feature-xyz
170+
```
171+
172+
`--force` may be necessary to overwrite your existing pull request in case your
173+
commit history was changed when performing the rebase.
174+
175+
Note: Be careful when using `--force` since you may lose data if you are not careful.
176+
177+
```bash
178+
git push origin --force feature-xyz
179+
```
180+
181+
## Useful Resources for Developers
182+
183+
1. Connector Developer Guide: https://docs.confluent.io/platform/current/connect/devguide.html
184+
2. A Guide to the Confluent Verified Integrations Program: https://www.confluent.io/blog/guide-to-confluent-verified-integrations-program/
185+
3. Verification Guide for Confluent Platform Integrations: https://cdn.confluent.io/wp-content/uploads/Verification-Guide-Confluent-Platform-Connectors-Integrations.pdf
186+
4. From Zero to Hero with Kafka Connect: https://www.confluent.io/kafka-summit-lon19/from-zero-to-hero-with-kafka-connect/
187+
5. 4 Steps to Creating Apache Kafka Connectors with the Kafka Connect API: https://www.confluent.io/blog/create-dynamic-kafka-connect-source-connectors/
188+
6. How to Write a Connector for Kafka Connect – Deep Dive into Configuration Handling: https://www.confluent.io/blog/write-a-kafka-connect-connector-with-configuration-handling/

‎README.md

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ To build a development version you'll need a recent version of Kafka. You can bu
1313

1414
- Source Code: https://github.com/confluentinc/kafka-connect-storage-common
1515
- Issue Tracker: https://github.com/confluentinc/kafka-connect-storage-common/issues
16+
- Learn how to work with the connector's source code by reading our [Development and Contribution guidelines](CONTRIBUTING.md).
1617

1718

1819
# License

0 commit comments

Comments
 (0)
Please sign in to comment.