github.com/yacovm/fabric@v2.0.0-alpha.0.20191128145320-c5d4087dc723+incompatible/docs/source/CONTRIBUTING.rst (about)

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