|
| 1 | +# How to contribute |
| 2 | + |
| 3 | +operator-lib is Apache 2.0 licensed and accepts contributions via |
| 4 | +GitHub pull requests. This document outlines some of the conventions |
| 5 | +on commit message formatting, contact points for developers, and |
| 6 | +other resources to help get contributions into operator-lib. |
| 7 | + |
| 8 | +# Email and Chat |
| 9 | + |
| 10 | +- Email: [operator-framework][operator_framework] |
| 11 | +- Slack: [#operator-sdk-dev][operator-sdk-dev] |
| 12 | + |
| 13 | +## Getting started |
| 14 | + |
| 15 | +- Fork the repository on GitHub |
| 16 | +- Test your code using `make test` |
| 17 | +- Check the linter with `make lint` |
| 18 | +- For more information what targets are available run `make help` |
| 19 | + |
| 20 | +## Reporting bugs and creating issues |
| 21 | + |
| 22 | +Reporting bugs is one of the best ways to contribute. If any part of the |
| 23 | +operator-lib project has bugs, please let us know by |
| 24 | +[opening an issue][reporting-issues]. |
| 25 | + |
| 26 | +To make the bug report accurate and easy to understand, please try to create bug |
| 27 | +reports that are: |
| 28 | + |
| 29 | +* Specific. Include as much details as possible: which version, what |
| 30 | + environment, what configuration, etc. |
| 31 | +* Reproducible. Include the steps to reproduce the problem. |
| 32 | +* Unique. Do not duplicate existing bug reports. |
| 33 | +* Scoped. One bug per report. Do not follow up with another bug inside one |
| 34 | + report. |
| 35 | + |
| 36 | +## Contribution flow |
| 37 | + |
| 38 | +This is a rough outline of what a contributor's workflow looks like: |
| 39 | + |
| 40 | +- Create a topic branch from where to base the contribution. This is usually |
| 41 | + `main`. |
| 42 | +- Make commits of logical units. |
| 43 | +- Make sure commit messages are in the proper format (see below). |
| 44 | +- Push changes in a topic branch to a personal fork of the repository. |
| 45 | +- Submit a pull request to operator-framework/operator-lib. |
| 46 | +- The PR must receive a LGTM from two maintainers found in the OWNERS file. |
| 47 | + |
| 48 | +Thanks for contributing! |
| 49 | + |
| 50 | +### Code style |
| 51 | + |
| 52 | +The coding style suggested by the Golang community is used in operator-lib. |
| 53 | +See the [style doc][golang-style-doc] for details. |
| 54 | + |
| 55 | +Please follow this style to make operator-lib easy to review, maintain and develop. |
| 56 | + |
| 57 | +### Format of the commit message |
| 58 | + |
| 59 | +We follow a rough convention for commit messages that is designed to answer two |
| 60 | +questions: what changed and why. The subject line should feature the what and |
| 61 | +the body of the commit should describe the why. |
| 62 | + |
| 63 | +``` |
| 64 | +add the test-cluster command |
| 65 | +
|
| 66 | +this uses tmux to setup a test cluster that can easily be killed and started for debugging. |
| 67 | +
|
| 68 | +Fixes #38 |
| 69 | +``` |
| 70 | + |
| 71 | +The format can be described more formally as follows: |
| 72 | + |
| 73 | +``` |
| 74 | +<what changed> |
| 75 | +<BLANK LINE> |
| 76 | +<why this change was made> |
| 77 | +<BLANK LINE> |
| 78 | +<footer> |
| 79 | +``` |
| 80 | + |
| 81 | +The first line is the subject and should be no longer than 70 characters, the second line is always blank, and other lines should be wrapped at 80 characters. This allows the message to be easier to read on GitHub as well as in various git tools. |
| 82 | + |
| 83 | +## Documentation |
| 84 | + |
| 85 | +If the contribution changes the existing APIs or user interface it must include sufficient documentation to explain the use of the new or updated feature. |
| 86 | + |
| 87 | +[operator_framework]: https://groups.google.com/forum/#!forum/operator-framework |
| 88 | +[reporting-issues]: https://github.com/operator-framework/operator-lib/issues/new |
| 89 | +[golang-style-doc]: https://github.com/golang/go/wiki/CodeReviewComments |
| 90 | +[operator-sdk-dev]: https://kubernetes.slack.com/archives/C017UU45SHL |
0 commit comments