Review cleanup

When a review is created in Swarm, it creates its own version of the changelist, leaving the user's own changelist untouched so as not to interfere with the user's ongoing work. Each time new work is submitted to the review, Swarm creates a new changelist so that there is a versioned history of the review.

When the review is finally committed it is Swarm's own changelist that is committed. Swarm's changelists are generally hidden from the users, but the user's changelist will remain open. By default it is necessary for the user to tidy up and remove this changelist themselves after the review has been completed.

There is an option to do this automatically when the review is committed. Configuration for this is expressed with a reviews block in the SWARM_ROOT/data/config.php file, similar to the following example:

<?php
'reviews' => array(
'cleanup' => array(
'mode' => 'user', // auto - follow default, user - present checkbox(with default)
'default' => false, // clean up pending changelists on commit
'reopenFiles' => false, // re-open any opened files into the default changelist
),
),

By default, this option is enabled but defaults to no clean up (so a user can select the option if they want to when they commit a review).

If the Helix Server user that Swarm is configured to use is a super user, then the user can clean up all user changelists associated with a review. If this is not the case, then the user who commits a review can only clean up changelists that are in their name.

By default, Swarm only cleans up changelists that are owned by the commiting user. In the case where a user is commiting a review that has been contributed to by other users, their changelists will not be cleaned up.

If you want to configure Swarm to clean up all changelists contributing to a review, regardless of whether they are owned by the commiting user, you can do this by granting the Helix Server user that Swarm is configured as 'super' permissions/privileges (rather than just the 'admin' permissions/privileges that swarm requires for its other operations).

Note

There is an API option that allows full cleanup to be executed with super permissions using an external script. This removes the need for the Swarm Helix Server user to have super privileges. See the API notes for details on this.

The review cleanup feature is designed to help users keep their workspaces clean, and prevent the proliferation of unwanted changelists after reviews have been approved and committed.

However, it cannot guarantee to be perfect, and because it is taking actions automatically on the part of the user, it may do things that the user doesn't expect. The following caveats should be kept in mind when using this feature.

There is an API endpoint available which can be used by a super user to tidy up changelists which can't be removed automatically. See API Endpoints for details.