This document describes how to use the new code review instance used by Linaro.
The code review instance is running gerrit.
This new gerrit instance is meant for projects and teams that want to move from Launchpad to a fully Linaro git solution, and needs a tool to perform code reviews. It can be used also by all the other projects and teams in Linaro.
For more information on gerrit, refer to its user manual at: https://review.linaro.org/Documentation/index.html
Who can use it
All Linaro employees, and all the people that have an account on Linaro Login.
If in doubt, ask IT services.
To sign in, you will be redirected to the Linaro SSO page: use your Linaro email address and your password, and grant access to the code review URL.
Visit https://review.linaro.org/#/settings/ssh-keys (Your name in top right corner -> Settings -> SSH Public Keys) and verify that it contains your public SSH key. If there's no your public SSH user key there, please add it using "Add Key..." button. Make sure to use the same key as you added to Linaro Login page: https://login.linaro.org.
Testing that it works
To test that everything works correctly, just run:
ssh -p29418 $YOUR_GERRIT_USERNAME@review.linaro.org
Where $YOUR_GERRIT_USERNAME is the username you see once logged in on review.linaro.org:
- From the top right corner, click on the shown name, and choose Settings
You will see your gerrit Profile, with your username in "Username" field. Use that.
- If "Username" field is empty, you should see a button to set it. Please set it to "first.last" username which matches your Linaro email.
You should see something like:
**** Welcome to Gerrit Code Review ****
Pushing Changes for Review
It is recommended you use the git-review tool instead of pushing to "refs/for/". If you have write access to the repository and push "refs/for" to your branch, Gerrit will not be able to use this space to publish a review.
Note: if you are doing this on a brand new repository that you created locally, you first have to push the repository on the server in order to be able to work with the code review system.
Install the git-review package.
Branch off master, make your changes. When you are ready to request a review, run:
Each project that is using gerrit needs to have a .gitreview file at the root of the tree for this to work. The contents should be like this:
[gerrit] host=review.linaro.org port=29418 project=lava/lava-deployment-tool
Example .gitreview file for lava-deployment-tool
Interacting with Gerrit
The primary method of using gerrit to make comments on projects or submit scores is through the web interface. Documentation of the available features and a tour of the user interface is available in the Gerrit documentation for the Review UI.
Linaro gerrit servers also support the ability to "Reply by Email" which allows them to parse out change messages, inline comments, and file comments from email replies. See the link for some example usage.
With older versions of git-review, you had to init it with:
git review -s
This is not longer required, so don't do it, unless you know what you do.
When you create a repository on the git instance (as described here), the project will not show up automatically on gerrit.
The problem is with gerrit project_list cache. There is now a cron job that flush gerrit cache every hour. So, if you create a new project, you will have to wait at max 1 hour before it shows up in gerrit. If it is urgent, please talk with a gerrit admin or somebody from IT services.
If your change involves copying or migrating files from one git repository into another, the gerrit review hook will complain about a lack of ChangeId values in any commits prior to the migration. It is possible to add data to existing commits but if there are more than a couple, consider using a different mechanism to get the branch reviewed.
* If you run git-review -s after creating your branch, you need to add changeids to your commit messages. You can do this with interactive rebase, selecting 'reword' for each commit that needs a changeid. You probably shouldn't do this if you've published the patches.
Platform/Systems/CodeReviewServer (last modified 2018-02-15 18:24:19)