Scott Baker | 4232d4f | 2022-03-31 10:52:37 -0700 | [diff] [blame] | 1 | Contributing to Aether |
| 2 | ====================== |
| 3 | |
| 4 | We'd love to accept your patches and contributions to the Aether 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 | Aether 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 | Aether uses Github and gerrit to submit, review, tests and finally merge patches. |
| 27 | |
| 28 | Submitting Code |
| 29 | """"""""""""""" |
| 30 | |
| 31 | Some 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 | |
| 43 | Steps 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 | |
| 66 | Steps 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 | |
| 95 | Core Contributors |
| 96 | ----------------- |
| 97 | |
| 98 | Anyone with a Gerrit account can open new issues, comment on existing issues, or |
| 99 | contribute code by opening a review. |
| 100 | |
| 101 | A **“core contributor”** is someone who can manage, approve and |
| 102 | merge patches, and create new branches in the main repository. |
| 103 | |
| 104 | Core contributors are responsible for maintaining the quality of contributions |
| 105 | to the codebase. The goal of this program is to have a diverse group of |
| 106 | individuals whose expertise in aggregate covers the entire project. |
| 107 | |
| 108 | The 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 | |
| 113 | Becoming a Core Contributor |
| 114 | """"""""""""""""""""""""""" |
| 115 | |
| 116 | Core contributor candidates need to have a demonstrated proficiency with the |
| 117 | Aether codebase and a track record of code reviews. Members of the Technical |
| 118 | Steering Team (TST) and existing core contributors will regularly invite people |
| 119 | to become new core contributors. Nominations can also be made (including |
| 120 | self-nominations) to the Aether TST (`aether-tst@opennetworking.org`) at any time. |
| 121 | |
| 122 | A good nomination will include details about who the person is (including their email |
| 123 | and Github and/or Gerrit username) and outline their experience with the Aether codebase |
| 124 | and project at large. |
| 125 | Nominations are intended to start a conversation that results in a decision to |
| 126 | make the person a core contributor – anyone whose nomination is not initially |
| 127 | approved is encouraged to gain more experience with code submission and code |
| 128 | review in order to gain further mastery over the codebase. Partial approval is |
| 129 | also possible (e.g. a person may be granted the ability to handles patches only |
| 130 | on a certain repository), and full approval may be granted after the contributor |
| 131 | has gained more experience. |
| 132 | |
| 133 | New core contributors will be assigned a mentor that is either a TST member or |
| 134 | existing core contributor. The mentor will serve as the primary point of contact |
| 135 | to help onboard the new core contributors and answer any questions they have |
| 136 | with their new responsibilities. The mentor is not the only point of contact, |
| 137 | and core contributors should feel free to reach out to others if and when they |
| 138 | have questions or concerns. |
| 139 | |
| 140 | Tips for Core Contributors |
| 141 | """""""""""""""""""""""""" |
| 142 | |
| 143 | For your own contributions, you now have the ability to approve and merge your |
| 144 | own code. For larger or potentially controversial reviews, please give the |
| 145 | community an opportunity (at least a few business days) to review your |
| 146 | contribution. Please always ask for comments on the #aether-dev Slack channel. |
| 147 | **With great power comes great responsibility; please don't abuse |
| 148 | this privilege.** |
| 149 | |
| 150 | Aether follows `Google’s best practices for code review |
| 151 | <https://google.github.io/eng-practices/review/reviewer/>`_. |
| 152 | You should apply these guidelines strictly and with confidence when reviewing |
| 153 | submissions. |
| 154 | |
| 155 | If you are unsure about something in an issue or a review, leave a comment |
| 156 | that outlines your concerns. If a resolution is difficult to reach in the |
| 157 | comments section, the TST meetings are a good place to raise your concerns and |
| 158 | have a discussion. |
| 159 | |
| 160 | Current Core Contributors |
| 161 | """"""""""""""""""""""""" |
| 162 | |
| 163 | All of the codebase: |
| 164 | |
| 165 | * Name... |
| 166 | |
| 167 | Community Guidelines |
| 168 | -------------------- |
| 169 | |
| 170 | This project follows `Google's Open Source Community Guidelines |
| 171 | <https://opensource.google.com/conduct/>`_ |
| 172 | and ONF's |
| 173 | `Code of Conduct <https://docs.opennetworking.org/policies/conduct.html>`. |