4. Code Review
   
4. Code Review
This chapter describes the purpose of the GitCentric Code Review menu, which serves as a gateway to the third-party Gerrit Code Review tool. To learn how to use Gerrit Code Review in GitCentric, see Enable/Disable Code Review on page 52.
Opening the Code Review Page
To open the Code Review page, click the Code Review tab:
Overview of Gerrit Code Review
GitCentric incorporates the open source Gerrit Code Review tool, which provides web-based code review and project management for Git-based projects. GitCentric administrators can decide whether or not to require users to include Code review in their workflow. Even if your site does not require you to perform code reviews, GitCentric makes use of Gerrit’s group-based ACLs and administration features.
Differences from Standalone Gerrit Code Review
You access Gerrit Code Review from the Code Review tab in the GitCentric UI (shown in the illustration at the top of the page). Log-in and registration are handled through the GitCentric UI (see Log In to GitCentric on page 14).
If you are familiar with Gerrit Code Review, you may notice the following differences from a standalone Gerrit Code Review installation.
 
Item
Description
A
Top-level menu items take you to the GitCentric GUI:
Project takes you to the Repositories page
People takes you to the Groups page
Commits takes you to the Commits page
B
The Settings link takes you to the My Account page in the GitCentric UI (see Chapter 3 My Account).
C
The SHA of the GitCentric build you are using.
D
Use this link to contact Micro Focus customer support about a GitCentric issue. Use the Report Bug link to contact Gerrit about issues with Gerrit Code Review.
Otherwise, all other Gerrit Code Review functionality is handled through the Gerrit UI, and documentation for Gerrit features is handled by the Gerrit on-line help. Gerrit Code Review has its own documentation, which you can find here:
http://gerrit-documentation.googlecode.com/svn/Documentation/2.7/index.html
Tip: Administration features are accessed from the GitCentric, and not the Gerrit, UI. (In GitCentric, the Administration menu takes you to the Administration page in the GitCentric UI; see Chapter 5 Administration.)
Code Review for Users of Differing Backgrounds
Experienced Git users: If you are a Git user who is new to both Gerrit and AccuRev, you will continue to use Git the same way you always have. However, if code review is enforced at your site, you may now need to configure your clones to push to a special code review branch (see Create a Clone From a GitCentric Repository on page 19). Your changes will need to be approved by others, and you may be requested to approve other people’s changes. In any case, once your changes are approved and pushed to the repository, GitCentric automatically synchronizes them with the appropriate stream in AccuRev. Likewise, when you do a pull, fetch, or clone, you may find that changes have been synchronized from the AccuRev stream.
Experienced AccuRev users: If you are an experienced AccuRev user, your site may have you continue to manage your changes in AccuRev SCM. If so, you may never need to log into GitCentric or use code review. But if you start working in Git, you will use GitCentric to access the code review features, and to manage your account.
Experienced Gerrit users: If you are an experienced Gerrit user, not much has changed: You push your updates in Git, and they get code-reviewed in Gerrit. If you are a reviewer, you will log in through GitCentric, and then go directly to Gerrit where you will perform Gerrit operations the same way you always have. However, your changes will now be automatically synced between the repository and the AccuRev stream to which it is mapped. (And if changes are made in the AccuRev stream, they will automatically be synced with the corresponding repository, and you will see them the next time you do a pull/fetch/clone command.) The Settings link now goes to the GitCentric UI, and administrators will find that all administrative functions now appear through the GitCentric UI.
Regardless of your experience and your expertise, you should be aware that the four components that you may work with (Git, Gerrit, GitCentric, and AccuRev) each have their own documentation and knowledge base. Several excellent sites exist on the web for Git and Gerrit; and Gerrit, GitCentric, and AccuRev all have extensive on-line help. And you should have at least one experienced user or administrator at your site who is knowledgeable about each of these technologies.
Gerrit Code Review and AccuRev Mappings
The mapping between Git repositories and AccuRev streams is generally transparent to Gerrit Code Review users, but you should be aware of the added meaning of the “Merged” status when a change has been approved: in a mapped GitCentric environment, merged not only indicates that the changes have been merged in the repository, but they have also been successfully imported to the AccuRev stream. If you cannot get to the “Merged” status, you should check for error messages on the Gerrit Code Review page and troubleshoot any issues preventing the import.
Troubleshooting
If you have difficulty submitting an approved change and cannot import it to AccuRev (as indicated by a “Merge Pending” or some other status), check the following:
Look for error messages in the “Change comments” area
Have an administrator check that the following group ACLs are correct for the repository: Submit, Label Code Review, and Label Verified
Ensure that the commit parentage is up to date, and rebase if necessary
Examine the dependencies list for any changes that need to be submitted before the current change will merge
Check the kandoGerrit.log for errors
Check the kandoBridge.log for errors