ccollab admin trigger ensure-reviewed (for Perforce)

Top  Previous  Next

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

 

ensure-reviewed - Changelist cannot be submitted until review of this changelist has been completed

 

Command Options

Option

Required?

Description

--ignore-integrate

N

Allow integration changes to proceed without review

--review-id-regex <value>

N

Regular Expression that identifies Review ID in commit comment

<changelist-id>

Y

Changelist ID

 

This trigger ensures that a Review has been completed before changes can be committed to version control.

If a Review has not been completed, the commit will fail and the user will get an error message explaining that the changes need to be reviewed before commit.

 

To install this trigger edit your Perforce Triggers list (see Perforce manual for details) and add a line like the following (except supply your installation directory for the ccollab application, replace <values> as appropriate, and put everything on one line even though the following text is word-wrapping):

 

ccollab submit //depot/... "/usr/bin/ccollab --url <collabUrl> --user <collabUser> --password <collabPasswd> --scm perforce --p4port <p4port> --p4user <p4user> --p4passwd <p4passwd> admin trigger ensure-reviewed %changelist%"

 

On Unix systems the Perforce trigger system incorrectly splits up arguments by whitespace ignoring single quotes and other standard ways of indicating that data with spaces is actually a single argument. The solution is to use a separate bash script to call our trigger application.

 

You must supply credentials for a Perforce user that has at least read-only access.

 

Changelists that result from creating a new branch are ignored. Creating a new branch does not involve a code change, so it does not require review.

 

Integrating changes from one branch into another branch does make code changes and can introduce bugs, so by default this type of change is handled by the trigger. However, because integration changes frequently involve a very large number of files and because often it is necessary to integrate changes to many branches, this would require cumbersome reviews to be performed many times.

For this reason, the '--ignore-integrate' option can be used to ignore changelists consisting of only integration changes. In this case, enforcement of code review happens externally to the system: for example, a review could be performed on one branch, but other branches could be just directly integrated.