Contributing to VOLTHA¶
We’d love to accept your patches and contributions to the VOLTHA project. There are just a few small guidelines you need to follow.
Contributor License Agreement¶
Contributions to this project must be accompanied by a Contributor License Agreement. You (or your employer) retain the copyright to your contribution, this simply gives us permission to use and redistribute your contributions as part of the project. Head over to the ONF CLA to see your current agreements on file or to sign a new one.
You generally only need to submit a CLA once, so if you’ve already submitted one (even if it was for a different project), you probably don’t need to do it again.
Guides, Rules and Best Practices¶
VOLTHA follows Google’s Engineering Practices, Golang Formatting Guide. Use these documents as a guide when writing, submitting or reviewing code. VOLTHA uses gerrit to submit, review, tests and finally merge patches.
Some additional points for developers:
Submit your changes early and often. Code and design review input with corrections early in the process prevent huge changes later.
Create a Jira ticket for code changes (required)
Commit message and jenkins automation.
To enable automation, prefix your commit message with a jira ticket
[VOL-4550]- Spiffy enhancement/feature/problem summary
This addition will allow jenkins to magically update tickets with processed job status.
Steps to successful PRs¶
Checkout the code base and prepare your patch.
Workflow to modify VOLTHA code through gerrit is identical to onos-classic and is described in Sample Gerrit Workflow page
Before submitting your patch via git review please pre-screen your changes to ensure code quality.
Syntax check source for problems (lint, lint-shelcheck, lint-doc8)
Static Code Analysis
Assemble, compile, generate, link, …
Invoke VOLTHA test suite(s)
Show available targets: make help | grep lint
Submitting your patch will initiate a validation jenkins job. Wait for job completion status before proceeding.
Job status will be sent to you asynchronously in email at job completion.
For direct monitoring review gerrit Change Log for your patch.
If testing fails please fix your patch with step 3 then repeat 2 and 3 as needed.
Passing CI verification is mandatory.
To view accumulated job status:
View “Submit requirements” in the top left.
+1 Jenkins Technical Userwill indicate SUCCESS.
-1 Jenkins Technical Userwill indicate FAILURE.
If the CI check does not start or fails and you believe the issue is un-related to a changeset you can re-trigger by commenting on the patch with recheck
If failures persist ask for assistance in slack or a mailing list.
When patch comments are offered please make the appropriate fixes and then amend your commit with git commit –amend and re-upload to gerrit with git review.
Await review. Everyone can comment on code changes, but only Core contributors can give final review approval.
All changes must acquire +2 Approval.
Join one of the communication channels to request a review or to bring additional attention to your patch.
A patch will be ready to submit a merge request when
“Submit requirements” in the top left is showing:
Code-Review: +2 approval (or 2 x +1 approval)
+1 Jenkins Technical User
All of the VOLTHA components and the charts include a VERSION file that specifies the version of the service, library, protobuf, test suite included in the repository.
The VERSION file can be found in a repository root directory.
One exception: maven based builds using pom.xml files.
Each increment of the VERSION file in a patch automatically triggers publishing of the repository artifact, e.g. docker images, with that tag. In VOLTHA we also use a x.y.z-dev format which identifies a non-released component (what is master). When a patch is merged with the -dev suffix in the VERSION file no artifact is published except for master docker images. The -dev suffix should be removed when a feature being worked on and the component is ready for release.
We expect contributions to the VOLTHA codebase to follow these rules when submitting a patch and the same rules to be enforced by reviewers during the core review process.
Anyone with a Gerrit account can open new issues, comment on existing issues, or contribute code by opening a review.
A “core contributor” is someone who can manage, approve and merge patches, and create new branches in the main repository.
Core contributors are responsible for maintaining the quality of contributions to the codebase. The goal of this program is to have a diverse group of individuals whose expertise in aggregate covers the entire project.
- The benefits of being a core contributor include:
Increased influence of the direction of the project
The ability to create branches in the main repository and after others approve it merge your own code
Community recognition and visibility for their contributions and expertise.
Becoming a Core Contributor¶
Core contributor candidates need to have a demonstrated proficiency with the VOLTHA codebase and a track record of code reviews. Members of the Technical Steering Team (TST) and existing core contributors will regularly invite people to become new core contributors. Nominations can also be made (including self-nominations) to the VOLTHA TST (email@example.com) at any time.
A good nomination will include details about who the person is (including their email and Github and/or Gerrit username) and outline their experience with the VOLTHA codebase and project at large. Nominations are intended to start a conversation that results in a decision to make the person a core contributor – anyone whose nomination is not initially approved is encouraged to gain more experience with code submission and code review in order to gain further mastery over the codebase. Partial approval is also possible (e.g. a person may be granted the ability to handles patches only on a certain repository), and full approval may be granted after the contributor has gained more experience.
New core contributors will be assigned a mentor that is either a TST member or existing core contributor. The mentor will serve as the primary point of contact to help onboard the new core contributors and answer any questions they have with their new responsibilities. The mentor is not the only point of contact, and core contributors should feel free to reach out to others if and when they have questions or concerns.
Guidelines for Core Contributors¶
Contributions in VOLTHA can should be merged after two different +1 arrive on a given patch-set that is verified by CI as well. For your own contributions, you now have the ability to approve and merge your own code, pending that you received two other positive reviews. For larger or potentially controversial reviews, please give the community an opportunity (at least a few business days) to review your contribution. Please always ask for comments on the #voltha-dev Slack channel. With great power comes great responsibility; please don’t abuse this privilege.
All Core Contributors have +2 and merge capabilities on all the repositories related to the VOLTHA project, but we expect that they are responsible and exercise their privilege only on patches and repositories they have expertise in and are comfortable reviewing and merging.
To help patchset verification the VOLTHA test infrastructure offers Per-Patchset Verification Jobs triggered by specific keyword used in the patch. More information can be found in the testing automation page We suggest Core contributors to use these triggers when they would like more checks on a patch they are uncertain about or that might have differences when applied to hardware pods.
VOLTHA follows Google’s best practices for code review. You should apply these guidelines strictly and with confidence when reviewing submissions.
If you are unsure about something in an issue or a review, leave a comment that outlines your concerns. If a resolution is difficult to reach in the comments section, the TST meetings are a good place to raise your concerns and have a discussion.
Current Core Contributors¶
This is a list of core contributors divided by area of expertise:
Adapter openonu and omci-lib-go:
to be assigned
Olt adapter, rw-core:
Build system, makefiles, reviews:
All of the codebase: