Log an error on gerrit checks misconfiguration

If a reporter attempts to report via the checks api but ends up
using SSH instead of HTTP, log it for the benefit of the operator.

Change-Id: If9864a5aaf1e77734a7f23f2187880f5e7f42ba9
This commit is contained in:
James E. Blair 2019-10-23 08:53:45 -07:00
parent c6db86ad38
commit dfda9bcdf1
1 changed files with 5 additions and 0 deletions

View File

@ -946,6 +946,11 @@ class GerritConnection(BaseConnection):
def review_ssh(self, item, message, submit, labels, checks_api,
file_comments, zuul_event_id=None):
if checks_api:
log = get_annotated_logger(self.log, zuul_event_id)
log.error("Zuul is configured to report to the checks API, "
"but no HTTP password is present for the connection "
"in the configuration file.")
change = item.change
project = change.project.name
cmd = 'gerrit review --project %s' % project