Andrea Campanella | 4dd0422 | 2022-03-18 15:52:28 +0100 | [diff] [blame] | 1 | Contributing to VOLTHA |
| 2 | ====================== |
| 3 | |
| 4 | We'd love to accept your patches and contributions to the VOLTHA project. There are |
| 5 | just a few small guidelines you need to follow. |
| 6 | |
| 7 | Contributor License Agreement |
| 8 | ----------------------------- |
| 9 | |
| 10 | Contributions to this project must be accompanied by a Contributor License |
| 11 | Agreement. You (or your employer) retain the copyright to your contribution, |
| 12 | this simply gives us permission to use and redistribute your contributions as |
| 13 | part of the project. Head over to the `ONF CLA <https://cla.opennetworking.org/>`_ to see |
| 14 | your current agreements on file or to sign a new one. |
| 15 | |
| 16 | You 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 |
| 18 | again. |
| 19 | |
| 20 | Guides, Rules and Best Practices |
| 21 | -------------------------------- |
| 22 | |
| 23 | VOLTHA 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 |
| 25 | writing, submitting or reviewing code. |
| 26 | VOLTHA uses gerrit to submit, review, tests and finally merge patches. |
| 27 | |
| 28 | Submitting Code |
| 29 | +++++++++++++++ |
| 30 | |
| 31 | Some additional points for developers: |
| 32 | |
Joey Armstrong | 3980d70 | 2023-08-23 10:57:18 -0400 | [diff] [blame] | 33 | - 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 Campanella | 4dd0422 | 2022-03-18 15:52:28 +0100 | [diff] [blame] | 46 | |
| 47 | Steps to successful PRs |
| 48 | +++++++++++++++++++++++ |
| 49 | |
Joey Armstrong | f713d7f | 2023-02-23 06:06:49 -0500 | [diff] [blame] | 50 | 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 Campanella | 4dd0422 | 2022-03-18 15:52:28 +0100 | [diff] [blame] | 54 | |
Joey Armstrong | f713d7f | 2023-02-23 06:06:49 -0500 | [diff] [blame] | 55 | .. list-table:: Patch Pre-Screening |
| 56 | :widths: 10, 40 |
Andrea Campanella | 4dd0422 | 2022-03-18 15:52:28 +0100 | [diff] [blame] | 57 | |
Joey Armstrong | f713d7f | 2023-02-23 06:06:49 -0500 | [diff] [blame] | 58 | * - Command |
| 59 | - Description |
| 60 | * - `make lint <https://docs.voltha.org/master/howto/code/linting.html>`_ |
Joey Armstrong | 34f1840 | 2023-07-21 18:58:10 -0400 | [diff] [blame] | 61 | - Syntax check source for problems (lint, lint-shelcheck, lint-doc8) |
Joey Armstrong | f713d7f | 2023-02-23 06:06:49 -0500 | [diff] [blame] | 62 | * - make sca |
| 63 | - Static Code Analysis |
Joey Armstrong | 34f1840 | 2023-07-21 18:58:10 -0400 | [diff] [blame] | 64 | * - make build |
| 65 | - Assemble, compile, generate, link, ... |
Joey Armstrong | f713d7f | 2023-02-23 06:06:49 -0500 | [diff] [blame] | 66 | * - make test |
| 67 | - Invoke VOLTHA test suite(s) |
| 68 | * - make help |
Joey Armstrong | 34f1840 | 2023-07-21 18:58:10 -0400 | [diff] [blame] | 69 | - Show available targets: make help | grep lint |
Andrea Campanella | 4dd0422 | 2022-03-18 15:52:28 +0100 | [diff] [blame] | 70 | |
Joey Armstrong | 34f1840 | 2023-07-21 18:58:10 -0400 | [diff] [blame] | 71 | 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 Armstrong | f713d7f | 2023-02-23 06:06:49 -0500 | [diff] [blame] | 75 | Wait for job completion status before proceeding. |
| 76 | |
Joey Armstrong | 864db88 | 2023-08-24 15:01:35 -0400 | [diff] [blame] | 77 | - Job status will be sent to you asynchronously in email at job completion. |
| 78 | - For direct monitoring :doc:`review gerrit Change Log<contributing/patch_followup>` for your patch. |
Joey Armstrong | f713d7f | 2023-02-23 06:06:49 -0500 | [diff] [blame] | 79 | |
Joey Armstrong | 864db88 | 2023-08-24 15:01:35 -0400 | [diff] [blame] | 80 | - If testing fails please fix your patch with step 3 then repeat 2 and 3 as needed. |
Joey Armstrong | f713d7f | 2023-02-23 06:06:49 -0500 | [diff] [blame] | 81 | |
| 82 | **Passing CI verification is mandatory.** |
| 83 | |
Joey Armstrong | 864db88 | 2023-08-24 15:01:35 -0400 | [diff] [blame] | 84 | To view accumulated job status: |
| 85 | |
| 86 | - `navigate to a patch <https://gerrit.opencord.org/c/ci-management/+/34599>`_ |
| 87 | - View "Submit requirements" in the top left. |
| 88 | - Verified ``+1 Jenkins Technical User`` will indicate SUCCESS. |
| 89 | - Verified ``-1 Jenkins Technical User`` will indicate FAILURE. |
| 90 | |
Joey Armstrong | f713d7f | 2023-02-23 06:06:49 -0500 | [diff] [blame] | 91 | If the CI check does not start or fails and you believe the issue is |
| 92 | un-related to a changeset you can re-trigger by commenting on the |
Joey Armstrong | 864db88 | 2023-08-24 15:01:35 -0400 | [diff] [blame] | 93 | patch with `recheck <https://docs.voltha.org/master/howto/code/pull_request.html#development-and-code-reviews>`_ |
Joey Armstrong | f713d7f | 2023-02-23 06:06:49 -0500 | [diff] [blame] | 94 | |
| 95 | If failures persist `ask for assistance <https://wiki.opennetworking.org/display/COM/VOLTHA>`_ in slack or a mailing list. |
| 96 | |
Joey Armstrong | 864db88 | 2023-08-24 15:01:35 -0400 | [diff] [blame] | 97 | 6. When patch comments are offered please make the appropriate fixes and then |
Andrea Campanella | 4dd0422 | 2022-03-18 15:52:28 +0100 | [diff] [blame] | 98 | amend your commit with `git commit --amend` and re-upload to gerrit with `git review`. |
| 99 | |
Joey Armstrong | 34f1840 | 2023-07-21 18:58:10 -0400 | [diff] [blame] | 100 | 7. Await review. Everyone can comment on code changes, but only Core contributors |
Joey Armstrong | 864db88 | 2023-08-24 15:01:35 -0400 | [diff] [blame] | 101 | can give final review approval. |
| 102 | |
| 103 | **All changes must acquire +2 Approval**. |
| 104 | |
| 105 | Join one of the `communication channels <https://wiki.opennetworking.org/display/COM/VOLTHA>`_ |
Andrea Campanella | 4dd0422 | 2022-03-18 15:52:28 +0100 | [diff] [blame] | 106 | to request a review or to bring additional attention to your patch. |
| 107 | |
Joey Armstrong | 864db88 | 2023-08-24 15:01:35 -0400 | [diff] [blame] | 108 | 8. A patch will be ready to submit a merge request when |
| 109 | |
| 110 | - "Submit requirements" in the top left is showing: |
| 111 | |
| 112 | - Code-Review: +2 approval (or 2 x +1 approval) |
| 113 | - Verified ``+1 Jenkins Technical User`` |
| 114 | |
Andrea Campanella | 7dae5ce | 2022-03-25 16:08:15 +0100 | [diff] [blame] | 115 | Versioning |
| 116 | ++++++++++ |
| 117 | |
| 118 | All of the VOLTHA components and the charts include a VERSION file that specifies |
| 119 | the version of the service, library, protobuf, test suite included in the repository. |
Joey Armstrong | 45fe805 | 2023-06-23 09:51:02 -0400 | [diff] [blame] | 120 | |
| 121 | - The `VERSION <https://gerrit.opencord.org/plugins/gitiles/voltha-go/+/refs/heads/master/VERSION>`_ file can be found in a repository root directory. |
| 122 | - One exception: maven based builds using pom.xml files. |
| 123 | |
Andrea Campanella | 7dae5ce | 2022-03-25 16:08:15 +0100 | [diff] [blame] | 124 | The VERSION is in the format and follows the `SemVer principles <https://semver.org>`_ |
| 125 | VOLTHA also follows the guidelines on how to increment versions as described in the |
| 126 | `SemVer specification <https://semver.org/#semantic-versioning-specification-semver>`_. |
| 127 | |
| 128 | Each increment of the VERSION file in a patch automatically triggers publishing of the repository |
| 129 | artifact, e.g. docker images, with that tag. |
| 130 | In VOLTHA we also use a `x.y.z-dev` format which identifies a non-released component (what is `master`). |
| 131 | When a patch is merged with the `-dev` suffix in the VERSION file no artifact is published except for `master` |
| 132 | docker images. The `-dev` suffix should be removed when a feature being worked on and the component |
| 133 | is ready for release. |
| 134 | |
| 135 | We expect contributions to the VOLTHA codebase to follow these rules when submitting a patch |
| 136 | and the same rules to be enforced by reviewers during the core review process. |
| 137 | |
| 138 | |
Andrea Campanella | 4dd0422 | 2022-03-18 15:52:28 +0100 | [diff] [blame] | 139 | Core Contributors |
| 140 | ----------------- |
| 141 | |
| 142 | Anyone with a Gerrit account can open new issues, comment on existing issues, or |
| 143 | contribute code by opening a review. |
| 144 | |
| 145 | A **“core contributor”** is someone who can manage, approve and |
| 146 | merge patches, and create new branches in the main repository. |
| 147 | |
| 148 | Core contributors are responsible for maintaining the quality of contributions |
| 149 | to the codebase. The goal of this program is to have a diverse group of |
| 150 | individuals whose expertise in aggregate covers the entire project. |
| 151 | |
| 152 | The benefits of being a core contributor include: |
| 153 | - Increased influence of the direction of the project |
| 154 | - The ability to create branches in the main repository and after others approve it |
| 155 | merge your own code |
| 156 | - Community recognition and visibility for their contributions and expertise. |
| 157 | |
| 158 | Becoming a Core Contributor |
| 159 | +++++++++++++++++++++++++++ |
| 160 | |
| 161 | Core contributor candidates need to have a demonstrated proficiency with the |
| 162 | VOLTHA codebase and a track record of code reviews. Members of the Technical |
| 163 | Steering Team (TST) and existing core contributors will regularly invite people |
| 164 | to become new core contributors. Nominations can also be made (including |
| 165 | self-nominations) to the VOLTHA TST (`voltha-tst@opennetworking.org`) at any time. |
| 166 | |
| 167 | A good nomination will include details about who the person is (including their email |
| 168 | and Github and/or Gerrit username) and outline their experience with the VOLTHA codebase |
| 169 | and project at large. |
| 170 | Nominations are intended to start a conversation that results in a decision to |
| 171 | make the person a core contributor – anyone whose nomination is not initially |
| 172 | approved is encouraged to gain more experience with code submission and code |
| 173 | review in order to gain further mastery over the codebase. Partial approval is |
| 174 | also possible (e.g. a person may be granted the ability to handles patches only |
| 175 | on a certain repository), and full approval may be granted after the contributor |
| 176 | has gained more experience. |
| 177 | |
| 178 | New core contributors will be assigned a mentor that is either a TST member or |
| 179 | existing core contributor. The mentor will serve as the primary point of contact |
| 180 | to help onboard the new core contributors and answer any questions they have |
| 181 | with their new responsibilities. The mentor is not the only point of contact, |
| 182 | and core contributors should feel free to reach out to others if and when they |
| 183 | have questions or concerns. |
| 184 | |
| 185 | Guidelines for Core Contributors |
| 186 | ++++++++++++++++++++++++++++++++ |
| 187 | |
| 188 | Contributions in VOLTHA can should be merged after two different +1 arrive on a |
| 189 | given patch-set that is verified by CI as well. |
| 190 | For your own contributions, you now have the ability to approve and merge your |
| 191 | own code, pending that you received two other positive reviews. |
| 192 | For larger or potentially controversial reviews, please give the |
| 193 | community an opportunity (at least a few business days) to review your |
| 194 | contribution. Please always ask for comments on the #voltha-dev Slack channel. |
| 195 | **With great power comes great responsibility; please don't abuse |
| 196 | this privilege.** |
| 197 | |
| 198 | All Core Contributors have +2 and merge capabilities on all the repositories related |
| 199 | to the VOLTHA project, but we expect that they are responsible and exercise their |
| 200 | privilege **only** on patches and repositories they have expertise in and are comfortable reviewing and merging. |
| 201 | |
| 202 | To help patchset verification the VOLTHA test infrastructure offers Per-Patchset Verification Jobs |
| 203 | triggered by specific keyword used in the patch. More information can be found in the |
| 204 | `testing automation page <https://docs.voltha.org/master/testing/voltha_test_automation.html#per-patchset-verification-jobs>`_ |
| 205 | We suggest Core contributors to use these triggers when they would like more checks on a patch they are uncertain about |
| 206 | or that might have differences when applied to hardware pods. |
| 207 | |
| 208 | VOLTHA follows `Google’s best practices for code review <https://google.github.io/eng-practices/review/reviewer/>`_. |
| 209 | You should apply these guidelines strictly and with confidence when reviewing |
| 210 | submissions. |
| 211 | |
| 212 | If you are unsure about something in an issue or a review, leave a comment |
| 213 | that outlines your concerns. If a resolution is difficult to reach in the |
| 214 | comments section, the TST meetings are a good place to raise your concerns and |
| 215 | have a discussion. |
| 216 | |
| 217 | Current Core Contributors |
| 218 | +++++++++++++++++++++++++++ |
| 219 | |
| 220 | This is a list of core contributors divided by area of expertise: |
| 221 | |
| 222 | Adapter openonu and omci-lib-go: |
| 223 | |
Andrea Campanella | 4dd0422 | 2022-03-18 15:52:28 +0100 | [diff] [blame] | 224 | - `Chip Boling <chip.boling@tibitcom.com>`_ |
Andrea Campanella | 4dd0422 | 2022-03-18 15:52:28 +0100 | [diff] [blame] | 225 | - `Ozge Ayaz <ozge.ayaz@netsia.com>`_ |
| 226 | |
| 227 | Voltha-system-tests: |
| 228 | |
TorstenThieme | 47e59db | 2023-05-31 08:29:47 +0000 | [diff] [blame] | 229 | - to be assigned |
Andrea Campanella | 4dd0422 | 2022-03-18 15:52:28 +0100 | [diff] [blame] | 230 | |
| 231 | Openolt agent: |
| 232 | |
| 233 | - `Thiyagarajan Subramani <Thiyagarajan.Subramani@radisys.com>`_ |
| 234 | - `Burak Gurdag <burak.gurdag@netsia.com>`_ |
| 235 | |
| 236 | ONOS apps: |
| 237 | |
| 238 | - `Gamze Abaka <gamze.abaka@netsia.com>`_ |
| 239 | - `Yasin Sapli <yasin.sapli@netsia.com>`_ |
| 240 | - `Tunahan Sezen <tunahan.sezen@netsia.com>`_ |
| 241 | |
| 242 | Olt adapter, rw-core: |
| 243 | |
| 244 | - `Abhilash Satish Laxmeshwar <abhilash.laxmeshwar@radisys.com>`_ |
| 245 | - `Gamze Abaka <gamze.abaka@netsia.com>`_ |
Joey Armstrong | f713d7f | 2023-02-23 06:06:49 -0500 | [diff] [blame] | 246 | |
| 247 | Build system, makefiles, reviews: |
| 248 | |
| 249 | - `Joey Armstrong <joey@opennetworking.org>`_ |
| 250 | - `David Ferguson <daf@opennetworking.org>`_ |
Andrea Campanella | 4dd0422 | 2022-03-18 15:52:28 +0100 | [diff] [blame] | 251 | |
| 252 | All of the codebase: |
| 253 | |
Andrea Campanella | 4dd0422 | 2022-03-18 15:52:28 +0100 | [diff] [blame] | 254 | - `Mahir Gunyel <mahir.gunyel@netsia.com>`_ |
| 255 | - `Serkant Uluderya <serkant.uluderya@netsia.com>`_ |
| 256 | - `Amit Ghosh <Amit.Ghosh@radisys.com>`_ |
Joey Armstrong | ae15c26 | 2023-03-29 15:36:28 -0400 | [diff] [blame] | 257 | - `Suhas Gururaj Rao <suhas.gururaj@radisys.com>`_ |
Andrea Campanella | 4dd0422 | 2022-03-18 15:52:28 +0100 | [diff] [blame] | 258 | |
Andrea Campanella | 4dd0422 | 2022-03-18 15:52:28 +0100 | [diff] [blame] | 259 | Community Guidelines |
| 260 | -------------------- |
| 261 | |
Joey Armstrong | a4d2723 | 2022-12-29 08:50:02 -0500 | [diff] [blame] | 262 | This project follows `Google's Open Source Community Guidelines <https://opensource.google/conduct/>`_ |
| 263 | |
Joey Armstrong | f713d7f | 2023-02-23 06:06:49 -0500 | [diff] [blame] | 264 | and ONF's `Code of Conduct <https://opennetworking.org/wp-content/themes/onf/img/onf-code-of-conduct.pdf>`_. |