github.com/hechain20/hechain@v0.0.0-20220316014945-b544036ba106/docs/source/CONTRIBUTING.rst (about) 1 Contributions Welcome! 2 ====================== 3 4 We welcome contributions to Hyperledger in many forms, and there's always plenty 5 to do! 6 7 First things first, please review the Hyperledger `Code of 8 Conduct <https://wiki.hyperledger.org/community/hyperledger-project-code-of-conduct>`__ 9 before participating. It is important that we keep things civil. 10 11 .. note:: If you want to contribute to this documentation, please check out the :doc:`style_guide`. 12 13 Ways to contribute 14 ------------------ 15 There are many ways you can contribute to Hechain, both as a user and 16 as a developer. 17 18 As a user: 19 20 - `Making Feature/Enhancement Proposals`_ 21 - `Reporting bugs`_ 22 23 As a writer or information developer: 24 25 - Update the documentation using your experience of Fabric and this 26 documentation to improve existing topics and create new ones. A documentation 27 change is an easy way to get started as a contributor, makes it easier for 28 other users to understand and use Fabric, and grows your open source commit 29 history. 30 31 - Participate in a language translation to keep the Fabric documentation current 32 in your chosen language. The Fabric documentation is available in a number of 33 languages -- English, Chinese, Malayalam and Brazilian Portuguese -- so why 34 not join a team that keeps your favorite documentation up-to-date? You'll find 35 a friendly community of users, writers and developers to collaborate with. 36 37 - Start a new language translation if the Fabric documentation isn't 38 available in your language. The Chinese, Malayalam and Portuguese Brazilian 39 teams got started this way, and you can too! It's more work, as you'll have 40 to form a community of writers, and organize contributions; but it's really 41 fulfilling to see the Fabric documentation available in your chosen language. 42 43 Jump to `Contributing documentation`_ to get started on your journey. 44 45 As a developer: 46 47 - If you only have a little time, consider picking up a 48 `"good first issue" <https://github.com/hechain20/hechain/labels/good%20first%20issue>`_ task, 49 see `Fixing issues and working stories`_. 50 - If you can commit to full-time development, either propose a new feature 51 (see `Making Feature/Enhancement Proposals`_) and 52 bring a team to implement it, or join one of the teams working on an existing Epic. 53 If you see an Epic that interests you on the 54 `GitHub epic backlog <https://github.com/hechain20/hechain/labels/Epic>`_, 55 contact the Epic assignee via the GitHub issue. 56 57 Getting a Linux Foundation account 58 ---------------------------------- 59 60 In order to participate in the development of the Hechain 61 project, you will need a Linux Foundation 62 account. Once you have a LF ID you will be able to 63 access all the Hyperledger community tools, including 64 `RocketChat <https://chat.hyperledger.org/>`__, and the 65 `Wiki <https://wiki.hyperledger.org/display/fabric/Hyperledger+Fabric>`__ (for editing, only). 66 67 Follow the steps below to create a Linux Foundation account if you don't 68 already have one. 69 70 1. Go to the `Linux Foundation ID 71 website <https://identity.linuxfoundation.org/>`__. 72 73 2. Select the option ``I need to create a Linux Foundation ID``, and fill 74 out the form that appears. 75 76 3. Wait a few minutes, then look for an email message with the subject line: 77 "Validate your Linux Foundation ID email". 78 79 4. Open the received URL to validate your email address. 80 81 5. Verify that your browser displays the message 82 ``You have successfully validated your e-mail address``. 83 84 6. Access `RocketChat <https://chat.hyperledger.org/>`__ to confirm access. 85 86 Contributing documentation 87 -------------------------- 88 89 It's a good idea to make your first change a documentation change. It's quick 90 and easy to do, ensures that you have a correctly configured machine, (including 91 the required pre-requisite software), and gets you familiar with the 92 contribution process. Use the following topics to help you get started: 93 94 .. toctree:: 95 :maxdepth: 1 96 97 advice_for_writers 98 docs_guide 99 international_languages 100 style_guide 101 102 Project Governance 103 ------------------ 104 105 Hechain is managed under an open governance model as described in 106 our `charter <https://www.hyperledger.org/about/charter>`__. Projects and 107 sub-projects are lead by a set of maintainers. New sub-projects can 108 designate an initial set of maintainers that will be approved by the 109 top-level project's existing maintainers when the project is first 110 approved. 111 112 Maintainers 113 ~~~~~~~~~~~ 114 115 The Fabric project is lead by the project's top level `maintainers <https://github.com/hechain20/hechain/blob/main/MAINTAINERS.md>`__. 116 The maintainers are responsible for reviewing and merging all patches submitted 117 for review, and they guide the overall technical direction of the project within 118 the guidelines established by the Hyperledger Technical Steering Committee (TSC). 119 120 Becoming a maintainer 121 ~~~~~~~~~~~~~~~~~~~~~ 122 123 The project's maintainers will, from time-to-time, consider 124 adding a maintainer, based on the following criteria: 125 126 - Demonstrated track record of PR reviews (both quality and quantity of reviews) 127 - Demonstrated thought leadership in the project 128 - Demonstrated shepherding of project work and contributors 129 130 An existing maintainer can submit a pull request to the 131 `maintainers <https://github.com/hechain20/hechain/blob/main/MAINTAINERS.md>`__ file. 132 A nominated Contributor may become a Maintainer by a majority approval of the proposal 133 by the existing Maintainers. Once approved, the change set is then merged 134 and the individual is added to the maintainers group. 135 136 Maintainers may be removed by explicit resignation, for prolonged 137 inactivity (e.g. 3 or more months with no review comments), 138 or for some infraction of the `code of conduct 139 <https://wiki.hyperledger.org/community/hyperledger-project-code-of-conduct>`__ 140 or by consistently demonstrating poor judgement. A proposed removal 141 also requires a majority approval. A maintainer removed for 142 inactivity should be restored following a sustained resumption of contributions 143 and reviews (a month or more) demonstrating a renewed commitment to the project. 144 145 Releases 146 ~~~~~~~~ 147 148 Fabric provides a release approximately once every four months with new features and improvements. 149 New feature work is merged to the Fabric main branch on `GitHub <https://github.com/hyperledger/fabric>`__. 150 Releases branches are created prior to each release so that the code can stabilize while 151 new features continue to get merged to the main branch. 152 Important fixes will also be backported to the most recent LTS (long-term support) release branch, 153 and to the prior LTS release branch during periods of LTS release overlap. 154 155 See `releases <https://github.com/hyperledger/fabric#releases>`__ for more details. 156 157 Making Feature/Enhancement Proposals 158 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 159 160 Minor improvements can be implemented and reviewed via the normal `GitHub pull request workflow <https://guides.github.com/introduction/flow/>`__ but for changes that are more substantial Fabric follows the RFC (request for comments) process. 161 162 This process is intended to provide a consistent and controlled path for major changes to Fabric and other official project components, so that all stakeholders can be confident about the direction in which Fabric is evolving. 163 164 To propose a new feature, first, check the 165 `GitHub issues backlog <https://github.com/hechain20/hechain/issues>`__ and the `Fabric RFC repository <https://github.com/hyperledger/fabric-rfcs/>`__ to be sure that there isn't already an open (or recently closed) proposal for the same functionality. If there isn't, follow `the RFC process <https://github.com/hyperledger/fabric-rfcs/blob/main/README.md>`__ to make a proposal. 166 167 Contributor meeting 168 ~~~~~~~~~~~~~~~~~~~ 169 170 The maintainers hold regular contributors meetings. 171 The purpose of the contributors meeting is to plan for and review the progress of 172 releases and contributions, and to discuss the technical and operational direction of the project 173 and sub-projects. 174 175 Please see the 176 `wiki <https://wiki.hyperledger.org/display/fabric/Contributor+Meetings>`__ 177 for maintainer meeting details. 178 179 New feature/enhancement proposals as described above should be presented to a 180 maintainers meeting for consideration, feedback and acceptance. 181 182 Release roadmap 183 ~~~~~~~~~~~~~~~ 184 185 The Fabric release roadmap is managed as a list of 186 `GitHub issues with Epic label <https://github.com/hechain20/hechain/labels/Epic>`__. 187 188 Communications 189 ~~~~~~~~~~~~~~ 190 191 We use `RocketChat <https://chat.hyperledger.org/>`__ for communication 192 and Google Hangouts™ for screen sharing between developers. Our 193 development planning and prioritization is done using a 194 `GitHub Issues ZenHub board <https://app.zenhub.com/workspaces/fabric-57c43689b6f3d8060d082cf1/board>`__, and we take longer running 195 discussions/decisions to the `Fabric contributor meeting <https://wiki.hyperledger.org/display/fabric/Contributor+Meetings>`__ 196 or `mailing list <https://lists.hyperledger.org/mailman/listinfo/hyperledger-fabric>`__. 197 198 Contribution guide 199 ------------------ 200 201 Install prerequisites 202 ~~~~~~~~~~~~~~~~~~~~~ 203 204 Before we begin, if you haven't already done so, you may wish to check that 205 you have all the :doc:`prerequisites <prereqs>` installed on the platform(s) 206 on which you'll be developing blockchain applications and/or operating 207 Hechain. 208 209 Getting help 210 ~~~~~~~~~~~~ 211 212 If you are looking for something to work on, or need some expert 213 assistance in debugging a problem or working out a fix to an issue, our 214 `community <https://www.hyperledger.org/community>`__ is always eager to 215 help. We hang out on 216 `Chat <https://chat.hyperledger.org/channel/fabric/>`__, IRC 217 (#hyperledger on freenode.net) and the `mailing 218 lists <https://lists.hyperledger.org/>`__. Most of us don't bite :grin: 219 and will be glad to help. The only silly question is the one you don't 220 ask. Questions are in fact a great way to help improve the project as 221 they highlight where our documentation could be clearer. 222 223 Reporting bugs 224 ~~~~~~~~~~~~~~ 225 226 If you are a user and you have found a bug, please submit an issue using 227 `GitHub Issues <https://github.com/hechain20/hechain/issues>`__. 228 Before you create a new GitHub issue, please try to search the existing issues to 229 be sure no one else has previously reported it. If it has been previously 230 reported, then you might add a comment that you also are interested in seeing 231 the defect fixed. 232 233 .. note:: If the defect is security-related, please follow the Hyperledger 234 `security bug reporting process <https://wiki.hyperledger.org/display/SEC/Defect+Response>`__. 235 236 If it has not been previously reported, you may either submit a PR with a 237 well documented commit message describing the defect and the fix, or you 238 may create a new GitHub issue. Please try to provide 239 sufficient information for someone else to reproduce the 240 issue. One of the project's maintainers should respond to your issue within 24 241 hours. If not, please bump the issue with a comment and request that it be 242 reviewed. You can also post to the relevant Hechain channel in 243 `Hyperledger Chat <https://chat.hyperledger.org>`__. For example, a doc bug should 244 be broadcast to ``#fabric-documentation``, a database bug to ``#fabric-ledger``, 245 and so on... 246 247 Submitting your fix 248 ~~~~~~~~~~~~~~~~~~~ 249 250 If you just submitted a GitHub issue for a bug you've discovered, and would like to 251 provide a fix, we would welcome that gladly! Please assign the GitHub issue to 252 yourself, then submit a pull request (PR). Please refer to :doc:`github/github` 253 for a detailed workflow. 254 255 Fixing issues and working stories 256 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 257 258 Fabric issues and bugs are managed in `GitHub issues <https://github.com/hechain20/hechain/issues>`__. 259 Review the list of issues and find 260 something that interests you. You could also check the 261 `"good first issue" <https://github.com/hechain20/hechain/labels/good%20first%20issue>`__ 262 list. It is wise to start with something relatively straight forward and 263 achievable, and that no one is already assigned. If no one is assigned, 264 then assign the issue to yourself. Please be considerate and rescind the 265 assignment if you cannot finish in a reasonable time, or add a comment 266 saying that you are still actively working the issue if you need a 267 little more time. 268 269 While GitHub issues tracks a backlog of known issues that could be worked in the future, 270 if you intend to immediately work on a change that does not yet have a corresponding issue, 271 you can submit a pull request to `Github <https://github.com/hyperledger/fabric>`__ without linking to an existing issue. 272 273 Reviewing submitted Pull Requests (PRs) 274 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 275 276 Another way to contribute and learn about Hechain is to help the 277 maintainers with the review of the PRs that are open. Indeed 278 maintainers have the difficult role of having to review all the PRs 279 that are being submitted and evaluate whether they should be merged or 280 not. You can review the code and/or documentation changes, test the 281 changes, and tell the submitters and maintainers what you think. Once 282 your review and/or test is complete just reply to the PR with your 283 findings, by adding comments and/or voting. A comment saying something 284 like "I tried it on system X and it works" or possibly "I got an error 285 on system X: xxx " will help the maintainers in their evaluation. As a 286 result, maintainers will be able to process PRs faster and everybody 287 will gain from it. 288 289 Just browse through `the open PRs on GitHub 290 <https://github.com/hechain20/hechain/pulls>`__ to get started. 291 292 PR Aging 293 ~~~~~~~~ 294 295 As the Fabric project has grown, so too has the backlog of open PRs. One 296 problem that nearly all projects face is effectively managing that backlog 297 and Fabric is no exception. In an effort to keep the backlog of Fabric and 298 related project PRs manageable, we are introducing an aging policy which 299 will be enforced by bots. This is consistent with how other large projects 300 manage their PR backlog. 301 302 PR Aging Policy 303 ~~~~~~~~~~~~~~~ 304 305 The Fabric project maintainers will automatically monitor all PR activity for 306 delinquency. If a PR has not been updated in 2 weeks, a reminder comment will be 307 added requesting that the PR either be updated to address any outstanding 308 comments or abandoned if it is to be withdrawn. If a delinquent PR goes another 309 2 weeks without an update, it will be automatically abandoned. If a PR has aged 310 more than 2 months since it was originally submitted, even if it has activity, 311 it will be flagged for maintainer review. 312 313 If a submitted PR has passed all validation but has not been reviewed in 72 314 hours (3 days), it will be flagged to the #fabric-pr-review channel daily until 315 it receives a review comment(s). 316 317 This policy applies to all official Fabric projects (fabric, fabric-ca, 318 fabric-samples, fabric-test, fabric-sdk-node, fabric-sdk-java, fabric-sdk-go, fabric-gateway-java, 319 fabric-chaincode-node, fabric-chaincode-java, fabric-chaincode-evm, 320 fabric-baseimage, and fabric-amcl). 321 322 Setting up development environment 323 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 324 325 Next, try :doc:`building the project <dev-setup/build>` in your local 326 development environment to ensure that everything is set up correctly. 327 328 What makes a good pull request? 329 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 330 331 - One change at a time. Not five, not three, not ten. One and only one. 332 Why? Because it limits the blast area of the change. If we have a 333 regression, it is much easier to identify the culprit commit than if 334 we have some composite change that impacts more of the code. 335 336 - If there is a corresponding GitHub issue, include a link to the 337 GitHub issue in the PR summary and commit message. 338 Why? Because there will often be additional discussion around 339 a proposed change or bug in the GitHub issue. 340 Additionally, if you use syntax like "Resolves #<GitHub issue number>" 341 in the PR summary and commit message, the GitHub issue will 342 automatically be closed when the PR is merged. 343 344 - Include unit and integration tests (or changes to existing tests) 345 with every change. This does not mean just happy path testing, 346 either. It also means negative testing of any defensive code that it 347 correctly catches input errors. When you write code, you are 348 responsible to test it and provide the tests that demonstrate that 349 your change does what it claims. Why? Because without this we have no 350 clue whether our current code base actually works. 351 352 - Unit tests should have NO external dependencies. You should be able 353 to run unit tests in place with ``go test`` or equivalent for the 354 language. Any test that requires some external dependency (e.g. needs 355 to be scripted to run another component) needs appropriate mocking. 356 Anything else is not unit testing, it is integration testing by 357 definition. Why? Because many open source developers do Test Driven 358 Development. They place a watch on the directory that invokes the 359 tests automagically as the code is changed. This is far more 360 efficient than having to run a whole build between code changes. See 361 `this definition <http://artofunittesting.com/definition-of-a-unit-test/>`__ 362 of unit testing for a good set of criteria to keep in mind for writing 363 effective unit tests. 364 365 - Minimize the lines of code per PR. Why? Maintainers have day jobs, 366 too. If you send a 1,000 or 2,000 LOC change, how long do you think 367 it takes to review all of that code? Keep your changes to < 200-300 368 LOC, if possible. If you have a larger change, decompose it into 369 multiple independent changes. If you are adding a bunch of new 370 functions to fulfill the requirements of a new capability, add them 371 separately with their tests, and then write the code that uses them 372 to deliver the capability. Of course, there are always exceptions. If 373 you add a small change and then add 300 LOC of tests, you will be 374 forgiven;-) If you need to make a change that has broad impact or a 375 bunch of generated code (protobufs, etc.). Again, there can be 376 exceptions. 377 378 .. note:: Large pull requests, e.g. those with more than 300 LOC are more than likely 379 not going to receive an approval, and you'll be asked to refactor 380 the change to conform with this guidance. 381 382 - Write a meaningful commit message. Include a meaningful 55 (or less) 383 character title, followed by a blank line, followed by a more 384 comprehensive description of the change. 385 386 .. note:: Example commit message: 387 388 :: 389 390 [FAB-1234] fix foobar() panic 391 392 Fix [FAB-1234] added a check to ensure that when foobar(foo string) 393 is called, that there is a non-empty string argument. 394 395 Finally, be responsive. Don't let a pull request fester with review 396 comments such that it gets to a point that it requires a rebase. It only 397 further delays getting it merged and adds more work for you - to 398 remediate the merge conflicts. 399 400 Legal stuff 401 ----------- 402 403 **Note:** Each source file must include a license header for the Apache 404 Software License 2.0. See the template of the `license header 405 <https://github.com/hechain20/hechain/blob/main/docs/source/dev-setup/headers.txt>`__. 406 407 We have tried to make it as easy as possible to make contributions. This 408 applies to how we handle the legal aspects of contribution. We use the 409 same approach—the `Developer's Certificate of Origin 1.1 410 (DCO) <https://github.com/hechain20/hechain/blob/main/docs/source/DCO1.1.txt>`__—that the Linux® Kernel 411 `community <https://elinux.org/Developer_Certificate_Of_Origin>`__ uses 412 to manage code contributions. 413 414 We simply ask that when submitting a patch for review, the developer 415 must include a sign-off statement in the commit message. 416 417 Here is an example Signed-off-by line, which indicates that the 418 submitter accepts the DCO: 419 420 :: 421 422 Signed-off-by: John Doe <john.doe@example.com> 423 424 You can include this automatically when you commit a change to your 425 local git repository using ``git commit -s``. 426 427 Related Topics 428 -------------- 429 430 .. toctree:: 431 :maxdepth: 1 432 433 dev-setup/devenv 434 dev-setup/build 435 style-guides/go-style 436 437 .. Licensed under Creative Commons Attribution 4.0 International License 438 https://creativecommons.org/licenses/by/4.0/