Helix Swarm is a powerful and flexible code review and collaboration solution that helps teams ship quality software faster. Swarm enables review of code and other assets before or after commit and can be customized to fit into various workflows. Swarm stores all of its metadata (including Reviews, Projects, and Comments) in Helix Server, which makes it an attractive solution because it does not require backing up of an external database. For more about using and installing Swarm, see the Helix Swarm Guide.
Following is the happy path workflow for a Swarm review. For more permutations and variations, see the Helix Swarm Guide.
To use the full list of features of the P4V integration with Swarm, you need to have Swarm 2014.4 or later installed. The P4V integration also works with Swarm 2014.3, but some features, such as the required reviewers option, are not visible. For details on how to set up the Swarm integration, see Configuring Swarm connections in the Helix Core Server Administrator Guide: Fundamentals.
Example p4 property
command to run:
p4 property -a -n P4.Swarm.URL -v https://swarm.yourcompanydomain.com
where https://swarm.yourcompanydomain.com
is the
URL for your
Swarm
server.
If you are testing the
Swarm
integration, you may wish to set the property for a specific user. For
example, to enable the
Swarm
integration for the user username
:
p4 property -a -u username -n P4.Swarm.URL -v https://swarm.yourcompanydomain.com
Similarly, you can enable the
Swarm
integration for a specific group of users. For example, to enable the
Swarm
integration for the group group
:
p4 property -a -g group -n P4.Swarm.URL -v https://swarm.yourcompanydomain.com
P4V uses a Swarm integration timeout, in seconds, to limit delays in the P4V user interface. The timeout can be adjusted by running the following command:
p4 property -a -n P4.Swarm.Timeout -v 10
The default timeout value is 10 seconds. The
timeout can be set for a specific user or a specific group by including
the -u
or
username
-g
options,
respectively.group
When Swarm integration is enabled, a number of additional features is available in P4V, including new context menus, request review and update review dialogs, badging on pending changes, committed changes, and history, as well as Review ID and Review State columns.
You can request reviews from either pending or submitted changelists. Note that a changelist cannot be associated with more than one review. However, a review can have more than one changelist associated with it.
Best practices:
Reviewers:
To request a review from a pending changelist, do the following:
Go to the pending changelist tab, right-click the changelist, and select Request New Swarm Review​.
If the changelist is already part of a Swarm review, this option is not available.
The Request New Swarm Review dialog displays a list of files to be shelved in order to request the review. If the changelist already has shelved files, the dialog also lists these already shelved files. The aggregate of the shelved files comprises the review.
In the Request New Swarm Review dialog, enter a description.
Each review requires a description. The default description is the changelist's description.
Optionally, select additional options, including: reviewers (users or groups), reverting checked out files after they are shelved, not shelving unchanged files, and opening the review in Swarm.
Click Request Review.
The pending changelist is badged with a Swarm icon, and P4V updates the Review Id and Review State fields with their values from Swarm.
It is a best practice that you, as the author, keep this pending changelist for subsequent updates to the review. You can use this same changelist to submit the review. If the review is rejected or the review is committed from Swarm, you should manually discard this pending change so that it does not get accidentally committed.
To request a review from a submitted changelist, to the folloing:
Go to the Submitted changelist tab, right-click the changelist, and select Request New Swarm Review.
If the changelist is already part of a Swarm review, this option is not available.
The Request New Swarm Review dialog displays the files to be added to the review.
In the Request New Swarm Review dialog, enter a description.
Each review requires a description. The default description is the changelist's description.
Optionally, select additional options, including reviewers and opening the review in Swarm.
Click Request Review.
The pending changelist is badged with a Swarm icon, and P4V updates the Review Id and Review State fields with their values from Swarm.
If you need to update the files in a review for any reason, such as to respond to the feedback you received from the reviewers, P4V lets you update an existing Swarm review.
When updating a Swarm review from a pending changelist, the changelist can -- but does not have to be -- already associated with the review.
To update a review from a pending changelist that is associated with the review, do the following:
On the Pending tab, right-click the changelist and select Update Swarm Review 'xxxx', where xxxx is the review ID.
The Update Files in Review dialog displays a list of files to be shelved in order to update the review. If the changelist already has shelved files, the dialog also lists these already shelved files. The aggregate of the shelved files comprises the updated review.
Optionally, select additional options, including reverting checked out files after they are shelved, not shelving unchanged files, and opening the review in Swarm.
Click Update Files.
The files in the associated review are updated.
To update a review from a pending changelist that is not yet associated with the review, do the following:
On the Pending tab, right-click the changelist and select Update Swarm Review.
This scenario is typical if you are working on a different machine than where you originally requested the review or if you have discarded the original changelist you used for creating the review. If you already have a changelist associated with the review, you would likely use that changelist and follow the instructions in option 1.
The Update Files in Review dialog displays a list of files to be shelved in order to update the review.
In the Update Review field, enter the ID of the review you would like to update with these files.
Click Update Review.
The changelist you used to update the review becomes associated with the review.
To associate a submitted changelist with an existing Swarm review, do the following:
Right-click the submitted changelist and select Add to Swarm Review.
The Add to a Swarm Review dialog displays a list of files to be added to the review.
In the Update Review field, enter the ID of the review to which you would like to add these files.
Click Add to Review.
The files get added to the review.
If you leave the Open Review in Swarm check box option selected in the Review Request or Review Update dialogs, P4V launches Swarm to the review page in your default browser. This serves as confirmation that the review has been created or updated.
As a reviewer, you may be inspecting a review in Swarm and decide you need to get a local copy of the files. The review ID shown in Swarm corresponds to a pending changelist in Helix Server that contains these files. The simplest way to get these files from P4V is to use the Go To Spec dialog, as follows:
In P4V, open the Go To Spec dialog with the keyboard shortcut of +G (+G on Mac).
Enter the review ID and click OK.
P4V displays the Pending Changelist dialog.
Right-click the files you want to unshelve and select Unshelve.
P4V displays the Unshelve dialog.
Select the pending changelist to which you want these files to be unshelved and click Unshelve.
P4V retrieves a local copy of these files into your workspace.
P4V adds a Review Id and Review State column to the Submitted and Pending tabs and the History tab for connections that have the Swarm integration enabled.
If you are connected to a Helix Server with the Swarm integration enabled and do not see the columns, right-click the header row and select these fields.
If the connection to Swarm is interrupted, you can re-establish it from the Connection > Reconnect to Swarm menu.
This menu item is only available if the P4.Swarm.URL is defined.