ccollab admin trigger create-review-with-reviewer (for Perforce)

Applies to Collaborator 14.6, last modified on November 06, 2024

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

Option

Required?

Description

<changelist>

Yes

SCM-specific ID of an atomic set of changes.

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:
  • Changelist Description Syntax

    Description

    #review-create, REQUIRED
    [<@reviewer1>,<@reviewer2>,…,<@reviewerN>], OPTIONAL
    [<--title "review_title">], OPTIONAL

    #review-create, if specified it will create a new review in Collaborator
    @reviewer if specified will add the reviewer in the review. The reviewer should exactly match login username in Collaborator Enterprise.
    --title "review-title" if specified will add the title in review else review will be created with default title.

    #review-add, REQUIRED
    [<review-id>], REQUIRED

    #review-add, if specified will add the changelist to review(an integer number)

  • 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.

Examples

Below are the changelist description examples:

#review-create
#review-create @John, @Sam –title "Auto Review"
#review-add 14

See Also

ccollab admin trigger
Perforce Integration

Highlight search results