Skip to content

Commit 4157858

Browse files
FAB-7438 update CONTRIBUTING with clearer guide
add tutorial for landing first commit. update contributing, etc accordingly. Change-Id: I8fd22b8bf02de6c5de96c671b816c93c5744d1de Signed-off-by: Christopher Ferris <chrisfer@us.ibm.com>
1 parent fc4298b commit 4157858

File tree

11 files changed

+255
-112
lines changed

11 files changed

+255
-112
lines changed

docs/source/CONTRIBUTING.rst

Lines changed: 35 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,6 @@ access to all the Hyperledger community development tools, including
2727
`Jira <https://jira.hyperledger.org>`__ and the
2828
`Wiki <https://wiki.hyperledger.org/start>`__ (for editing, only).
2929

30-
Setting up your SSH key
31-
~~~~~~~~~~~~~~~~~~~~~~~
32-
33-
For Gerrit, before you can submit any change set for review, you will
34-
need to register your public SSH key. Login to
35-
`Gerrit <https://gerrit.hyperledger.org>`__ with your
36-
:doc:`LFID <Gerrit/lf-account>`, and click on your name in the upper
37-
right-hand corner of your browser window and then click 'Settings'. In
38-
the left-hand margin, you should see a link for 'SSH Public Keys'.
39-
Copy-n-paste your `public SSH
40-
key <https://help.github.com/articles/generating-an-ssh-key/>`__ into
41-
the window and press 'Add'.
42-
4330
Getting help
4431
------------
4532

@@ -54,29 +41,38 @@ and will be glad to help. The only silly question is the one you don't
5441
ask. Questions are in fact a great way to help improve the project as
5542
they highlight where our documentation could be clearer.
5643

57-
Requirements and Use Cases
58-
--------------------------
59-
60-
We have a `Requirements
61-
WG <https://wiki.hyperledger.org/groups/requirements/requirements-wg>`__
62-
that is documenting use cases and from those use cases deriving
63-
requirements. If you are interested in contributing to this effort,
64-
please feel free to join the discussion in
65-
`chat <https://chat.hyperledger.org/channel/requirements/>`__.
66-
6744
Reporting bugs
6845
--------------
6946

70-
If you are a user and you find a bug, please submit an issue using
47+
If you are a user and you have found a bug, please submit an issue using
7148
`JIRA <https://jira.hyperledger.org/secure/Dashboard.jspa?selectPageId=10104>`__.
72-
Please try to provide sufficient information for someone else to reproduce the
49+
Before you create a new JIRA issue, please try to search the existing items to
50+
be sure no one else has previously reported it. If it has been previously
51+
reported, then you might add a comment that you also are interested in seeing
52+
the defect fixed.
53+
54+
.. note:: If the defect is security-related, please follow the Hyperledger
55+
`security bug reporting process <https://wiki.hyperledger.org/security/bug-handling-process>`.
56+
57+
If it has not been previously reported, create a new JIRA. Please try to provide
58+
sufficient information for someone else to reproduce the
7359
issue. One of the project's maintainers should respond to your issue within 24
7460
hours. If not, please bump the issue with a comment and request that it be
7561
reviewed. You can also post to the relevant fabric channel in
7662
`Hyperledger Rocket Chat <https://chat.hyperledger.org>`__. For example, a doc bug should
7763
be broadcast to ``#fabric-documentation``, a database bug to ``#fabric-ledger``,
7864
and so on...
7965

66+
Submitting your fix
67+
-------------------
68+
69+
If you just submitted a JIRA for a bug you've discovered, and would like to
70+
provide a fix, we would welcome that gladly! Please assign the JIRA issue to
71+
yourself, then you can submit a change request (CR).
72+
73+
.. note:: If you need help with submitting your first CR, we have created a
74+
brief :doc:`tutorial <submit_cr>` for you.
75+
8076
Fixing issues and working stories
8177
---------------------------------
8278

@@ -117,29 +113,12 @@ Getting the support of three or more of the Hyperledger Fabric maintainers for t
117113
feature will greatly enhance the probability that the feature's related CRs
118114
will be merged.
119115

120-
Working with a local clone and Gerrit
121-
-------------------------------------
122-
123-
We are using
124-
`Gerrit <https://gerrit.hyperledger.org/r/#/admin/projects/fabric>`__ to
125-
manage code contributions. If you are unfamiliar, please review this
126-
:doc:`document <Gerrit/gerrit>` before proceeding.
127-
128-
After you have familiarized yourself with ``Gerrit``, and maybe played
129-
around with the ``lf-sandbox``
130-
`project <https://gerrit.hyperledger.org/r/#/admin/projects/lf-sandbox,branches>`__,
131-
you should be ready to set up your local development
132-
:doc:`environment <dev-setup/devenv>`.
116+
Setting up development environment
117+
----------------------------------
133118

