Swarm reviews promote collaboration on projects 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 with 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 “#review”, separated from other text with a space or on a separate line. We can also @mention specific users by their user 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.

Lets @mention Joe Coder, since we want his input. This is a pre-commit review, so will 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 numbered changelist.

Next, right-click on the new changelist and select, “Shelve Files…” Shelving the files, along with entering #review in the description field, triggers the Swarm review.

A new Swarm number get 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 of the shelved files from the author's pending changelist into a Swarm-managed changelist; Swarm's managed changelist is the "review", and its 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.

This is the Aruna's Swarm review request. The currently checked-in file 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 in-line comment or question.

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

Thanks for watching.

Course - Using Swarm for Collaboration