ccollab admin trigger ensure-reviewed (for Perforce)

Applies to Collaborator 13.5, last modified on December 21, 2021

Description

Use the ensure-reviewed trigger to ensure that the review that was created for the specified changelist has been completed by the time you submit the changelist to the Perforce repository. If the review has not been completed, the trigger blocks the submit operation and displays an error message informing the user about the problem.

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-reviewed [--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 is 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-reviewed %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-reviewed
Perforce Integration

Highlight search results