1ffe3c632Sopenharmony_ci# Contributing to Protocol Buffers
2ffe3c632Sopenharmony_ci
3ffe3c632Sopenharmony_ciWe welcome your contributions to protocol buffers. This doc describes the
4ffe3c632Sopenharmony_ciprocess to contribute patches to protobuf and the general guidelines we
5ffe3c632Sopenharmony_ciexpect contributors to follow.
6ffe3c632Sopenharmony_ci
7ffe3c632Sopenharmony_ci## Before You Start
8ffe3c632Sopenharmony_ci
9ffe3c632Sopenharmony_ciWe accept patches in the form of github pull requests. If you are new to
10ffe3c632Sopenharmony_cigithub, please read [How to create github pull requests](https://help.github.com/articles/about-pull-requests/)
11ffe3c632Sopenharmony_cifirst.
12ffe3c632Sopenharmony_ci
13ffe3c632Sopenharmony_ci### Contributor License Agreements
14ffe3c632Sopenharmony_ci
15ffe3c632Sopenharmony_ciContributions to this project must be accompanied by a Contributor License
16ffe3c632Sopenharmony_ciAgreement. You (or your employer) retain the copyright to your contribution,
17ffe3c632Sopenharmony_cithis simply gives us permission to use and redistribute your contributions
18ffe3c632Sopenharmony_cias part of the project.
19ffe3c632Sopenharmony_ci
20ffe3c632Sopenharmony_ci* If you are an individual writing original source code and you're sure you
21ffe3c632Sopenharmony_ci  own the intellectual property, then you'll need to sign an [individual CLA](https://cla.developers.google.com/about/google-individual?csw=1).
22ffe3c632Sopenharmony_ci* If you work for a company that wants to allow you to contribute your work,
23ffe3c632Sopenharmony_ci  then you'll need to sign a [corporate CLA](https://cla.developers.google.com/about/google-corporate?csw=1).
24ffe3c632Sopenharmony_ci
25ffe3c632Sopenharmony_ci### Coding Style
26ffe3c632Sopenharmony_ci
27ffe3c632Sopenharmony_ciThis project follows [Google’s Coding Style Guides](https://github.com/google/styleguide).
28ffe3c632Sopenharmony_ciBefore sending out your pull request, please familiarize yourself with the
29ffe3c632Sopenharmony_cicorresponding style guides and make sure the proposed code change is style
30ffe3c632Sopenharmony_ciconforming.
31ffe3c632Sopenharmony_ci
32ffe3c632Sopenharmony_ci## Contributing Process
33ffe3c632Sopenharmony_ci
34ffe3c632Sopenharmony_ciMost pull requests should go to the master branch and the change will be
35ffe3c632Sopenharmony_ciincluded in the next major/minor version release (e.g., 3.6.0 release). If you
36ffe3c632Sopenharmony_cineed to include a bug fix in a patch release (e.g., 3.5.2), make sure it’s
37ffe3c632Sopenharmony_cialready merged to master, and then create a pull request cherry-picking the
38ffe3c632Sopenharmony_cicommits from master branch to the release branch (e.g., branch 3.5.x).
39ffe3c632Sopenharmony_ci
40ffe3c632Sopenharmony_ciFor each pull request, a protobuf team member will be assigned to review the
41ffe3c632Sopenharmony_cipull request. For minor cleanups, the pull request may be merged right away
42ffe3c632Sopenharmony_ciafter an initial review. For larger changes, you will likely receive multiple
43ffe3c632Sopenharmony_cirounds of comments and it may take some time to complete. We will try to keep
44ffe3c632Sopenharmony_ciour response time within 7-days but if you don’t get any response in a few
45ffe3c632Sopenharmony_cidays, feel free to comment on the threads to get our attention. We also expect
46ffe3c632Sopenharmony_ciyou to respond to our comments within a reasonable amount of time. If we don’t
47ffe3c632Sopenharmony_cihear from you for 2 weeks or longer, we may close the pull request. You can
48ffe3c632Sopenharmony_cistill send the pull request again once you have time to work on it.
49ffe3c632Sopenharmony_ci
50ffe3c632Sopenharmony_ciOnce a pull request is merged, we will take care of the rest and get it into
51ffe3c632Sopenharmony_cithe final release.
52ffe3c632Sopenharmony_ci
53ffe3c632Sopenharmony_ci## Pull Request Guidelines
54ffe3c632Sopenharmony_ci
55ffe3c632Sopenharmony_ci* If you are a Googler, it is preferable to first create an internal CL and
56ffe3c632Sopenharmony_ci  have it reviewed and submitted. The code propagation process will deliver the
57ffe3c632Sopenharmony_ci  change to GitHub.
58ffe3c632Sopenharmony_ci* Create small PRs that are narrowly focused on addressing a single concern.
59ffe3c632Sopenharmony_ci  We often receive PRs that are trying to fix several things at a time, but if
60ffe3c632Sopenharmony_ci  only one fix is considered acceptable, nothing gets merged and both author's
61ffe3c632Sopenharmony_ci  & review's time is wasted. Create more PRs to address different concerns and
62ffe3c632Sopenharmony_ci  everyone will be happy.
63ffe3c632Sopenharmony_ci* For speculative changes, consider opening an issue and discussing it first.
64ffe3c632Sopenharmony_ci  If you are suggesting a behavioral or API change, make sure you get explicit
65ffe3c632Sopenharmony_ci  support from a protobuf team member before sending us the pull request.
66ffe3c632Sopenharmony_ci* Provide a good PR description as a record of what change is being made and
67ffe3c632Sopenharmony_ci  why it was made. Link to a GitHub issue if it exists.
68ffe3c632Sopenharmony_ci* Don't fix code style and formatting unless you are already changing that
69ffe3c632Sopenharmony_ci  line to address an issue. PRs with irrelevant changes won't be merged. If
70ffe3c632Sopenharmony_ci  you do want to fix formatting or style, do that in a separate PR.
71ffe3c632Sopenharmony_ci* Unless your PR is trivial, you should expect there will be reviewer comments
72ffe3c632Sopenharmony_ci  that you'll need to address before merging. We expect you to be reasonably
73ffe3c632Sopenharmony_ci  responsive to those comments, otherwise the PR will be closed after 2-3 weeks
74ffe3c632Sopenharmony_ci  of inactivity.
75ffe3c632Sopenharmony_ci* Maintain clean commit history and use meaningful commit messages. PRs with
76ffe3c632Sopenharmony_ci  messy commit history are difficult to review and won't be merged. Use rebase
77ffe3c632Sopenharmony_ci  -i upstream/master to curate your commit history and/or to bring in latest
78ffe3c632Sopenharmony_ci  changes from master (but avoid rebasing in the middle of a code review).
79ffe3c632Sopenharmony_ci* Keep your PR up to date with upstream/master (if there are merge conflicts,
80ffe3c632Sopenharmony_ci  we can't really merge your change).
81ffe3c632Sopenharmony_ci* All tests need to be passing before your change can be merged. We recommend
82ffe3c632Sopenharmony_ci  you run tests locally before creating your PR to catch breakages early on.
83ffe3c632Sopenharmony_ci  Ultimately, the green signal will be provided by our testing infrastructure.
84ffe3c632Sopenharmony_ci  The reviewer will help you if there are test failures that seem not related
85ffe3c632Sopenharmony_ci  to the change you are making.
86ffe3c632Sopenharmony_ci
87ffe3c632Sopenharmony_ci## Reviewer Guidelines
88ffe3c632Sopenharmony_ci
89ffe3c632Sopenharmony_ci* Make sure that all tests are passing before approval.
90ffe3c632Sopenharmony_ci* Apply the "release notes: yes" label if the pull request's description should
91ffe3c632Sopenharmony_ci  be included in the next release (e.g., any new feature / bug fix).
92ffe3c632Sopenharmony_ci  Apply the "release notes: no" label if the pull request's description should
93ffe3c632Sopenharmony_ci  not be included in the next release (e.g., refactoring changes that does not
94ffe3c632Sopenharmony_ci  change behavior, integration from Google internal, updating tests, etc.).
95ffe3c632Sopenharmony_ci* Apply the appropriate language label (e.g., C++, Java, Python, etc.) to the
96ffe3c632Sopenharmony_ci  pull request. This will make it easier to identify which languages the pull
97ffe3c632Sopenharmony_ci  request affects, allowing us to better identify appropriate reviewer, create
98ffe3c632Sopenharmony_ci  a better release note, and make it easier to identify issues in the future.
99