Start a code review

Important

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

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

Tip

If your changelist only contains a stream spec and its location in the Helix Core Server is not associated with a Swarm project, the review that you create will not have any default reviewers or workflow rules. To associate the review with a project so that it has default reviewers and obeys the project workflow rules, include a file change from the project path in the changelist when you create the review.

The example workflow will only allow you to create a pre-commit review. If you try to commit your changelist Swarm will reject your submit.

Create a shelved changelist:

  1. Use the Helix Core command-line (P4) or a client to shelve your changelist.
  2. Start a code review by using one of the following approaches:

Use Swarm:

  1. Use Swarm to view the shelved changelist.
  2. Tip

    To view a shelved changelist, use a Quick URL. For example, if your change is 54321, visit the URL: https://myswarm.url/54321.

  3. Click the Request Review button to request a review of that changelist. This creates a pre-commit review as required by the example workflow that we are using.

Use Helix Core command-line (P4):

When you are about to shelve files:

  1. Include #review within your changelist (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 @mention for users, and @@mention for groups in the changelist description for each desired reviewer.
  3. If your @mention or @@mention includes an asterisk (*) before the userid or groupid, for example @*userid, that user or all of the group members become required reviewers. If your @@mention includes an exclamation mark (!) before the groupid, for example @@!groupid, the members of that group become required reviewers but only one member of the group is required to vote. See Required reviewers for details.

  4. Complete your shelve operation.
  5. Warning

    If you shelve a changelist and subsequently edit the description to include #review, a review is not started. You must re-shelve the files after adding #review.

Tip

You can also start a Swarm review with P4V, P4VS, and P4Eclipse. See below for details:

Note

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