ccollab admin trigger ensure-reviewed (for Git)

Applies to Collaborator 13.7, last modified on July 16, 2021

Description

Use the ensure-reviewed trigger to ensure that the review that was created for the specified changelist has been completed by the time you submit the changelist to the Git repository. If the review has not been completed, the trigger blocks the submit operation and displays an error message informing the user about the problem.

Command Line Syntax

ccollab [global-options] admin trigger ensure-reviewed [--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 is comment.

Installation

To install this trigger you will typically create an update hook. If you already have an update hook, you can add our tool wherever it is appropriate; otherwise you will need to create an executable hook as described in the Git documentation. The update hook should iterate over the commits being pushed and call this trigger for each one of them, and then exit with a non-zero exit code if any of the trigger invocations failed.

Example shell script:

#!/bin/sh

refname="$1"

oldrev="$2"

newrev="$3"

for commit in `git rev-list $oldrev..$newrev -- ''`

do

/collab/install/ccollab --url <collabUrl> --user <collabUser> --password <collabPasswd> --scm git admin trigger ensure-reviewed $commit

exitcode=$(($exitcode + $?))

done

exit $exitcode

Note our use of "exit" to ensure that the hook script terminates with a non-zero exit code if our trigger rejects one of the commits.

See Also

ccollab admin trigger ensure-reviewed
Git Integration

Highlight search results