134119
Next, try :doc:`building the project <dev-setup/build>` in your local
135120
development environment to ensure that everything is set up correctly.
136121

137-
The :doc:`logging-control` document describes how to tweak
138-
the logging levels of various components within Hyperledger Fabric. Finally,
139-
every source file needs to include a
140-
`license header <https://github.com/hyperledger/fabric/blob/master/docs/source/dev-setup/headers.txt>`__: modified to include a copyright
141-
statement for the principle author(s).
142-
143122
What makes a good change request?
144123
---------------------------------
145124

@@ -189,9 +168,9 @@ What makes a good change request?
189168
bunch of generated code (protobufs, etc.). Again, there can be
190169
exceptions.
191170

192-
Note: large change requests, e.g. those with more than 300 LOC are more likely
193-
than not going to receive a -2, and you'll be asked to refactor the change
194-
to conform with this guidance.
171+
.. note:: Large change requests, e.g. those with more than 300 LOC are more likely
172+
than not going to receive a -2, and you'll be asked to refactor the
173+
change to conform with this guidance.
195174

196175
- Do not stack change requests (e.g. submit a CR from the same local branch
197176
as your previous CR) unless they are related. This will minimize merge
@@ -203,18 +182,19 @@ What makes a good change request?
203182
character title, followed by a blank line, followed by a more
204183
comprehensive description of the change. Each change MUST include the JIRA
205184
identifier corresponding to the change (e.g. [FAB-1234]). This can be
206-
in the title but should also be in the body of the commit message.
207-
208-
Note that Gerrit will automatically create a hyperlink to the JIRA item.
185+
in the title but should also be in the body of the commit message. See the
186+
:doc:`complete requirements <Gerrit/changes>` for an acceptable change
187+
request.
209188

210-
e.g.
189+
.. note:: That Gerrit will automatically create a hyperlink to the JIRA item.
190+
e.g.
211191

212-
::
192+
::
213193

214-
[FAB-1234] fix foobar() panic
194+
[FAB-1234] fix foobar() panic
215195

216-
Fix [FAB-1234] added a check to ensure that when foobar(foo string) is called,
217-
that there is a non-empty string argument.
196+
Fix [FAB-1234] added a check to ensure that when foobar(foo string)
197+
is called, that there is a non-empty string argument.
218198

219199
Finally, be responsive. Don't let a change request fester with review
220200
comments such that it gets to a point that it requires a rebase. It only

docs/source/Gerrit/changes.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Informationally, ``commit messages`` must include:
3131
- **why** you chose that approach, and
3232
- **how** you know it works -- for example, which tests you ran.
3333

34-
Commits must :doc:`build cleanly <../dev-setup/build>` when applied in
34+
Commits must :doc:`build cleanly <../dev-setup/build>` when applied on
3535
top of each other, thus avoiding breaking bisectability. Each commit
3636
must address a single identifiable issue and must be logically
3737
self-contained.
@@ -70,4 +70,3 @@ will not be part of the final set, please let the reviewers know this.
7070

7171
.. Licensed under Creative Commons Attribution 4.0 International License
7272
https://creativecommons.org/licenses/by/4.0/
73-

docs/source/Gerrit/gerrit.rst

Lines changed: 17 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Working with Gerrit
2-
===================
2+
-------------------
33

44
Follow these instructions to collaborate on Hyperledger Fabric
55
through the Gerrit review system.
@@ -24,25 +24,16 @@ process <reviewing>`. However, anyone is welcome to (and
2424
encouraged!) review changes, and hence may find that document of value.
2525

2626
Git-review
27-
----------
27+
~~~~~~~~~~
2828

2929
There's a **very** useful tool for working with Gerrit called
3030
`git-review <https://www.mediawiki.org/wiki/Gerrit/git-review>`__. This
3131
command-line tool can automate most of the ensuing sections for you. Of
3232
course, reading the information below is also highly recommended so that
3333
you understand what's going on behind the scenes.
3434

35-
Sandbox project
36-
---------------
37-
38-
We have created a `sandbox
39-
project <https://gerrit.hyperledger.org/r/#/admin/projects/lf-sandbox>`__
40-
to allow developers to familiarize themselves with Gerrit and our
41-
workflows. Please do feel free to use this project to experiment with
42-
the commands and tools, below.
43-
4435
Getting deeper into Gerrit
45-
--------------------------
36+
~~~~~~~~~~~~~~~~~~~~~~~~~~
4637

4738
A comprehensive walk-through of Gerrit is beyond the scope of this
4839
document. There are plenty of resources available on the Internet. A
@@ -52,7 +43,7 @@ provided a set of :doc:`Best Practices <best-practices>` that you may
5243
find helpful.
5344

