第15章 贡献指南
想为 Patroni 做出贡献吗?是的 - 这就是方法!
15.1互动
只想与其他 Patroni 用户聊天?正在寻找交互式故障排除帮助?在[PostgreSQL Slack](https://postgres-slack.herokuapp.com/)频道#patroni 上加入我们。
15.2运行测试
运行行为测试的要求:
1. 需要安装 PostgreSQL 包。
2. PostgreSQL 二进制文件必须在您的PATH 中可用。您可能需要使用类似PATH=/usr/lib/postgresql/11/bin:$PATH python -m 行为的内容将它们添加到路径中。
3. 如果您想使用外部 DCS(例如 Etcd、Consul 和 Zookeeper)进行测试,您将需要安装软件包和运行相应的服务,并在 localhost 和默认端口上接受未加密/未受保护的连接。在 Etcd 或 Consul 的情况下,如果二进制文件在PATH中可用,行为测试套件可以启动它们。
安装依赖:
# You may want to use Virtualenv or specify pip3.
pip install -r requirements.txt
pip install -r requirements.dev.txt

安装所有依赖项后,您可以运行各种测试套件:
# You may want to use Virtualenv or specify python3.
# Run flake8 to check syntax and formatting:
python setup.py flake8
# Run the pytest suite in tests/:
python setup.py test
# Run the behave (https://behave.readthedocs.io/en/latest/) test suite in features/;
# modify DCS as desired (raft has no dependencies so is the easiest to start with):
DCS=raft python -m behave

15.3 报告问题
如果您有关于patroni的问题或在使用它时遇到问题,请在提交问题之前阅读[自述](https://patroni.readthedocs.io/en/latest/README.html#readme)文件。还要仔细检查我们的[问题跟踪器](https://github.com/zalando/patroni/issues)上的当前问题。
15.4 贡献拉取请求
1. 提交对相关问题的评论或创建一个描述您提议的更改的新问题。
2. 做一个 fork,开发和测试你的代码更改。
3. 包括文档
4. 提交拉取请求。
您将尽快获得有关您的拉取请求的反馈。
快乐的 Patroni 黑客 ;-)