How do I start a code review?
There are several ways:
-
When you use Swarm to view a shelved changelist, click the button to request a review of that shelved change.
Note
To view a shelved changelist, use a Quick URL. For example, if your shelved change is
54321
, visit the URL:http://myswarm/
54321
-
When you use Swarm to view a submitted change, click the button to request a review of that change.
-
When you are about to shelve or submit files:
-
Include
#review
within your changelist description (separated from other text with whitespace, or on a separate line).Once the review begins, Swarm replaces
#review
with#review-12345
, where12345
is the review's identifier.Note
The
#review
keyword is customizable. For details, see “Review keyword”. -
At this time, you can add reviewers to the code review by using an @mention in the changelist description for each desired reviewer.
If your @mention includes an asterisk (
*
) before the userid, for example@*
, that user becomes a required reviewer. See “Required reviewers” for details.userid
-
Complete your shelve or submit operation.
Warning!
If you shelve a change and subsequently edit the description to include
#review
, a review is not started. You must re-shelve the files after adding#review
. -
-
When you are using Git Fusion, you can start a review by pushing your changes to a target branch using the following command:
$ git push origin
task1
:review/master
/newtask1
is the name of the current Git task branch, andmaster
is the target branch that the proposed changes are intended for.Important
The target branch must be mapped to a named Perforce branch in the Git Fusion repo configuration.
See "Setting up Repos" in the Git Fusion Guide for details on converting a lightweight branch into a fully populated Perforce branch.
When the command completes, the output indicates the review id that has been created:
remote: Perforce: Swarm review assigned: review/master/
1234
where
1234
is the review id that was just created.Tip
For more information on Git Fusion, see the Git Fusion Guide
Once a review has started
Wait for someone else to review your code, or see: “How do I contribute comments or code changes to a code review?”. More review activities are available.