1# How to contribute
2
3etcd is Apache 2.0 licensed and accepts contributions via GitHub pull requests. This document outlines some of the conventions on commit message formatting, contact points for developers, and other resources to help get contributions into etcd.
4
5# Email and chat
6
7- Email: [etcd-dev](https://groups.google.com/forum/?hl=en#!forum/etcd-dev)
8- IRC: #[etcd](irc://irc.freenode.org:6667/#etcd) IRC channel on freenode.org
9
10## Getting started
11
12- Fork the repository on GitHub
13- Read the README.md for build instructions
14
15## Reporting bugs and creating issues
16
17Reporting bugs is one of the best ways to contribute. However, a good bug report has some very specific qualities, so please read over our short document on [reporting bugs](https://github.com/etcd-io/etcd/blob/master/Documentation/reporting_bugs.md) before submitting a bug report. This document might contain links to known issues, another good reason to take a look there before reporting a bug.
18
19## Contribution flow
20
21This is a rough outline of what a contributor's workflow looks like:
22
23- Create a topic branch from where to base the contribution. This is usually master.
24- Make commits of logical units.
25- Make sure commit messages are in the proper format (see below).
26- Push changes in a topic branch to a personal fork of the repository.
27- Submit a pull request to etcd-io/etcd.
28- The PR must receive a LGTM from two maintainers found in the MAINTAINERS file.
29
30Thanks for contributing!
31
32### Code style
33
34The coding style suggested by the Golang community is used in etcd. See the [style doc](https://github.com/golang/go/wiki/CodeReviewComments) for details.
35
36Please follow this style to make etcd easy to review, maintain and develop.
37
38### Format of the commit message
39
40We follow a rough convention for commit messages that is designed to answer two
41questions: what changed and why. The subject line should feature the what and
42the body of the commit should describe the why.
43
44```
45etcdserver: add grpc interceptor to log info on incoming requests
46
47To improve debuggability of etcd v3. Added a grpc interceptor to log
48info on incoming requests to etcd server. The log output includes
49remote client info, request content (with value field redacted), request
50handling latency, response size, etc. Uses zap logger if available,
51otherwise uses capnslog.
52
53Fixes #38
54```
55
56The format can be described more formally as follows:
57
58```
59<package>: <what changed>
60<BLANK LINE>
61<why this change was made>
62<BLANK LINE>
63<footer>
64```
65
66The first line is the subject and should be no longer than 70 characters, the second
67line is always blank, and other lines should be wrapped at 80 characters. This allows
68the message to be easier to read on GitHub as well as in various git tools.
69
70### Pull request across multiple files and packages
71
72If multiple files in a package are changed in a pull request for example:
73
74```
75etcdserver/config.go
76etcdserver/corrupt.go
77```
78
79At the end of the review process if multiple commits exist for a single package they
80should be squashed/rebased into a single commit before being merged.
81
82```
83etcdserver: <what changed>
84[..]
85```
86
87If a pull request spans many packages these commits should be squashed/rebased into a single
88commit using message with a more generic `*:` prefix.
89
90```
91*: <what changed>
92[..]
93```
94