Skip to content

Commit 3f8ced6

Browse files
committed
Add contribution guide
1 parent 0c964af commit 3f8ced6

File tree

2 files changed

+161
-0
lines changed

2 files changed

+161
-0
lines changed

CONTRIBUTING.rst

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
Contributing
2+
============
3+
4+
Thank you for your interest in contributing.
5+
6+
This document is a guideline. Don't worry about getting everything perfect.
7+
We are happy to work with you on your contribution.
8+
9+
`Upvoting existing issues <#upvoting-issues>`_, `reporting new issues
10+
<#reporting-issues>`_, or `giving feedback <#tell-us-about-your-experience>`_
11+
about your experience are the easiest ways to contribute.
12+
13+
We also accept pull requests for changes to the code and to the documentation.
14+
For more information on how to do this, read our `developer guide`_.
15+
16+
If you have any questions, please reach out via any of our `support channels`_.
17+
18+
19+
Upvoting Issues
20+
---------------
21+
22+
An easy way to contribute is to upvote existing issues that are relevant to
23+
you. This will give us a better idea what is important for you and other users.
24+
25+
Please avoid content-less ``+1`` comments but instead use the emoji reaction to
26+
upvote with a 👍. This allows people to `sort issues by reaction`_ and doesn't
27+
spam the maintainers.
28+
29+
30+
Reporting Issues
31+
----------------
32+
33+
Before you report an issue, please `search the existing issues`_ to make sure
34+
someone hasn't already reported it.
35+
36+
When reporting a new issue, include as much detail as possible. Please include:
37+
38+
- What you did, what happened, and what you expected to happen
39+
40+
- Steps to reproduce the issue
41+
42+
- Which CrateDB Kubernetes Operator version you're using
43+
44+
- Which Kubernetes version you're using
45+
46+
- Logs or stacktraces
47+
48+
- For example, operator can be started with an environment variable
49+
``CRATEDB_OPERATOR_LOG_LEVEL=DEBUG`` to get a full list of its interactions
50+
with Kubernetes.
51+
52+
53+
Tell us about your experience
54+
=============================
55+
56+
You don't have to create a detailed bug report or request a new feature to make
57+
a valuable contribution. Giving us feedback about your experience with the
58+
CrateDB Kubernetes Operator is incredibly valuable as well. Please `get in
59+
touch`_ with us to tell us what you like and don't like about it.
60+
61+
62+
.. _developer guide: docs/source/development.rst
63+
.. _support channels: https://crate.io/support/
64+
.. _sort issues by reaction: https://github.com/crate/crate-operator/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc
65+
.. _search the existing issues: https://github.com/crate/crate-operator/issues
66+
.. _get in touch: https://crate.io/contact/

docs/source/development.rst

+95
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,30 @@
11
Working on the operator
22
=======================
33

4+
Contributing
5+
------------
6+
7+
Before we can accept any pull requests, we need you to agree to our CLA_.
8+
9+
Once that is complete, you should:
10+
11+
- Create an issue on GitHub to let us know that you're working on the issue.
12+
13+
- Use a feature branch and not ``master``.
14+
15+
- Rebase your feature branch onto the upstream ``master`` before creating the
16+
pull request.
17+
18+
- `Be descriptive in your PR and commit messages
19+
<#meaningful-commit-messages>`_. What is it for? Why is it needed? And so on.
20+
21+
- If applicable, `run the tests <#testing>`_.
22+
23+
- Squash related commits.
24+
25+
26+
.. _testing:
27+
428
Testing
529
-------
630

@@ -88,5 +112,76 @@ For the following steps we assume the next version is going to be ``$VERSION``.
88112
$ git pull
89113
$ ./devtools/create_tag.sh "$VERSION"
90114
115+
116+
General Tips
117+
------------
118+
119+
.. _commit-message-style:
120+
121+
Meaningful Commit Messages
122+
^^^^^^^^^^^^^^^^^^^^^^^^^^
123+
124+
Please choose a meaningful commit message. The commit message is not only
125+
valuable during the review process, but can be helpful for reasoning about any
126+
changes in the code base. For example, PyCharm's "Annotate" feature, brings up
127+
the commits which introduced the code in a source file. Without meaningful
128+
commit messages, the commit history does not provide any valuable information.
129+
130+
The first line of the commit message (also known as "subject line") should
131+
contain a summary of the changes. Please use the imperative mood. The subject
132+
can be prefixed with "Test: " or "Docs: " to indicate the changes are not
133+
primarily to the main code base. For example::
134+
135+
Put a timeout on all bootstrap operations
136+
Test: Increase bootstrap timeout in tests
137+
Docs: Copyedit docs on configuration options
138+
139+
See also: https://chris.beams.io/posts/git-commit/
140+
141+
Updating Your Branch
142+
^^^^^^^^^^^^^^^^^^^^
143+
144+
If new commits have been added to the upstream ``master`` branch since you
145+
created your feature branch, please do not merge them in to your branch.
146+
Instead, rebase your branch::
147+
148+
$ git fetch upstream
149+
$ git rebase upstream/master
150+
151+
This will apply all commits on your feature branch on top of the upstream
152+
``master`` branch. If there are conflicts, they can be resolved with ``git
153+
merge``. After the conflict has been resolved, use ``git rebase --continue`` to
154+
continue the rebase process.
155+
156+
Squashing Minor Commits
157+
^^^^^^^^^^^^^^^^^^^^^^^
158+
159+
Minor commits that only fix typos or rename variables that are related to a
160+
bigger change should be squashed into that commit.
161+
162+
This can be done with the following command::
163+
164+
$ git rebase -i origin/master
165+
166+
This will open up a text editor where you can annotate your commits.
167+
168+
Generally, you'll want to leave the first commit listed as ``pick``, or change
169+
it to ``reword`` (or ``r`` for short) if you want to change the commit message.
170+
And then, if you want to squash every subsequent commit, you could mark them
171+
all as ``fixup`` (or ``f`` for short).
172+
173+
Once you're done, you can check that it worked by running::
174+
175+
$ git log
176+
177+
If you're happy with the result, do a **force** push (since you're rewriting
178+
history) to your feature branch::
179+
180+
$ git push -f
181+
182+
183+
See also: http://www.ericbmerritt.com/2011/09/21/commit-hygiene-and-git.html
184+
185+
.. _CLA: https://crate.io/community/contribute/agreements/
91186
.. _setuptools-scm: https://pypi.org/project/setuptools-scm/
92187
.. _Semantic Versioning: https://semver.org/

0 commit comments

Comments
 (0)