views:

130

answers:

1

We're committed to git for code management. We're trying to find a tool that will help us systematize code reviews. We're considering Gerrit and Code Collaborator but would welcome other suggestions.

We're having a problem answering the question, "How do we know every commit was reviewed?" (Or "What commits have yet to be reviewed?")

One answer would be to submit every commit or every push for review and track incomplete reviews in the review tool. I'm not entirely happy with relying on a another tool -- especially if it's not open source -- to tell us this.

What seems to be a better answer is to rely on sign offs in git (e.g., "Signed-off-by: Chris Nelson") and use a hook in the review tool to sign off commits on behalf of the reviewer. And advantage of this is if we use some other review mechanism for some commits, we have just one place to look for results. One problem with this is that we can't require review before push because the review tool is unlikely to have access to the developer's private repository clone to add the sign-off.

Any ideas on integrating code review with code management to achieve ease of use and high visibility of unreviewed changes?

A: 

I see two ways to do this, each with its own drawbacks:

1) set up a Code Collaborator phase change trigger to automatically merge involved changelists from an 'unreviewed' branch to a 'reviewed' branch when a review is completed. The two main problems with this are: 1) what if the review is re-opened? and 2) the merges have to be able to work automatically.

2) Produce a simple report by writing a script that asks git for all the changelists involved in the main dev branch that you want reviewed and then asks Code Collaborator for the list of all the changelists in reviews that have been marked completed. Subtract the latter from the former and you end up with a list of unreviewed changelists on the main dev branch.

Disclaimer: I work for Smart Bear Software, makers of Code Collaborator

pjz