ccollab admin trigger create-review

Top  Previous  Next

Usage: ccollab [global-options] admin trigger create-review [--review-id-regex <value>] <changelist>

 

create-review - Creates a new Review for a changelist if no Review already exists

 

Command Options

Option

Required?

Description

--review-id-regex <value>

N

Regular Expression that identifies Review ID in commit comment

<changelist>

Y

SCM-specific ID of an atomic set of changes

 

The create-review trigger automatically creates a review in Code Collaborator after the change is committed to the Subversion server. It's smart enough to not create reviews if they've already been created for this code.

For this hook to work smoothly you will need your Subversion usernames and Code Collaborator logins to match. Here "match" means "differs at most in capitalization." This ensures that when a developer checks in code the review is created under his Code Collaborator account.

 

If you don't do this the hook will still work, but reviews will be created under the system administrator's account. Someone will have to log into the system with that account and assign the review to someone else.

You may optionally specify a regular expression that identifies a Code Collaborator review ID inside a Subversion commit message. If you supply the regular expression, the create-review hook will check for this text in commit messages and automatically not create a new review if a non-canceled review with that ID already exists. This allows some users to do pre-commit review and others post-commit, and either way you know all code has been reviewed or at least that a review of all code exists in the system.

For Subversion, to install this trigger you will need to create a post-commit hook. If you already have a post-commit hook, you can add our tool wherever it is appropriate; otherwise you will need to create an executable hook as described in the Subversion documentation (typically a batch file under Windows or a shell script under Linux/Mac).

 

Example Windows batch file:

"C:\Program Files\Code Collaborator Client\ccollab.exe" --url <collabUrl> --user <collabUser> --password <collabPasswd> --scm subversion --svn-repo-url svn://url/to/repo --svn-exe "C:\Program Files\Subversion\bin\svn.exe" admin trigger create-review --review-id-regex "review:\s+(\d+)" %2 || exit 1

 

Example Linux/OSX shell script:

/collab/install/ccollab --url <collabUrl> --user <collabUser> --password <collabPasswd> --scm subversion --svn-repo-url svn://url/to/repo --svn-exe /usr/bin/svn admin trigger create-review --review-id-regex "review:\s+(\d+)" $2 || exit 1

 

Note our use of "exit 1" to ensure that the script terminates with a non-zero exit code if our trigger application fails.