ccollab admin trigger ensure-review-started (for Subversion)

Applies to Collaborator 14.6, last modified on October 29, 2024

Description

Use the ensure-review-started trigger to ensure that a review for the specified changelist has been started. The trigger blocks the submit operation if there is no review for the changelist in Collaborator, and displays an error message telling that the changes need to be reviewed before submitting them to the Subversion repository.

Command Line Syntax

ccollab [global-options] admin trigger ensure-review-started [--review-id-regex <value>] <changelist-id>

Command Options

Option

Required?

Description

<changelist-id>

Yes

The changelist identifier.

--review-id-regex <value>

No

A regular expression that identifies the review ID in the commit comment.

Installation

To install this trigger you will need to create a pre-commit hook. If you already have a pre-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\Collaborator Client\ccollab.exe" --url <collabUrl> --user <collabUser> --password <collabPasswd> --scm subversion --svn-user <svnUser> --svn-passwd <svnPasswd> --svn-repo-path %1 --svn-look-exe "C:\Program Files\Subversion\bin\svnlook.exe" admin trigger ensure-review-started --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-user <svnUser> --svn-passwd <svnPasswd> --svn-repo-path $1 --svn-look-exe /usr/bin/svnlook admin trigger ensure-review-started --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.

Remarks

  • You must specify the --svn-repo-path and --svn-look-exe global options.
  • You need to specify the --svn-user and --svn-passwd global options. Also, in order for this hook to work smoothly, you will need your Subversion usernames and Collaborator logins to match (the match is case-insensitive).
  • If you have an empty password for Collaborator account (which is not recommended), you should pass an empty string as the password global option: --password ""
  • You must require developers to put the review ID somewhere in the Subversion commit message. The format of this text is completely up to you; you must supply a Java-style regular expression that identifies this text and specifically calls out the review ID inside that text using the --review-id-regex command option.

See Also

ccollab admin trigger ensure-review-started
Subversion Integration

Highlight search results