Description
Use the create-review-with-reviewer
trigger to create a new review in Collaborator with reviewers or to add changelist to an existing review by providing changelist description in specific format. Users can explicitly manage review creation and uploading changelist to Collaborator from Perforce.
This trigger can be used with Perforce "shelve event" and "submit" triggers.
Command Line Syntax
ccollab [global-options] admin trigger create-review-with-reviewer <changelist>
Command Options
Installation
To install the trigger, add a line like this to your Perforce Triggers list:
-
Example 1: Adding the trigger as a shelve event trigger:
ccollab shelve-submit //depot/... "/usr/bin/ccollab --url <collabUrl> --user <collabUser> --password <collabPasswd> --scm perforce --p4port <p4port> --p4client <p4client> --p4user <p4user> --p4passwd <p4passwd> admin trigger create-review-with-reviewer %changelist%"
-
Example 2: Adding the trigger as a submit trigger:
ccollab change-content //depot/... "/usr/bin/ccollab --url <collabUrl> --user <collabUser> --password <collabPasswd> --scm perforce --p4port <p4port> --p4client <p4client> --p4user <p4user> --p4passwd <p4passwd> admin trigger create-review-with-reviewer %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 read-write access to the changelist.
- 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
- In order for this trigger to work, changelist description should start with below syntax:
- If changelist description start with any text other than #review-create or #review-add, then auto reviews will not be created, and default behavior will persist.
- If there is error in syntax for command #review-create, ‘odd’ text will be ignored when trigger is executed, and review will be created in Collaborator.
- If there is error in syntax for command #review-add, appropriate error will be thrown explaining the issue.
- For information on Perforce triggers, see Perforce System Administrator's Guide.
Changelist Description Syntax |
Description |
---|---|
#review-create, if specified it will create a new review in Collaborator |
|
#review-add, if specified will add the changelist to review(an integer number) |
Examples
Below are the changelist description examples:
#review-create
#review-create @John, @Sam –title "Auto Review"
#review-add 14