[U-Boot] u-boot gerrit server
Vadim Bendebury (вб)
vbendeb at google.com
Tue Nov 12 06:21:27 CET 2013
Gentlemen, I have not forgotten our discussion regarding setting up a
sample gerrit server for u-boot during the ELCE mini-summit. Sorry
for this long and not very clear email, if there is any interest I
will be glad to answer questions and address concerns to the best of
my ability, and I am sure Simon (sjg@) will pitch in.
Gerrit is used for many different projects now, I spoke with coreboot
maintainer who moved their process from email to gerrit - he said it
involved a certain threshold effort, but after that the entire
community was extremely pleased with the result - none of the patches
were lost in more than a year after the transition. Of course coreboot
is a much smaller project than u-boot, but both Android and Chrome OS
also successfully use gerrit.
You can now see the sample u-boot gerrit server at
https://u-boot-review.googlesource.com/#/q/status:open,n,z which is a
code review interface to the actual gerrit based git server at
u-boot.googlesource.com, which in turn is a mirror of the denx u-boot
git reporsitory. This particular gerrit server runs on Google
infrastructure, replicated in three different datacenters across the
world, each having a 10GB/s uplink, with 99.999 reliability. But of
course it could be set up on a dedicated server anywhere.
There is plenty of documentation available (just click on the
'Documentation' link in the top of the page). I will try to give just
a brief description.
For the purposes of this demo the patches submitted for review were
generated by a script I wrote. The script scrapes
http://patchwork.ozlabs.org/project/uboot/list/, downloads the patches
from there and tries applying them. Not all patches apply cleanly (as
some of them are for branches).
If the patch applies cleanly, the script adds two stanzas to the patch
description
- Change-Id: generated by git
- Patch-At: a reference to the patchwork page where the patch was
downloaded from
and uploads the patch for review as the user named 'Gerrit Tester'.
Each upload creates a new git branch just for review purposes.
Change-Id is required by gerrit as a universally unique identifier,
which will allow to group together multiple versions of the same
patch. When the patch with a known Change-ID is uploaded, the review
server creates a revision and allows to see the differences between
the revisions. Local modifications required to have git generate the
Change-Id: stanza are described in
https://gerrit-review.googlesource.com/Documentation/user-upload.html
Any one can upload patches to this server after creating an account on
it. Any Google account will do, or if you don't want to have a Google
based email you can create the account using your existing email.
Follow the prompts after clicking on 'Sign in' link on the top right.
After signing up one should create a password for authentication with
the server. Click on the little black triangle next to your name in
the top right, then on 'Settings' and then on 'HTTP Password'. Save
the lines generated by this in ~/.netrc (with permissions set to 0400)
and you are good to go.
Now clone the repository using
git clone https://u-boot.googlesource.com/u-boot
(or just add it as a remote to your existing u-boot tree) and now you
can upload patches using
git push https://u-boot.googlesource.com/u-boot HEAD:refs/for/master
=== How review process works ====
For an example comment/modification upload cycle I picked this change:
https://u-boot-review.googlesource.com/#/c/1146
Say the comment was that the definition in line 419 on
https://u-boot-review.googlesource.com/#/c/1146/1/common/console.c
shoudl use #if defined() instead of #ifdef
The reviewer double clicks on the line where he wants to leave a
comment, a form opens, where the reviewer adds the comment. Then he
submits the form, and the comment gets associated with the line. Once
all comments are added, they can be published. As a result the author,
all other reviewers and any configured mailing list receive the
comments in the email:
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
Vadim Bendebury has posted comments on this change.
Change subject: sandbox: Allow the console to work earlier
......................................................................
Patch Set 1:
(1 comment)
https://u-boot-review.googlesource.com/#/c/1146/1/common/console.c
File common/console.c:
Line 419: #ifdef CONFIG_SANDBOX
could this be #if defined() instead?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Let's say at this point the author can reply to the comment using the
same web interface, and make a modification. After that
git commit --amend -s
will ensure that the new patch keeps the old Change-ID. After the
change has been committed, it can be uploaded:
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
$ git push https://u-boot.googlesource.com/u-boot HEAD:refs/for/master
remote: Resolving deltas: 100% (8/8)
remote: Processing changes: updated: 1, done
remote: (W) ae78aca: commit message lines >70 characters; manually wrap lines
remote:
remote: Updated Changes:
remote: https://u-boot-review.googlesource.com/1146
remote:
To https://u-boot.googlesource.com/u-boot
* [new branch] HEAD -> refs/for/master
$
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Now one can see two patch sets on this patch's page:
https://u-boot-review.googlesource.com/#/c/1141/
Once the change has been reviewed and agreed upon, the custodian could
cherry pick its latest version and submit to the master repository. In
the most usual case the gerrit server would be that master repository
- in that case all the custodian needs to do is to clikc on the
'publish' button.
This server is not configured yet, but in general gerrit allows for
three levels of reviewers - those who can just comment, those who can
assign a +1 rating to the change (an equivalent of an acked by) and
those who can assign a +2 rating or push the change (the custodians).
There is no point in setting these up on a mirror, but if so desired,
it could be done.
I encourage any one to give this a try, try playing with it, upload
patches, try commenting, sending reviews, upload new patch versions,
etc.
More information about the U-Boot
mailing list