About the code review process

As authors and reviewers perform tasks, files move through the code review process and the review status changes. See Understanding code review status.

The following flowchart illustrates the built-in code review workflow, which uses triggers to automatically email users when reviews are started and completed.

You can add triggers to automate additional code review and file actions, such as setting custom field values when review events are performed or setting workflow states based on the status of individual files in code reviews. See Automating actions with triggers.

Common tasks

Following are details about code review tasks that move files through the review workflow.

1. Create a code review to group files that need review

Authors are responsible for submitting changes for review and incorporating review feedback. Authors typically create their own code reviews. For example, you may want to create a code review before making changes so it is available as you work with the files, or you may want to wait to create the code review until you are ready to check in multiple related files that need review.

Administrators or team leads may want to create code reviews for other users. For example, at the beginning of a release, the team lead may want to create a review for each new feature and select the authors and reviewers before files are updated.

See Creating code reviews.

2. Add files to the review

New code reviews have a Work in Progress status. You can add files to reviews when adding and checking in files to Surround SCM. You can also add files to reviews from the Code Review and Source Tree windows and when viewing file history, promoting or rebasing files, or analyzing risk of files attached to issues. See Adding files to code reviews.

If you use Helix ALM or a third-party issue tracking tool, you can analyze risk to identify potential problems in source files attached to issues and identify files that may need code review. See Analyzing issue risk in files.

3. Start the review

When all files needing review are added to the code review, start it to indicate it is ready for review and automatically email the reviewers. See Starting code reviews. The code review status changes to Awaiting Review.

4. Reviewers review files and add comments

Reviewers open the code review and add comments for authors to address. See Reviewing files in code reviews. When they finish reviewing individual files, they mark them as completed in the code review. The authors are notified that the code review is complete after all reviewers complete their reviews.

You can also review files and add comments to them any time without using the code review process. See Reviewing files and Reviewing changes between file versions.

5. Authors address review comments

Files with unaddressed review comments have a Needs Attention status. Authors make the necessary changes to these files, replace the file in the code review with the updated version, and then mark the comments as addressed. See Addressing code review comments.

6. Repeat the review until all files are approved

After all the review comments are addressed, restart the review. The review process may repeat multiple times. Reviews are approved when all reviewers approve all files in them.

Reports can help you analyze code review data. Code review reports include historical information about a code review and files in it. Use these reports to review unaddressed comments, review your code review process, or save process information for audits. See Running code review reports. Code review coverage reports include information about file versions in code reviews and if the files reviews are complete or still in progress. Use these reports to determine if you are ready to release your product, measure coverage of your code review process, or demonstrate quality control during an audit. See Creating code review coverage reports.