Uninstall P4 Code Review

This section covers the steps required to uninstall P4 Code Review.

Background

The bulk of P4 Code Review's metadata (activity, comments, review records, followers) is stored in p4 keys under swarm-*. If you are using a 2012.1+ server, P4 Code Review also defines user groups for each project that you define. The names of these groups correspond 1-to-1 with projects, for example swarm-project-fantastico. P4 Code Review manages a pool of client workspaces that it uses to shelve and commit files. These clients are named swarm-{uuid}, for example swarm-5ad4a9c0-06e7-20eb-897f-cbd4cc934295.

Uninstall steps

  1. Depending on how you have configured your Helix Core Server events, do one of the following:

    • Uninstall the P4 Code Review P4 Server extension. To do this, run the following command on your P4 Server:

      p4 extension --delete Perforce::helix-swarm --yes

    • Uninstall the P4 Code Review triggers. As a super user, run the p4 triggers command from your P4 Server and manually remove all the P4 Code Review trigger code lines.

  2. Remove your web server's virtual host configuration for P4 Code Review by disabling the P4 Code Review site (perforce-swarm-site). If you have made any non-standard changes for P4 Code Review such as SSL configuration or if an alternate web server is used, you must remove these changes for P4 Code Review.

    Depending on your OS distribution, do one of the following:

    • Ubuntu (run the following command as root):

      1. Disable the Swarm site:

        a2dissite perforce-swarm-site

      2. Delete the Swarm site:

        Delete /etc/apache2/sites-available/perforce-swarm-site.conf

    • RHEL/Amazon Linux 2 (run the following command as root):

      Delete the Swarm site:

      Delete /etc/httpd/conf.d/perforce-swarm-site.conf

  3. Restart your web server.

  4. Delete groups/clients/keys that are prefixed with swarm-*.

    The clients could contain shelved files for reviews. Determine how you want to handle those files prior to deleting the clients.

  5. Additional indexed information is stored in the database file db.ixtext. Unfortunately, indexed jobs and other generic indexed information would be lost if this table was simply removed, and modifying the database file can be a dangerous operation in a number of P4 Server deployment scenarios.

    Contact Perforce support for assistance if you feel the need to remove P4 Code Review's indexed information.

  6. Rebuild the job index. The best approach is to run:

    $ p4 jobs -R

    which rebuilds the db.ixtext table. There are two caveats that likely require discussion with Perforce support:

    • If you make use of the unsupported p4 index command, you cannot use this approach, as it would remove all of your indexes.
    • If you have indexing turned on for the domain table, you must also run:

      $ p4d -xf index.domain.owner
  7. If the P4.Swarm.URL or P4.Swarm.CommitURL properties were set (for details, see Client integration and Commit-edge deployment respectively), they should be unset to prevent P4V (and potentially other clients) from attempting P4 Code Review operations. We recommend you view all the properties and delete them all.

    To delete each P4 Code Review property:

    $ p4 property -d -n <P4.Swarm property> -s <sequence>

    The sequence is provided in the property list. A property with #none is sequence 0.

    To discover all of the definitions of the P4.Swarm.* properties and their sequence numbers, as a Perforce super user run the following command:

    $ p4 property -Al -n P4.Swarm

    For example, the following property values are returned that apply to all users and groups:

    $ p4 property -Al -n P4.Swarm
    P4.Swarm.CommitURL = https://myswarm.url/ (any) #none
    P4.Swarm.CommitURL = https://myswarm1.url/ (any) #1
    P4.Swarm.URL = https://myswarm.url/ (any) #none
    P4.Swarm.URL = https://myswarm3.url/ (any) #3
    P4.Swarm.URL = https://myswarm2.url/ (any) #2
    P4.Swarm.URL = https://myswarm1.url/ (any) #1

    To delete all of these property definitions, you would run the following commands:

    $ p4 property -d -n P4.Swarm.CommitURL -s0
    $ p4 property -d -n P4.Swarm.CommitURL -s1
    $ p4 property -d -n P4.Swarm.URL -s0
    $ p4 property -d -n P4.Swarm.URL -s3
    $ p4 property -d -n P4.Swarm.URL -s2
    $ p4 property -d -n P4.Swarm.URL -s1
    

    To verify if all the properties have been deleted, run the following command as a Perforce super user:

    $ p4 property -Al P4.Swarm