blob: 768b87843b64ffcd5ed6a748f88f7c289b556581 [file] [log] [blame]
Andrea Campanella4dd04222022-03-18 15:52:28 +01001Contributing to VOLTHA
2======================
3
4We'd love to accept your patches and contributions to the VOLTHA 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
23VOLTHA 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.
26VOLTHA uses gerrit to submit, review, tests and finally merge patches.
27
28Submitting Code
29+++++++++++++++
30
31Some additional points for developers:
32
Joey Armstrong3980d702023-08-23 10:57:18 -040033- Submit your changes early and often. Code and design review input
34 with corrections early in the process prevent huge changes later.
35- :doc:`Create a Jira ticket for code changes <contributing/jira_tickets>` (required)
36- :doc:`Update copyright notices <contributing/copyright>`
37- `Commit message <https://docs.voltha.org/master/howto/code/commit-message.html#pull-request-commit-message>`_ and jenkins automation.
38
39 - To enable automation, prefix your commit message with a jira ticket
40
41 - ``[VOL-4550]`` - Spiffy enhancement/feature/problem summary
42
43 - This addition will allow jenkins to magically update tickets
44 with processed job status.
45- :doc:`Request a code review <contributing/code_review>`
Andrea Campanella4dd04222022-03-18 15:52:28 +010046
47Steps to successful PRs
48+++++++++++++++++++++++
49
Joey Armstrongf713d7f2023-02-23 06:06:49 -050050 1. Checkout the code base and prepare your patch.
51 2. Workflow to modify VOLTHA code through gerrit is identical to `onos-classic`
52 and is described in `Sample Gerrit Workflow page <https://wiki.onosproject.org/display/ONOS/Sample+Gerrit+Workflow>`_
53 3. Before submitting your patch via `git review` please pre-screen your changes to ensure code quality.
Andrea Campanella4dd04222022-03-18 15:52:28 +010054
Joey Armstrongf713d7f2023-02-23 06:06:49 -050055 .. list-table:: Patch Pre-Screening
56 :widths: 10, 40
Andrea Campanella4dd04222022-03-18 15:52:28 +010057
Joey Armstrongf713d7f2023-02-23 06:06:49 -050058 * - Command
59 - Description
60 * - `make lint <https://docs.voltha.org/master/howto/code/linting.html>`_
Joey Armstrong34f18402023-07-21 18:58:10 -040061 - Syntax check source for problems (lint, lint-shelcheck, lint-doc8)
Joey Armstrongf713d7f2023-02-23 06:06:49 -050062 * - make sca
63 - Static Code Analysis
Joey Armstrong34f18402023-07-21 18:58:10 -040064 * - make build
65 - Assemble, compile, generate, link, ...
Joey Armstrongf713d7f2023-02-23 06:06:49 -050066 * - make test
67 - Invoke VOLTHA test suite(s)
68 * - make help
Joey Armstrong34f18402023-07-21 18:58:10 -040069 - Show available targets: make help | grep lint
Andrea Campanella4dd04222022-03-18 15:52:28 +010070
Joey Armstrong34f18402023-07-21 18:58:10 -040071 4. :ref:`Commit message syntax and testing directives <pull-request--commit-message>`
72
73 5. Submitting your patch will initiate a validation
74 `jenkins job <https://jenkins.opencord.org>`_.
Joey Armstrongf713d7f2023-02-23 06:06:49 -050075 Wait for job completion status before proceeding.
76
77 - Job completion status will be sent to you asynchronously in email.
78 - For direct monitoring `review comment history for your patch <https://gerrit.opencord.org/q/status:open+-is:wip>`_.
79 - Search for `Jenkins Technical User <https://gerrit.opencord.org/c/voltha-docs/+/33952>`_ and click a job entry.
80 - In the top grey navigation bar, following "Dashboard", click the test suite name to view the active job dashboard history `verify_voltha-docs_unit-test <https://jenkins.opencord.org/job/verify_voltha-docs_unit-test/>`_.
81
82 If testing fails please fix your patch with step 3 an then repeat 2 and 3, as necessary.
83
84 **Passing CI verification is mandatory.**
85
86 If the CI check does not start or fails and you believe the issue is
87 un-related to a changeset you can re-trigger by commenting on the
88 patch with `recheck`.
89
90 If failures persist `ask for assistance <https://wiki.opennetworking.org/display/COM/VOLTHA>`_ in slack or a mailing list.
91
Joey Armstrong34f18402023-07-21 18:58:10 -040092 6. When comments are made to your patch please make the appropriate fixes and then
Andrea Campanella4dd04222022-03-18 15:52:28 +010093 amend your commit with `git commit --amend` and re-upload to gerrit with `git review`.
94
Joey Armstrong34f18402023-07-21 18:58:10 -040095 7. Await review. Everyone can comment on code changes, but only Core contributors
Andrea Campanella4dd04222022-03-18 15:52:28 +010096 can give final review approval. **All changes must get at least one
97 approval**. Join one of the `communication channels <https://wiki.opennetworking.org/display/COM/VOLTHA>`_
98 to request a review or to bring additional attention to your patch.
99
Andrea Campanella7dae5ce2022-03-25 16:08:15 +0100100Versioning
101++++++++++
102
103All of the VOLTHA components and the charts include a VERSION file that specifies
104the version of the service, library, protobuf, test suite included in the repository.
Joey Armstrong45fe8052023-06-23 09:51:02 -0400105
106- The `VERSION <https://gerrit.opencord.org/plugins/gitiles/voltha-go/+/refs/heads/master/VERSION>`_ file can be found in a repository root directory.
107- One exception: maven based builds using pom.xml files.
108
Andrea Campanella7dae5ce2022-03-25 16:08:15 +0100109The VERSION is in the format and follows the `SemVer principles <https://semver.org>`_
110VOLTHA also follows the guidelines on how to increment versions as described in the
111`SemVer specification <https://semver.org/#semantic-versioning-specification-semver>`_.
112
113Each increment of the VERSION file in a patch automatically triggers publishing of the repository
114artifact, e.g. docker images, with that tag.
115In VOLTHA we also use a `x.y.z-dev` format which identifies a non-released component (what is `master`).
116When a patch is merged with the `-dev` suffix in the VERSION file no artifact is published except for `master`
117docker images. The `-dev` suffix should be removed when a feature being worked on and the component
118is ready for release.
119
120We expect contributions to the VOLTHA codebase to follow these rules when submitting a patch
121and the same rules to be enforced by reviewers during the core review process.
122
123
Andrea Campanella4dd04222022-03-18 15:52:28 +0100124Core Contributors
125-----------------
126
127Anyone with a Gerrit account can open new issues, comment on existing issues, or
128contribute code by opening a review.
129
130A **“core contributor”** is someone who can manage, approve and
131merge patches, and create new branches in the main repository.
132
133Core contributors are responsible for maintaining the quality of contributions
134to the codebase. The goal of this program is to have a diverse group of
135individuals whose expertise in aggregate covers the entire project.
136
137The benefits of being a core contributor include:
138 - Increased influence of the direction of the project
139 - The ability to create branches in the main repository and after others approve it
140 merge your own code
141 - Community recognition and visibility for their contributions and expertise.
142
143Becoming a Core Contributor
144+++++++++++++++++++++++++++
145
146Core contributor candidates need to have a demonstrated proficiency with the
147VOLTHA codebase and a track record of code reviews. Members of the Technical
148Steering Team (TST) and existing core contributors will regularly invite people
149to become new core contributors. Nominations can also be made (including
150self-nominations) to the VOLTHA TST (`voltha-tst@opennetworking.org`) at any time.
151
152A good nomination will include details about who the person is (including their email
153and Github and/or Gerrit username) and outline their experience with the VOLTHA codebase
154and project at large.
155Nominations are intended to start a conversation that results in a decision to
156make the person a core contributor anyone whose nomination is not initially
157approved is encouraged to gain more experience with code submission and code
158review in order to gain further mastery over the codebase. Partial approval is
159also possible (e.g. a person may be granted the ability to handles patches only
160on a certain repository), and full approval may be granted after the contributor
161has gained more experience.
162
163New core contributors will be assigned a mentor that is either a TST member or
164existing core contributor. The mentor will serve as the primary point of contact
165to help onboard the new core contributors and answer any questions they have
166with their new responsibilities. The mentor is not the only point of contact,
167and core contributors should feel free to reach out to others if and when they
168have questions or concerns.
169
170Guidelines for Core Contributors
171++++++++++++++++++++++++++++++++
172
173Contributions in VOLTHA can should be merged after two different +1 arrive on a
174given patch-set that is verified by CI as well.
175For your own contributions, you now have the ability to approve and merge your
176own code, pending that you received two other positive reviews.
177For larger or potentially controversial reviews, please give the
178community an opportunity (at least a few business days) to review your
179contribution. Please always ask for comments on the #voltha-dev Slack channel.
180**With great power comes great responsibility; please don't abuse
181this privilege.**
182
183All Core Contributors have +2 and merge capabilities on all the repositories related
184to the VOLTHA project, but we expect that they are responsible and exercise their
185privilege **only** on patches and repositories they have expertise in and are comfortable reviewing and merging.
186
187To help patchset verification the VOLTHA test infrastructure offers Per-Patchset Verification Jobs
188triggered by specific keyword used in the patch. More information can be found in the
189`testing automation page <https://docs.voltha.org/master/testing/voltha_test_automation.html#per-patchset-verification-jobs>`_
190We suggest Core contributors to use these triggers when they would like more checks on a patch they are uncertain about
191or that might have differences when applied to hardware pods.
192
193VOLTHA follows `Google’s best practices for code review <https://google.github.io/eng-practices/review/reviewer/>`_.
194You should apply these guidelines strictly and with confidence when reviewing
195submissions.
196
197If you are unsure about something in an issue or a review, leave a comment
198that outlines your concerns. If a resolution is difficult to reach in the
199comments section, the TST meetings are a good place to raise your concerns and
200have a discussion.
201
202Current Core Contributors
203+++++++++++++++++++++++++++
204
205This is a list of core contributors divided by area of expertise:
206
207Adapter openonu and omci-lib-go:
208
Andrea Campanella4dd04222022-03-18 15:52:28 +0100209 - `Chip Boling <chip.boling@tibitcom.com>`_
Andrea Campanella4dd04222022-03-18 15:52:28 +0100210 - `Ozge Ayaz <ozge.ayaz@netsia.com>`_
211
212Voltha-system-tests:
213
TorstenThieme47e59db2023-05-31 08:29:47 +0000214 - to be assigned
Andrea Campanella4dd04222022-03-18 15:52:28 +0100215
216Openolt agent:
217
218 - `Thiyagarajan Subramani <Thiyagarajan.Subramani@radisys.com>`_
219 - `Burak Gurdag <burak.gurdag@netsia.com>`_
220
221ONOS apps:
222
223 - `Gamze Abaka <gamze.abaka@netsia.com>`_
224 - `Yasin Sapli <yasin.sapli@netsia.com>`_
225 - `Tunahan Sezen <tunahan.sezen@netsia.com>`_
226
227Olt adapter, rw-core:
228
229 - `Abhilash Satish Laxmeshwar <abhilash.laxmeshwar@radisys.com>`_
230 - `Gamze Abaka <gamze.abaka@netsia.com>`_
Joey Armstrongf713d7f2023-02-23 06:06:49 -0500231
232Build system, makefiles, reviews:
233
234 - `Joey Armstrong <joey@opennetworking.org>`_
235 - `David Ferguson <daf@opennetworking.org>`_
Andrea Campanella4dd04222022-03-18 15:52:28 +0100236
237All of the codebase:
238
Andrea Campanella4dd04222022-03-18 15:52:28 +0100239 - `Mahir Gunyel <mahir.gunyel@netsia.com>`_
240 - `Serkant Uluderya <serkant.uluderya@netsia.com>`_
241 - `Amit Ghosh <Amit.Ghosh@radisys.com>`_
Joey Armstrongae15c262023-03-29 15:36:28 -0400242 - `Suhas Gururaj Rao <suhas.gururaj@radisys.com>`_
Andrea Campanella4dd04222022-03-18 15:52:28 +0100243
Andrea Campanella4dd04222022-03-18 15:52:28 +0100244Community Guidelines
245--------------------
246
Joey Armstronga4d27232022-12-29 08:50:02 -0500247This project follows `Google's Open Source Community Guidelines <https://opensource.google/conduct/>`_
248
Joey Armstrongf713d7f2023-02-23 06:06:49 -0500249and ONF's `Code of Conduct <https://opennetworking.org/wp-content/themes/onf/img/onf-code-of-conduct.pdf>`_.