diff options
author | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2015-12-16 12:02:29 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2015-12-18 14:04:14 +0000 |
commit | 613347a31f9d56cfd2a204b2e3f030bbf70ceeb6 (patch) | |
tree | 2c178fa783006234bf17785b1a130b45c8a2bfa3 | |
parent | 3564f7cbbf073db127d843b80944fbdb74f9749e (diff) |
tolerate non-json output in front of json content from worker
this avoids that die if the worker emits any warnings or errors before
the verdict.
Change-Id: I7e5e6ec71983eb2352bf83e4a300c3a6e0a090c2
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
-rwxr-xr-x | git-hooks/gerrit-bot | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/git-hooks/gerrit-bot b/git-hooks/gerrit-bot index 522f5d2..7e51d0a 100755 --- a/git-hooks/gerrit-bot +++ b/git-hooks/gerrit-bot @@ -235,6 +235,9 @@ sub process_commit($$$$$) push @invite, @MAINTAINERS; } else { $use_rest = 1; + while ($verdict =~ s/^([^\{][^\n]*\n)//s) { + print STDERR "Non-JSON output from worker: $1\n"; + } $verdict = decode_json($verdict); defined($verdict) or die "cannot decode verdict as JSON\n"; $$verdict{labels} = { 'Sanity-Review' => $score, 'Code-Review' => ($iswip ? -2 : 0) }; |