Start a code review

If your P4 Server is configured as a commit-edge deployment, and your normal connection is to an edge server, P4 Code Review refuses to start reviews for shelved changes that have not been promoted to the commit server.

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

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

If your changelist only contains a stream spec and its location in the P4 Server is not associated with a P4 Code Review 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.

  1. Use the P4 command-line (P4) or a client to create the shelved or committed changelist.
  2. Start a code review by using one of the following approaches:

Use P4 Code Review:

  1. Use P4 Code Review to view a shelved or submitted changelist.
  2. To view a shelved or submitted 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.
  4. Requesting a review on a shelved changelist uses the pre-commit model and requesting a review on a submitted changelist uses the post-commit model.

The Request Review button is disabled for changelists with a file count greater than the limit set for max_changelist_files in the SWARM_ROOT/data/config.php file. This is to prevent out of memory errors within P4 Code Review. For more information on changing this file count limit, see Changelist files limit

Use P4 command-line (P4):

When you are about to shelve or submit files:

  1. Include #review within your changelist (separated from other text with whitespace, or on a separate line).

    Once the review begins, P4 Code Review replaces #review with #review-12345, where 12345 is the review's identifier.

    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 or submit operation.
  5. 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.

You can also start a review with P4V, P4 for Visual Studio, and P4 for Eclipse. See below for details:

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

Once a review has started

Wait for someone else to review your code, or see Contribute comments or code changes to a code review More review activities are available.