How do I start a code review?

There are several ways:

Important

If your Helix Versioning Engine is configured as a commit-edge deployment, and your normal connection is to an edge server, Swarm refuses to start reviews for shelved changes that have not been promoted to the commit server.

Within Swarm, this means that the Request Review button does not appear for unpromoted shelved changes. Outside of Swarm, attempts to start reviews for unpromoted shelved changelists appear to do nothing. Ask your Helix Versioning Engine administrator for assistance if you cannot start a review.

An administrator of the Helix Versioning Engine can automatically promote shelved changes to the commit server by setting the configurable dm.shelve.promote to 1.

  1. When you use Swarm to view a shelved changelist, click the Request Review 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: https://myswarm.url/54321

  2. When you use Swarm to view a submitted change, click the Request Review button to request a review of that change.

  3. When you are about to shelve or submit files:

    1. 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, where 12345 is the review's identifier.

      Note

      The #review keyword is customizable. For details, see Review keyword.

    2. 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 @*userid, that user becomes a required reviewer. See Required reviewers for details.

    3. 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.

  4. 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/new
    

    task1 is the name of the current Git task branch, and master 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

Note

If you are using P4V and its Swarm integration, and you encounter the error Host requires authentication, ask your Helix Versioning Engine administrator for assistance. See P4V Authentication for details.

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.