[Crucible Knowledge Base]
Documentation for Crucible 3.0.x. Documentation for other versions is available too. 
![]()
You can use the Review CLI tool to create reviews in Crucible, for patches and commits, directly from your terminal. It takes the uncommitted changes in your workspace and creates a review for them in Crucible. The Review CLI tool may be especially useful if:
You can use the tool on Windows, Linux and Mac OS X, for repositories that are managed in:
The tool supports Crucible 3.0, and later versions. Python 2.7 must be installed on your local machine (Python 3 is not supported).
You can use the tool to create new reviews, and to update existing reviews with new patches.
On this page:
Download the Review CLI tool from either of the following locations in Crucible:
The script comes pre-configured for the user for the given SCM server.
Copy the script to a location somewhere in your system path, for greatest ease of use.
Python 2.7 is required.
Python 2.7 should come with your distribution. If not, or if 2.7 isn’t installed, you will need to install the appropriate package. Please refer to your package manager for the appropriate version.
You can install Python by running the latest Python 2.7 Installer for Windows.
Python 2.7 should come with any modern version of MacOS X. You can also download Python 2.7 from http://www.python.org/getit/.
To create a review using the Review CLI tool, run the script from a directory under SCM control that has local, uncommitted changes. The changes will be submitted to Crucible for review.
Call the script with the following command:
crucible.py <arguments list>
The Review CLI syntax is consistent with that for Crucible and FishEye smart commits. Examples of syntax usage are provided in the following table:
操作 | 構文 | 結果 |
|---|---|---|
| View usage help | crucible.py --help | Displays the help with descriptions of all the valid commandline arguments |
| Create a pre-commit review interactively | crucible.py | Gets the patch from the current SCM, prompts for the project and review title, and creates a draft review |
| Create a pre-commit review with a given project and title | crucible.py -m "the review title" CR-FE | Gets the patch from the current SCM, creates a draft review in the CR-FE project with the given title |
| Create a pre-commit review with moderator and reviewers | crucible.py CR-FE @matt @joe --moderator ted | Gets the patch from the current SCM, creates a review in the CR-FE project, adds matt and joe as the reviewers and ted as a moderator, starts the review |
| Create a pre-commit review anchored to a specific repository | crucible.py -r repo1 | Creates a pre-commit review interactively, trying to anchor the patch to the given repository |
| Add a patch to a review | crucible.py CR-FE-1204 | Gets the patch from the current SCM and adds it to the review CR-FE-1204 |
| Create a review from diff output | hg diff | crucible.py | Creates a pre-commit review interactively, taking the output of the first command as a patch |
| Create a review from a diff file | crucible.py -f file.diff | Creates a pre-commit review interactively, taking the output of the patch from the given file |
6 Comments
David Chou [Intuit]
Jun 06, 2013I'm having trouble understanding using this with Perforce.
Lukasz Pater
Jun 07, 2013The way the tool works currently it takes all the files that were modified, added or removed in the working copy and submits those for a review. It doesn't support choosing only files associated with a specific Perforce changelist. Please submit a feature request for this.
For a newly added file the whole file should be submitted for a review, as you expect. Please create a support reqest so that we can investigate further. Please provide the following in the request: the Python and os version, the file that fails to upload, and the debug output of running crucible.py (add -d to the command line).
David Chou [Intuit]
Jun 07, 2013Thanks for commenting Lukasz Pater. I've created a feature request for item #1: FE-4686 - Getting issue details... STATUS . I'll follow up with support on the second item.
David Chou [Intuit]
Jun 12, 2013Thanks for your support Lukasz!
For those interested in the fix for Perforce added files see: CRUC-6504 - Getting issue details... STATUS
Anonymous
Jun 20, 2013Is crucible.py meant to be usable on installations where LDAP authentication has been used to provide single sign on? I get an authentication error of the form below:
DEBUG:root:No authtoken, trying to get one
DEBUG:root:Trying to encode str as UTF-8
DEBUG:root:RestRequest: http://<SERVER:PORT>/rest-service/auth-v1/login - {'Content-Type': 'application/x-www-for
m-urlencoded', 'Authorization': ('Basic XXXXXXXXXXXXXXXXXXX',), 'Accept': 'application/json'} - userNa
me=<USERNAME>&password=<PASSWORD>
DEBUG:root:RestError: HTTP Error 401: Unauthorized
Lukasz Pater
Jun 20, 2013The tool should work fine with LDAP authentication. Please file a support request including both the server and the tool debug logs, so that we can investigate further.