Installing triggers

With your P4 Code Review instance configured, the final step is to set up your P4 Server to notify your instance of important events. One option is to install triggers, which are user-defined scripts that generate notifications about events.

Install triggers only if you lack super user permissions or your system does not meet the requirements for P4 Code Review extensions, which are the preferred method of event notification. Extensions are typically simpler to install and manage than triggers. To learn about extensions, see Installing the P4 Code Review extension for P4 Server (recommended)

Follow these steps to install triggers on P4 Code Review. For information about configuring P4 Server triggers, see the P4 Server documentation.

Prerequisites

Verify that prerequisites are met:

  • P4 Code Review can be connected to P4 Servers (P4D) and commit servers:

    Do not connect P4 Code Review to P4 Broker, P4 Proxy, an edge server, forwarding replica, or read-only replica servers.

    P4 Code Review does not support P4 Servers that are configured to use P4AUTH. For more information, see Centralized authorization server (P4AUTH).

  • Do not install the P4 Code Reviewextension on your P4 Server if you intend to use P4 Code Review triggers.

Set up triggers

You can use triggers to customize the server operations. For example, use triggers can be set up to automatically run custom scripts or commands when certain events happen, such as submitting a changelist or creating a branch.

P4 Code Review provides a trigger script, written in Perl, that notifies P4 Code Review about activity within the P4 Server.

For information on configuring the Perl trigger script, see Trigger options

The operating system that hosts your P4 Server determines how to set up P4 Code Review triggers: