blob: 1820996d7c9e1794c63d09a6e04082e6386af682 [file] [log] [blame]
Scott Baker4232d4f2022-03-31 10:52:37 -07001Contributing to Aether
2======================
3
4We'd love to accept your patches and contributions to the Aether project. There are
5just a few small guidelines you need to follow.
6
7Contributor License Agreement
8-----------------------------
9
10Contributions to this project must be accompanied by a Contributor License
11Agreement. You (or your employer) retain the copyright to your contribution,
12this simply gives us permission to use and redistribute your contributions as
13part of the project. Head over to the `ONF CLA <https://cla.opennetworking.org/>`_ to see
14your current agreements on file or to sign a new one.
15
16You generally only need to submit a CLA once, so if you've already submitted one
17(even if it was for a different project), you probably don't need to do it
18again.
19
20Guides, Rules and Best Practices
21--------------------------------
22
23Aether follows `Google's Engineering Practices <https://google.github.io/eng-practices/>`_,
24`Golang Formatting Guide <https://go.dev/doc/effective_go#formatting>`_. Use these documents as a guide when
25writing, submitting or reviewing code.
26Aether uses Github and gerrit to submit, review, tests and finally merge patches.
27
28Submitting Code
29"""""""""""""""
30
31Some additional points for developers:
32
33 - Submit your changes early and often. Input and
34 corrections early in the process prevent huge changes later.
35
36 - Please open a ticket in the Aether Jira describing the issue/feature. During the patch please
37 preface the commit message with `[AETHER-<jira_number]` e.g. `[AETHER-3400]` so it gets
38 automatically linked to the Jira ticket. This keeps code review and design discussions clean.
39
40 - Note that Aether makes use of both gerrit based workflows and Github workflows, depending on
41 the component that is being worked on. Follow the section below that is appropriate.
42
43Steps to successful PRs (gerrit workflows)
44""""""""""""""""""""""""""""""""""""""""""
45
46 1. Checkout the code and prepare your patch. The workflow to make changes to the Aether code through gerrit is identical
47 to the one from `onos-classic` and is described in the
48 `Sample Gerrit Workflow page <https://wiki.onosproject.org/display/ONOS/Sample+Gerrit+Workflow>`_
49
50 2. Before submitting the patch via `git review` please execute Aether specific tests:
51 `make test` and `make linters`. These commands run unit test, linting and other elements
52 to assure the quality of your patch.
53
54 3. Wait for Jenkins sanity checks to pass.
55 If the tests fail please fix your patch and then repeat 2 and 3, as necessary.
56 **Passing CI verification is mandatory.** If the CI check does not start or fails but you think the issue
57 is unrelated you can re-trigger by commenting on to the patch with `recheck`.
58
59 4. When comments are made to your patch please make the appropriate fixes and then
60 amend your commit with `git commit --amend` and re-upload to gerrit with `git review`.
61
62 5. Await review. Everyone can comment on code changes, but only Collaborators
63 and Core contributors can give final review approval. **All changes must get at least one
64 approval**.
65
66Steps to successful PRs (Github workflows)
67""""""""""""""""""""""""""""""""""""""""""
68
69 1. Fork the repository to your company or personal Github account.
70
71 2. Checkout the code from your fork of the repo and prepare your patch.
72
73 3. Before submitting the patch via pull request, please execute any Aether specific tests:
74 `make test` and `make linters`. These commands run unit test, linting and other elements
75 to assure the quality of your patch.
76
77 4. Using the Github user interface on your fork, open a pull request. Add a reviewer from
78 the core contributor list whom you believe will be qualified to review your patch. Often
79 it helps to be involved in informal conversation with a reviewer.
80
81 5. Wait for Jenkins sanity checks to pass.
82 If the tests fail please fix your patch and then repeat 3 through 5, as necessary.
83 **Passing CI verification is mandatory.** If the CI check does not start or fails but you think the issue
84 is unrelated you can re-trigger by commenting on to the patch with `recheck`.
85
86 6. When comments are made to your patch please make the appropriate fixes and then
87 amend your commit with `git commit --amend` and re-upload to gerrit with `git push --force`.
88 Alternatively, you may commit your changes as an additional separate commit. Git will usually
89 merge subsequent commits into your PR.
90
91 7. Await review. Everyone can comment on code changes, but only Collaborators
92 and Core contributors can give final review approval. **All changes must get at least one
93 approval**.
94
95Core Contributors
96-----------------
97
98Anyone with a Gerrit account can open new issues, comment on existing issues, or
99contribute code by opening a review.
100
101A **“core contributor”** is someone who can manage, approve and
102merge patches, and create new branches in the main repository.
103
104Core contributors are responsible for maintaining the quality of contributions
105to the codebase. The goal of this program is to have a diverse group of
106individuals whose expertise in aggregate covers the entire project.
107
108The benefits of being a core contributor include:
109- Increased influence of the direction of the project,
110- The ability to create branches in the main repository and merge your own code,
111- Community recognition and visibility for their contributions and expertise.
112
113Becoming a Core Contributor
114"""""""""""""""""""""""""""
115
116Core contributor candidates need to have a demonstrated proficiency with the
117Aether codebase and a track record of code reviews. Members of the Technical
118Steering Team (TST) and existing core contributors will regularly invite people
119to become new core contributors. Nominations can also be made (including
120self-nominations) to the Aether TST (`aether-tst@opennetworking.org`) at any time.
121
122A good nomination will include details about who the person is (including their email
123and Github and/or Gerrit username) and outline their experience with the Aether codebase
124and project at large.
125Nominations are intended to start a conversation that results in a decision to
126make the person a core contributor anyone whose nomination is not initially
127approved is encouraged to gain more experience with code submission and code
128review in order to gain further mastery over the codebase. Partial approval is
129also possible (e.g. a person may be granted the ability to handles patches only
130on a certain repository), and full approval may be granted after the contributor
131has gained more experience.
132
133New core contributors will be assigned a mentor that is either a TST member or
134existing core contributor. The mentor will serve as the primary point of contact
135to help onboard the new core contributors and answer any questions they have
136with their new responsibilities. The mentor is not the only point of contact,
137and core contributors should feel free to reach out to others if and when they
138have questions or concerns.
139
140Tips for Core Contributors
141""""""""""""""""""""""""""
142
143For your own contributions, you now have the ability to approve and merge your
144own code. For larger or potentially controversial reviews, please give the
145community an opportunity (at least a few business days) to review your
146contribution. Please always ask for comments on the #aether-dev Slack channel.
147**With great power comes great responsibility; please don't abuse
148this privilege.**
149
150Aether follows `Google’s best practices for code review
151<https://google.github.io/eng-practices/review/reviewer/>`_.
152You should apply these guidelines strictly and with confidence when reviewing
153submissions.
154
155If you are unsure about something in an issue or a review, leave a comment
156that outlines your concerns. If a resolution is difficult to reach in the
157comments section, the TST meetings are a good place to raise your concerns and
158have a discussion.
159
Scott Baker4232d4f2022-03-31 10:52:37 -0700160Community Guidelines
161--------------------
162
163This project follows `Google's Open Source Community Guidelines
164<https://opensource.google.com/conduct/>`_
165and ONF's
166`Code of Conduct <https://docs.opennetworking.org/policies/conduct.html>`.