![Sebastian](/assets/img/avatar_default.png)
* contributing: make expected behavior clearer reformulate the preference of not having squashed commits clearer, shorter and more precise. https://github.com/ansible-collections/community.general/pull/3164#discussion_r684644504 * Update CONTRIBUTING.md Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
5.9 KiB
Contributing
We follow Ansible Code of Conduct in all our contributions and interactions within this repository.
If you are a committer, also refer to the collection's committer guidelines.
Issue tracker
Whether you are looking for an opportunity to contribute or you found a bug and already know how to solve it, please go to the issue tracker. There you can find feature ideas to implement, reports about bugs to solve, or submit an issue to discuss your idea before implementing it which can help choose a right direction at the beginning of your work and potentially save a lot of time and effort. Also somebody may already have started discussing or working on implementing the same or a similar idea, so you can cooperate to create a better solution together.
- If you are interested in starting with an easy issue, look for issues with an
easyfix
label. - Often issues that are waiting for contributors to pick up have the
waiting_on_contributor
label.
Open pull requests
Look through currently open pull requests. You can help by reviewing them. Reviews help move pull requests to merge state. Some good pull requests cannot be merged only due to a lack of reviews. And it is always worth saying that good reviews are often more valuable than pull requests themselves. Note that reviewing does not only mean code review, but also offering comments on new interfaces added to existing plugins/modules, interfaces of new plugins/modules, improving language (not everyone is a native english speaker), or testing bugfixes and new features!
Also, consider taking up a valuable, reviewed, but abandoned pull request which you could politely ask the original authors to complete yourself.
- Try committing your changes with an informative but short commit message.
- Do not squash your commits and force-push to your branch if not needed. Reviews of your pull request are much easier with individual commits to comprehend the pull request history. All commits of your pull request branch will be squashed into one commit by GitHub upon merge.
- Do not add merge commits to your PR. The bot will complain and you will have to rebase (instructions for rebasing) to remove them before your PR can be merged. To avoid that git automatically does merges during pulls, you can configure it to do rebases instead by running
git config pull.rebase true
inside the respository checkout. - Make sure your PR includes a changelog fragment. (You must not include a fragment for new modules or new plugins, except for test and filter plugins. Also you shouldn't include one for docs-only changes. If you're not sure, simply don't include one, we'll tell you whether one is needed or not :) )
You can also read our Quick-start development guide.
Test pull requests
If you want to test a PR locally, refer to our testing guide for instructions on how do it quickly.
If you find any inconsistencies or places in this document which can be improved, feel free to raise an issue or pull request to fix it.
Creating new modules or plugins
Creating new modules and plugins requires a bit more work than other Pull Requests.
-
Please make sure that your new module or plugin is of interest to a larger audience. Very specialized modules or plugins that can only be used by very few people should better be added to more specialized collections.
-
When creating a new module or plugin, please make sure that you follow various guidelines:
- Follow development conventions;
- Follow documentation standards and the Ansible style guide;
- Make sure your modules and plugins are GPL-3.0-or-later licensed (new module_utils can also be BSD-2-clause licensed);
- Make sure that new plugins and modules have tests (unit tests, integration tests, or both); it is preferable to have some tests which run in CI.
-
For modules and action plugins, make sure to create your module/plugin in the correct subdirectory, and create a symbolic link from
plugins/modules/
respectivelyplugins/action/
to the actual module/plugin code. (Other plugin types should not use subdirectories.)- Action plugins need to be accompanied by a module, even if the module file only contains documentation
(
DOCUMENTATION
,EXAMPLES
andRETURN
). The module must have the same name and directory path inplugins/modules/
than the action plugin has inplugins/action/
.
- Action plugins need to be accompanied by a module, even if the module file only contains documentation
(
-
Make sure to add a BOTMETA entry for your new module/plugin in
.github/BOTMETA.yml
. Search for other plugins/modules in the same directory to see how entries could look. You should list all authors either asmaintainers
or underignore
. People listed asmaintainers
will be pinged for new issues and PRs that modify the module/plugin or its tests.When you add a new plugin/module, we expect that you perform maintainer duty for at least some time after contributing it.