Add argument parsing, settings, and docs for p4-trigger-script.
Review Request #13060 — Created May 22, 2023 and submitted
This greatly enhances the code for p4-trigger-script, bringing in some
functionality that will be available in the upcoming
command for RBTools 5.
The script now allows for command line options for customizing behavior
and connection information, which means that users don't have to fork
and modify the script.
It also allows admins to specify certain arguments on the command line
that will be expanded when calling the trigger. This is needed to
talk to Perforce and edit changes as the submitting user.
New in-script settings (and command line options) are added for enabling
debugging, setting a
p4trustfile location, setting a Perforce client
name and host, and setting a Review Board API token.
Documentation is provided at the top of the script to help admins get
set up. Docs on the website will be created separately, once this is
fully tested in production.
Some changes had to be made within RBTools to facilitate some of these
initialize_logging()now accepts a
debugparameter to enable
debug logging for hooks.
The call to
p4 changeno longer ignores error result (which caused
errors to be sent to the caller as a valid changeset).
Logging information for failed marshalled commands now includes
demarshalled payload and stderr information.
Thoroughly tested the script with command line options and in-script
Tested with using a hard-coded user and a Perforce-provided
Tested with and without debugging information.
Tested with inaccessible Perforce changesets (which unveiled the
p4 changeerror handling problem).
Added a blurb about configuring this with an RBTools for Windows installer environment.
Revision 2 (+736 -76)