5445
Working with a local clone of the repository
55-
--------------------------------------------
46+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5647

5748
To work on something, whether a new feature or a bugfix:
5849

@@ -65,14 +56,14 @@ To work on something, whether a new feature or a bugfix:
6556
``Clone with git hook`` URL. Be sure that ``ssh`` is also selected,
6657
as this will make authentication much simpler:
6758

68-
::
59+
.. code::
6960
70-
git clone ssh://LFID@gerrit.hyperledger.org:29418/fabric && scp -p -P 29418 LFID@gerrit.hyperledger.org:hooks/commit-msg fabric/.git/hooks/
61+
git clone ssh://LFID@gerrit.hyperledger.org:29418/fabric && scp -p -P 29418 LFID@gerrit.hyperledger.org:hooks/commit-msg fabric/.git/hooks/
7162
72-
**Note:** if you are cloning the fabric project repository, you will
73-
want to clone it to the ``$GOPATH/src/github.com/hyperledger`` directory
74-
so that it will build, and so that you can use it with the Vagrant
75-
:doc:`development environment <../dev-setup/devenv>`.
63+
.. note:: If you are cloning the fabric project repository, you will
64+
want to clone it to the ``$GOPATH/src/github.com/hyperledger``
65+
directory so that it will build, and so that you can use it
66+
with the Vagrant :doc:`development environment <../dev-setup/devenv>`.
7667

7768
4. Create a descriptively-named branch off of your cloned repository
7869

@@ -96,18 +87,18 @@ Then input precise and readable commit msg and submit.
9687
change will be reversed as well.
9788

9889
Submitting a Change
99-
-------------------
90+
~~~~~~~~~~~~~~~~~~~
10091

10192
Currently, Gerrit is the only method to submit a change for review.
10293

103-
**Note:** Please review the :doc:`guidelines <changes>` for making and
104-
submitting a change.
94+
.. note:: Please review the :doc:`guidelines <changes>` for making and
95+
submitting a change.
10596

10697
Using git review
107-
~~~~~~~~~~~~~~
98+
~~~~~~~~~~~~~~~~
10899

109-
**Note:** if you prefer, you can use the `git-review <#git-review>`__
110-
tool instead of the following. e.g.
100+
.. note:: if you prefer, you can use the `git-review <#git-review>`__
101+
tool instead of the following. e.g.
111102

112103
Add the following section to ``.git/config``, and replace ``<USERNAME>``
113104
with your gerrit id.
@@ -129,7 +120,7 @@ When you update your patch, you can commit with ``git commit --amend``,
129120
and then repeat the ``git review`` command.
130121

131122
Not using git review
132-
~~~~~~~~~~~~~~~~~~
123+
~~~~~~~~~~~~~~~~~~~~
133124

134125
See the :doc:`directions for building the source code <../dev-setup/build>`.
135126

@@ -167,34 +158,6 @@ this:
167158

168159
The gerrit server generates a link where the change can be tracked.
169160

170-
Adding reviewers
171-
----------------
172-
173-
Optionally, you can add reviewers to your change.
174-
175-
To specify a list of reviewers via the command line, add
176-
``%r=reviewer@project.org`` to your push command. For example:
177-
178-
::
179-
180-
git push origin HEAD:refs/for/master%r=rev1@email.com,r=rev2@notemail.com
181-
182-
Alternatively, you can auto-configure GIT to add a set of reviewers if
183-
your commits will have the same reviewers all at the time.
184-
185-
To add a list of default reviewers, open the :file:``.git/config`` file
186-
in the project directory and add the following line in the
187-
``[ branch “master” ]`` section:
188-
189-
::
190-
191-
[branch "master"] #.... push =
192-
HEAD:refs/for/master%r=rev1@email.com,r=rev2@notemail.com`
193-
194-
Make sure to use actual email addresses instead of the
195-
``@email.com and @notemail.com`` addressses. Don't forget to replace
196-
``origin`` with your git remote name.
197-
198161
Reviewing Using Gerrit
199162
----------------------
200163

@@ -247,4 +210,3 @@ link <https://gerrit.hyperledger.org/r/#/dashboard/self>`__
247210

248211
.. Licensed under Creative Commons Attribution 4.0 International License
249212
https://creativecommons.org/licenses/by/4.0/
250-

docs/source/images/AddSSH1.png

161 KB
Loading

docs/source/images/AddSSH2.png

307 KB
Loading

docs/source/images/GitCloneCmd.png

219 KB
Loading

docs/source/images/NewGerritUI.png

31.2 KB
Loading

docs/source/images/SSHKeys.png

141 KB
Loading

docs/source/images/Settings.png

107 KB
Loading

docs/source/images/lf-sandbox.png

129 KB
Loading

0 commit comments

Comments
 (0)