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 upcomingrbt repo-hook
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 ap4trust
file 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
changes:
initialize_logging()
now accepts adebug
parameter to enable
debug logging for hooks.The call to
p4 change
no 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
settings.Tested with using a hard-coded user and a Perforce-provided
%client%
,
%clienthost%
, and%user%
.Tested with and without debugging information.
Tested with inaccessible Perforce changesets (which unveiled the
p4 change
error handling problem).
Summary | ID |
---|---|
d635ea2a9300bdde72ea4b4caaf07db94f9e0397 |