跳至内容

贡献者指南

要为ansible-dev-tools Python 包或其工具列表做出贡献,请使用您自己 fork 的分支上的拉取请求。

GitHub 上创建您的 fork 后,您可以执行以下操作

$ git clone --recursive git@github.com:your-name/developer-tool-name
$ cd developer-tool-name
$ git checkout -b your-branch-name
# DO SOME CODING HERE
$ git add your new files
$ git commit -v
$ git push origin your-branch-name

然后,您就可以从您的提交创建拉取请求。

先决条件

  1. 所有针对核心功能的修复(即文档或示例以外的任何内容)都应附带测试,这些测试在您更改之前失败,之后成功。

  2. 发送 PR 之前,请确保tox -e lint 通过。

如果您觉得无法贡献代码修复,请随时在仓库中提出问题。

容器测试

pytest 已扩展以方便测试容器。

Custom options:
  --container-engine=CONTAINER_ENGINE
                        Container engine to use. (default=ADT_CONTAINER_ENGINE, podman, docker, '')
  --container-name=CONTAINER_NAME
                        Container name to use for the running container. (default=ADT_CONTAINER_NAME)
  --image-name=IMAGE_NAME
                        Container name to use. (default=ADT_IMAGE_NAME)
  --only-container      Only run container tests
  --include-container   Include container tests

可以使用以下任一命令运行容器测试

# Run the tests against the default container engine
pytest --only-container
pytest --only-container --container-engine=<ce> --image-name <image>
tox -e test-image
tox -e test-image -- --container-engine=<ce> --image-name <image>

请参阅tests/integration/test_container.py以了解示例。

Devspaces 容器的手动测试

目前,CI 不会测试 devspaces 容器,因此在合并任何更改之前手动测试它非常重要。

联系我们

可能的安全性漏洞应通过电子邮件报告给security@ansible.com

有关通信的更多信息,请参阅Ansible 通信指南

行为准则

请参阅官方的Ansible 社区行为准则