Activities

This section describes the major activities that affect code reviews, including starting a review, updating a review, and fetching a review's files.

Start a review

To start a code review, choose one of the following approaches:

Important

If your Helix Server 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 Server administrator for assistance if you cannot start a review.

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

Update a review

To update a code review, use one of the following approaches:

Fetch a review's files

First, determine the changelist containing the review's files:

  1. Visit the review's page.
  2. The current review version's changelist appears in the file list heading:

    Pre-commit Review Changelist in the File Heading image

    In this example, the changelist is 697707. You use the identified changelist in place of shelved changelist below.

  3. Decide whether you will use P4, P4V, or Git Fusion to fetch the files, and follow the instructions in the appropriate section below.

Using P4

  1. For a shelved changelist, use a command-line shell and type:

    $ p4 unshelve -s shelved changelist
  2. For a committed changelist, use a command-line shell and type:

    $ p4 sync @committed changelist
Note

Your client's view mappings need to include the changelist's path.

Using P4V

For a shelved changelist:

  1. Select Search > Go To.
  2. Change the select box to Pending Changelist.
  3. Type in the shelved changelist number and click OK.
  4. Select the files in the Shelved Files area.
  5. Right-click and select Unshelve.
  6. Click Unshelve.

For a committed changelist:

  1. Select Search > Go To.
  2. Change the select box to Submitted Changelist.
  3. Type in the submitted changelist number and click OK.
  4. Select the files in the Files area.
  5. Right-click and select Get this Revision.
  6. Click Close.

Using Git Fusion

In the following example, the current local task branch is task1, the target branch is master, the review id is 1234, the Git Fusion hostname is gfserver, and the remote repo name is p4gf_repo.

  1. Fetch the review's head version:

    $ git fetch --prune origin
    From gfserver:p4gf_repo
    * [new_branch] review/master/1234 -> origin/review/master/1234
    x [deleted] (none) -> origin/review/dev/new

    The --prune option lets the local Git repo delete the unwanted review/master/new reference created by the initial git push origin task1:review/master/new command.

  2. Check out the review's head version:

    $ git checkout review/master/1234
Important

You can only update Git Fusion-initiated reviews using Git Fusion.

For more information on Git Fusion, see the Git Fusion Guide.

Deleting shelves

If you have a number of unused shelves, you can delete them if you want to tidy up your workspace.

Important

By default, when you delete files from a shelved changelist, the files are not removed from the associated review.

However, Swarm can be configured to remove files from a review when they are deleted from an associated shelf, see Process shelf file delete when.

Do not use the Swarm user that is configured in the Swarm configuration file when deleting shelves, or deleting files from shelves. The Swarm logic processes the shelve-delete trigger event, if the event is invoked by the Swarm user it is rejected. The delete operations will fail.

To delete a shelf from a changelist without removing the shelved files from the associated review, use P4 or P4V to delete the entire shelf in one operation as described below. This enables you to delete a shelved changelist in your workspace without affecting the associated Swarm review even if Swarm is configured to remove files from a review when they are deleted from a shelf.

Using P4

To delete a shelved changelist without removing the files from the associated review:

  1. Use a command-line shell and type:
  2. $ p4 shelve -d -c changelist
    Important

    Do not delete the files from the shelf individually. Deleting the entire shelf ensures that files are not removed from an associated review even if Swarm is configured to do so.

  3. The shelved files are deleted from the pending changelist.

Using P4V

To delete a shelved changelist without removing the files from the associated review:

  1. In P4V, right-click on the pending changelist.
  2. Select Delete Shelved Files.
  3. Important

    Do not delete the files from the shelf individually. Deleting the entire shelf ensures that files are not removed from an associated review even if Swarm is configured to do so.

  4. The shelved files are deleted from the pending changelist.

Edit reviewers

A review author, or users with admin or super privileges are able to edit the reviewers for a review. Reviewers are able to join or leave reviews, or to change whether their vote is required or optional.

Note

If the review includes content that is part of a project or branch with Retain default reviewers enabled, the following restrictions apply to the review:

Additionally, the following individuals may edit reviewers:

To edit reviewers for a review:

  1. Navigate to a review.
  2. Click the edit reviewers button , which appears just to the left of reviewer avatars.

    The Reviewers dialog is displayed.

    Reviewers Dialog image
  3. Add or remove reviewers, or change the vote requirement.

    Use the reviewer search field to find users and groups by name, userid, groupid. The field auto-completes as you type, click on the user or group to add to the review.

    Click the X icon to the right of the userid or groupid to remove that reviewer from the review.

  4. Click the Save button to save any changes made.