我们很乐意接受有助于改进 MongoDB Kafka Connector 的贡献。 我们指南社区贡献,确保它们符合代码库标准。请确保您的拉取请求符合以下条件:
包括描述功能的文档注释
包括涵盖功能特性的单元测试
传递 Gradle
check任务,其中包括以下任务:test任务integrationTest任务spotlessCheck任务
要开始使用,请查看源代码并通过在 shell 中运行以下命令来创建分支:
git clone https://github.com/mongodb/mongo-kafka.git cd mongo-kafka git checkout -b <your branch name>
将更改推送到功能分支后,请确保其通过 Gradle 检查。 您可以使用以下命令运行检查:
./gradlew clean check --continue -Dorg.mongodb.test.uri=<your local mongodb replica set connection uri>
重要
集成测试
You must have a local MongoDB replica set running to perform Gradle integration tests. To learn how to set up a MongoDB replica set, see Deploy a Replica Set in the MongoDB manual.
注意
跳过测试
您可以跳过integrationTest任务中与以下领域相关的测试,除非您的代码专门修改了与这些领域相关的connector行为:
特定版本的 MongoDB
身份验证
You can run the authentication tests by enabling authentication in your local MongoDB replica set and specifying your credentials in your connection URI. To learn how to enable authentication in a replica set, see Deploy Replica Set With Keyfile Authentication in the MongoDB manual.
您可以通过部署具有特定 MongoDB 版本的本地副本集来运行该版本的 MongoDB。
要学习;了解有关Connector源代码的更多信息,请参阅Github存储库。
要学习;了解有关 Gradle 的更多信息,请参阅 Gradle 官方网站。