ccollab admin trigger ensure-review-started (for Perforce)

Applies to Collaborator 14.5, last modified on April 18, 2024

Description

Use the ensure-review-started trigger to ensure that a review for the specified changelist has been started. The trigger blocks the submit operation if there is no review for the changelist in Collaborator, and displays an error message telling that the changes need to be reviewed before submitting them to the Perforce repository.

For Perforce this trigger has "change-content" type and is invoked after the changelist creation and file transfer, but before file commit.

Command Line Syntax

ccollab [global-options] admin trigger ensure-review-started [--ignore-integrate] [--review-id-regex <value>] <changelist-id>

Command Options

Option

Required?

Description

<changelist-id>

Yes

The changelist identifier.

--ignore-integrate

No

If specified, Collaborator ignores the merge changes to the source control (that is, the trigger is not fired for these changes. See below).

--review-id-regex <value>

No

A regular expression that identifies the review ID in the commit comment.

Installation

To install the trigger, add a line like this to your Perforce Triggers list:

ccollab change-content //depot/... "/usr/bin/ccollab --url <collabUrl> --user <collabUser> --password <collabPasswd> --scm perforce --p4port <p4port> --p4client %client% --p4user <p4user> --p4passwd <p4passwd> admin trigger ensure-review-started %changelist%"

Some notes:

  • Specify your installation directory for ccollab and replace <values> with appropriate data. Also, type all parameters in a single line even though the text above occupies several lines.
  • The Perforce user that you specify must have at least read-only access to the repository.
  • On Unix systems, Perforce incorrectly recognizes arguments that include spaces. It ignores quotes and other standard ways of indicating that the data with spaces is actually one argument. The workaround is to use a separate bash script to call our trigger.

Remarks

  • The trigger ignores changelists that correspond to new branch creation. Creating a new branch does not involve changes in code, so it does not require a review.
  • Perforce treats branch merge changelists like ordinary changelists as they bring changes to source code and can introduce bugs. So, by default, the trigger handles this type of changes. However, since the merge changelists often include a large number of files and since you often need to merge several branches, this approach could require cumbersome reviews to be performed many times.
    To avoid possible issues, use the --ignore-integrate command-line option. If it is specified, the trigger will ignore changelists that include "merge" changes only. Make sure to review changes in one branch before merging them with other branches.
  • For information on Perforce triggers, see Perforce System Administrator's Guide.

See Also

ccollab admin trigger ensure-review-started
Perforce Integration

Highlight search results