Swarm reviews promote collaboration on projects, which improves efficiency and enforces standards, since everyone involved can see file revisions as they evolve.

To create a pre-commit swarm review there are two basic steps, editing the pending changelist description and shelving the files.

Here, we will use P4V but the steps are the same using the command line or any Helix client. We have logged in to P4V as Aruna Gupta. This changelist contains a file, “EBolt Java”, that Aruna has edited and she wants her edits to be reviewed.

First, double click the changelist containing the file. In the description field we enter a description of our changes. Then, we type pound review separated from other text with a space or on a separate line.

We can also at mention specific users or groups by the user or group IDs, if we want them to be notified by email to review the file. All project members receive an email notification when a new Swarm review is started. Let's at mention Joe Coder since we want his input.

This is a pre-commit review so, we will not submit the changelist now. Instead, we will save it by hitting the save button.

Since the edited file was in the default pending changelist it gets saved to a number changelist. Next, right click on a new changelist and select shelf files.

Shelving the files along with entering pound review in the description field, triggers the Swarm review. A new Swarm number gets applied to the changelist. This new number functions as the Swarm review ID used in Swarm.

The files are not committed at this point, by starting a review, Swarm copies all the shelved files from the author's pending changelist into a Swarm managed changelist. Swarm’s managed changelist is the review and it's ID number is the review ID.

Here we are logged into Swarm as Joe Coder. We see a new entry in the activity stream from Aruna requesting a review. We can open the review from the link here. Or we can filter and sort reviews by project, votes, comments, date created, or last activity.

Let’s go back to “All Activity,” and open Aruna’s review request. The file currently checked in is on the left, and the same file, newly edited by Aruna, is on the right. The differences are highlighted.

We can click “Add a Comment” to post general comments or questions for all to see, or we can click directly on a line to add an inline comment or question. Comments, as well as project descriptions, support Markdown so you can easily add formatting, links, and images to your text.

At-mentioned users and project members who have contributed comments are considered reviewers and their images appear here. Reviewers can vote to indicate their thoughts on the readiness of the file.

This pull-down menu provides options to approve or reject this review. A review can be approved and the files committed to the server in one step from the Swarm interface.

Course - Using Swarm for Collaboration