gerrit/Documentation/cmd-test-submit-rule.txt
Shawn Pearce b1f730b894 Add REST APIs to test submit_rule and submit_filter
These are available over SSH, but not on HTTP. Make them available
on HTTP with REST API views on the revision resource. Use the REST
implementations to back the SSH commands, so the implementation is
not duplicated.

To match the REST API the SSH test-submit rule command no longer
accepts a format parameter. Output is in pretty formatted JSON.

Change-Id: I6a57b4561067eaa32d407a426c95ea61a96f1948
2013-03-04 11:13:36 -08:00

69 lines
1.4 KiB
Plaintext

gerrit test-submit rule
=======================
NAME
----
gerrit test-submit rule - Test prolog submit rules with a chosen changeset.
SYNOPSIS
--------
[verse]
'ssh' -p <port> <host> 'gerrit test-submit rule'
[-s]
[--no-filters]
CHANGE
DESCRIPTION
-----------
Provides a way to test prolog link:prolog-cookbook.html[submit rules].
OPTIONS
-------
-s::
Reads a rules.pl file from stdin instead of rules.pl in refs/meta/config.
--no-filters::
Don't run the submit_filter/2 from the parent projects of the specified change.
ACCESS
------
Can be used by anyone that has permission to read the specified changeset.
EXAMPLES
--------
Test submit_rule from stdin and return the results as JSON.
====
cat rules.pl | ssh -p 29418 review.example.com gerrit test-submit rule -s I78f2c6673db24e4e92ed32f604c960dc952437d9
[
{
"status": "NOT_READY",
"reject": {
"Any-Label-Name": {}
}
}
]
====
Test the active submit_rule from the refs/meta/config branch, ignoring filters in the project parents.
====
$ ssh -p 29418 review.example.com gerrit test-submit rule I78f2c6673db24e4e92ed32f604c960dc952437d9 --no-filters
[
{
"status": "NOT_READY",
"need": {
"Code-Review": {}
"Verified": {}
}
}
]
====
SCRIPTING
---------
Can be used either interactively for testing new prolog submit rules, or from a script to check the submit status of a change.
GERRIT
------
Part of link:index.html[Gerrit Code Review]